Skip to content

Commit

Permalink
Fix Path.Combine paths
Browse files Browse the repository at this point in the history
  • Loading branch information
bording committed Jul 19, 2017
1 parent 08bf18e commit a1e62c2
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 11 deletions.
@@ -1,4 +1,5 @@
using System.IO;
using System;
using System.IO;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.AcceptanceTesting.Support;
Expand All @@ -11,8 +12,19 @@ public Task Configure(string endpointName, EndpointConfiguration configuration,
{
var testRunId = TestContext.CurrentContext.Test.ID;

//can't use bin dir since that will be too long on the build agents
storageDir = Path.Combine(@"c:\temp", testRunId);
string tempDir;

if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
//can't use bin dir since that will be too long on the build agents
tempDir = @"c:\temp";
}
else
{
tempDir = Path.GetTempPath();
}

storageDir = Path.Combine(tempDir, testRunId);

configuration.UsePersistence<InMemoryPersistence, StorageType.Subscriptions>();
configuration.UsePersistence<InMemoryPersistence, StorageType.Timeouts>();
Expand Down
@@ -1,3 +1,4 @@
using System;
using System.IO;
using System.Threading.Tasks;
using NServiceBus;
Expand All @@ -21,8 +22,19 @@ public Task Configure(string endpointName, EndpointConfiguration configuration,
{
var testRunId = TestContext.CurrentContext.Test.ID;

//can't use bin dir since that will be too long on the build agents
storageDir = Path.Combine(@"c:\temp", testRunId);
string tempDir;

if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
//can't use bin dir since that will be too long on the build agents
tempDir = @"c:\temp";
}
else
{
tempDir = Path.GetTempPath();
}

storageDir = Path.Combine(tempDir, testRunId);

//we want the tests to be exposed to concurrency
configuration.LimitMessageProcessingConcurrencyTo(PushRuntimeSettings.Default.MaxConcurrency);
Expand Down
Expand Up @@ -41,7 +41,7 @@ public Sender()
{
EndpointSetup<DefaultServer>(builder =>
{
var basePath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"databus\sender");
var basePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "databus", "sender");
builder.UseDataBus<FileShareDataBus>().BasePath(basePath);
builder.ConfigureTransport().Routing().RouteToEndpoint(typeof(MyMessageWithLargePayload), typeof(Receiver));
Expand All @@ -55,7 +55,7 @@ public Receiver()
{
EndpointSetup<DefaultServer>(builder =>
{
var basePath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"databus\sender");
var basePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "databus", "sender");
builder.UseDataBus<FileShareDataBus>().BasePath(basePath);
builder.RegisterMessageMutator(new Mutator());
});
Expand Down
Expand Up @@ -45,7 +45,7 @@ public Sender()
.DefiningCommandsAs(t => t.Namespace != null && t.FullName == typeof(MyMessageWithLargePayload).FullName)
.DefiningDataBusPropertiesAs(t => t.Name.Contains("Payload"));
var basePath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"databus\sender");
var basePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "databus", "sender");
builder.UseDataBus<FileShareDataBus>().BasePath(basePath);
builder.ConfigureTransport().Routing().RouteToEndpoint(typeof(MyMessageWithLargePayload), typeof(Receiver));
Expand All @@ -63,7 +63,7 @@ public Receiver()
.DefiningCommandsAs(t => t.Namespace != null && t.FullName == typeof(MyMessageWithLargePayload).FullName)
.DefiningDataBusPropertiesAs(t => t.Name.Contains("Payload"));
var basePath = Path.Combine(TestContext.CurrentContext.TestDirectory, @"databus\sender");
var basePath = Path.Combine(TestContext.CurrentContext.TestDirectory, "databus", "sender");
builder.UseDataBus<FileShareDataBus>().BasePath(basePath);
builder.RegisterMessageMutator(new Mutator());
});
Expand Down
4 changes: 2 additions & 2 deletions src/NServiceBus.Core/Licensing/LicenseSources.cs
Expand Up @@ -23,8 +23,8 @@ public static LicenseSource[] GetLicenseSources(string licenseText, string licen

sources.Add(new LicenseSourceConfigFile());

sources.Add(new LicenseSourceFilePath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"NServiceBus\License.xml")));
sources.Add(new LicenseSourceFilePath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"License\License.xml")));
sources.Add(new LicenseSourceFilePath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "NServiceBus", "License.xml")));
sources.Add(new LicenseSourceFilePath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "License", "License.xml")));

if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
Expand Down

0 comments on commit a1e62c2

Please sign in to comment.