forked from hibernating-rhinos/rhino-esb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support path expansion in config file
Support configuration path such as "%APPDATA%\blah" which are expanded when read in
- Loading branch information
Showing
3 changed files
with
419 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
Oops, something went wrong.