Skip to content

Commit

Permalink
Support path expansion in config file
Browse files Browse the repository at this point in the history
Support configuration path such as "%APPDATA%\blah" which are expanded
when read in
  • Loading branch information
mr-miles committed Sep 16, 2012
1 parent c55bdd5 commit a8b5bda
Show file tree
Hide file tree
Showing 3 changed files with 419 additions and 377 deletions.
39 changes: 39 additions & 0 deletions Rhino.ServiceBus.Tests/ConfigReaderTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Threading;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Castle.Windsor.Configuration.Interpreters;
using Rhino.ServiceBus.Impl;
using Rhino.ServiceBus.Internal;
using Rhino.ServiceBus.Config;
using System.IO;
using Xunit;

namespace Rhino.ServiceBus.Tests
{
public class ConfigReaderTests
{

[Fact]
public void Can_get_path_variable()
{
var bus = new BusElement();
var expected = @"folder\app\one_way";
bus.Path = @"folder\app";

Assert.Equal(expected+".esent", bus.QueuePath);
Assert.Equal(expected + "_subscriptions.esent", bus.SubscriptionPath);
}

[Fact]
public void Can_get_path_variable_replacement()
{
var bus = new BusElement();
var expected = Path.Combine(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "app"), "one_way");
bus.Path = @"%APPDATA%\app";

Assert.Equal(expected+".esent", bus.QueuePath);
Assert.Equal(expected + "_subscriptions.esent", bus.SubscriptionPath);
}
}
}
Loading

0 comments on commit a8b5bda

Please sign in to comment.