Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for one-way bus configuration so that if a bus name is specifi…
…ed in the configuration, the name is used as the bases for the esent storage directory instead of the default "one_way.esent"
- Loading branch information
Ken Baltrinic
committed
Jul 25, 2011
1 parent
8817adc
commit d197c71
Showing
10 changed files
with
95 additions
and
27 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
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
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
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
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
63 changes: 63 additions & 0 deletions
63
Rhino.ServiceBus.Tests/RhinoQueues/UsingOneWayBusWithBusNameSpecified.cs
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,63 @@ | ||
using System; | ||
using System.IO; | ||
using Castle.Windsor; | ||
using Rhino.ServiceBus.Hosting; | ||
using Rhino.ServiceBus.Impl; | ||
using Xunit; | ||
|
||
namespace Rhino.ServiceBus.Tests.RhinoQueues | ||
{ | ||
public class UsingOneWayBusWithBusNameSpecified : WithDebugging, IDisposable | ||
{ | ||
private const string DEFAULT_STORAGE_DIRECTORY = "one_way.esent"; | ||
private const string ALTERNATE_BUS_NAME = "another_one_way_bus"; | ||
private const string ALTERNATE_STORAGE_DIRECTORY = ALTERNATE_BUS_NAME + ".esent"; | ||
|
||
private readonly IWindsorContainer container; | ||
private readonly string baseStorageLocation; | ||
private readonly string defaultOneWayDirectory; | ||
private readonly string alternateOneWayDirectory; | ||
|
||
public UsingOneWayBusWithBusNameSpecified() | ||
{ | ||
baseStorageLocation = Directory.GetCurrentDirectory(); | ||
|
||
defaultOneWayDirectory = Path.Combine(baseStorageLocation, DEFAULT_STORAGE_DIRECTORY); | ||
if (Directory.Exists(defaultOneWayDirectory)) | ||
Directory.Delete(defaultOneWayDirectory, true); | ||
|
||
alternateOneWayDirectory = Path.Combine(baseStorageLocation, ALTERNATE_STORAGE_DIRECTORY); | ||
if (Directory.Exists(alternateOneWayDirectory)) | ||
Directory.Delete(alternateOneWayDirectory, true); | ||
|
||
var hostConfiguration = new RhinoQueuesHostConfiguration() | ||
.Bus(null, ALTERNATE_BUS_NAME) | ||
.Receive("System.string", "rhino.queues://nowhere/no_queue"); | ||
|
||
container = new WindsorContainer(); | ||
new OnewayRhinoServiceBusConfiguration() | ||
.UseConfiguration(hostConfiguration.ToBusConfiguration()) | ||
.UseCastleWindsor(container) | ||
.Configure(); | ||
container.Resolve<IOnewayBus>(); | ||
|
||
} | ||
|
||
[Fact] | ||
public void Storage_should_be_created_base_on_bus_name_location() | ||
{ | ||
Assert.True(Directory.Exists(alternateOneWayDirectory), "Expected directory not found:" + alternateOneWayDirectory); | ||
} | ||
|
||
[Fact] | ||
public void Storage_should_not_be_created_at_default_location() | ||
{ | ||
Assert.False(Directory.Exists(defaultOneWayDirectory), "Unexpected directory found:" + defaultOneWayDirectory); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
container.Dispose(); | ||
} | ||
} | ||
} |
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
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
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
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