Skip to content

Commit

Permalink
Merge branch 'hotfix-4.6.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
John Simons committed Sep 9, 2014
2 parents bb266e1 + fa4a929 commit 1f7b020
Show file tree
Hide file tree
Showing 52 changed files with 655 additions and 84 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ _NCrunch_NServiceBus/*
logs
run-git.cmd
src/Chocolatey/Build/*
App_Packages
73 changes: 50 additions & 23 deletions buildsupport/GitVersionTask/Build/GitVersionTask.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,73 @@
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)..\</SolutionDir>
</PropertyGroup>
<PropertyGroup>
<GitVersionAppendRevision Condition="$(GitVersionAppendRevision) == '' Or $(GitVersionAppendRevision) == '*Undefined*'">false</GitVersionAppendRevision>
</PropertyGroup>

<UsingTask
TaskName="GitVersionTask.UpdateAssemblyInfo"
AssemblyFile="$(MSBuildThisFileDirectory)..\GitVersionTask.dll" />
<UsingTask
TaskName="GitVersionTask.GetVersion"
AssemblyFile="$(MSBuildThisFileDirectory)..\GitVersionTask.dll" />
<UsingTask
TaskName="GitVersionTask.WriteVersionInfoToBuildLog"
AssemblyFile="$(MSBuildThisFileDirectory)..\GitVersionTask.dll" />

<Target Name="UpdateAssemblyInfo"
BeforeTargets="CoreCompile">
<WriteVersionInfoToBuildLog
SolutionDirectory="$(SolutionDir)"
<Target Name="UpdateAssemblyInfo"
BeforeTargets="CoreCompile">
<WriteVersionInfoToBuildLog
SolutionDirectory="$(SolutionDir)"
/>
<UpdateAssemblyInfo
SolutionDirectory="$(SolutionDir)"
AssemblyName="$(AssemblyName)"
ProjectFile="$(ProjectPath)"
SignAssembly="$(SignAssembly)"
CompileFiles ="@(Compile)">
<Output
TaskParameter="AssemblyInfoTempFilePath"
PropertyName="AssemblyInfoTempFilePath" />
</UpdateAssemblyInfo>

<ItemGroup>
<Compile Include="$(AssemblyInfoTempFilePath)" />
</ItemGroup>
</Target>
<UpdateAssemblyInfo
SolutionDirectory="$(SolutionDir)"
ProjectFile="$(ProjectPath)"
AppendRevision="$(GitVersionAppendRevision)"
CompileFiles ="@(Compile)">
<Output
TaskParameter="AssemblyInfoTempFilePath"
PropertyName="AssemblyInfoTempFilePath" />
</UpdateAssemblyInfo>

<ItemGroup>
<Compile Include="$(AssemblyInfoTempFilePath)" />
</ItemGroup>


<GetVersion SolutionDirectory="$(SolutionDir)">
<Output TaskParameter="Major" PropertyName="GfvMajor" />
<Output TaskParameter="Minor" PropertyName="GfvMinor" />
<Output TaskParameter="Patch" PropertyName="GfvPatch" />
<Output TaskParameter="BuildMetaData" PropertyName="GfvBuildMetaData" />
<Output TaskParameter="FullBuildMetaData" PropertyName="GfvFullBuildMetaData" />
<Output TaskParameter="BranchName" PropertyName="GfvBranchName" />
<Output TaskParameter="Sha" PropertyName="GfvSha" />
<Output TaskParameter="MajorMinorPatch" PropertyName="GfvMajorMinorPatch" />
<Output TaskParameter="SemVer" PropertyName="GfvSemVer" />
<Output TaskParameter="LegacySemVer" PropertyName="GfvLegacySemVer" />
<Output TaskParameter="LegacySemVerPadded" PropertyName="GfvLegacySemVerPadded" />
<Output TaskParameter="FullSemVer" PropertyName="GfvFullSemVer" />
<Output TaskParameter="AssemblySemVer" PropertyName="GfvAssemblySemVer" />
<Output TaskParameter="ClassicVersion" PropertyName="GfvClassicVersion" />
<Output TaskParameter="ClassicVersionWithTag" PropertyName="GfvClassicVersionWithTag" />
<Output TaskParameter="PreReleaseTag" PropertyName="GfvPreReleaseTag" />
<Output TaskParameter="PreReleaseTagWithDash" PropertyName="GfvPreReleaseTagWithDash" />
<Output TaskParameter="InformationalVersion" PropertyName="GfvInformationalVersion" />
<Output TaskParameter="AssemblyVersion" PropertyName="GfvAssemblyVersion" />
<Output TaskParameter="AssemblyFileVersion" PropertyName="GfvAssemblyFileVersion" />
<Output TaskParameter="OriginalRelease" PropertyName="GfvOriginalRelease" />
</GetVersion>

</Target>

<!--Support for ncrunch-->
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\GitVersionTask.dll" />
<None Include="$(MSBuildThisFileDirectory)..\GitVersionTask.pdb" />
<None Include="$(MSBuildThisFileDirectory)..\GitVersion.exe" />
<None Include="$(MSBuildThisFileDirectory)..\GitVersion.pdb" />
<None Include="$(MSBuildThisFileDirectory)..\LibGit2Sharp.dll" />
<None Include="$(MSBuildThisFileDirectory)..\NativeBinaries\**\*" />
</ItemGroup>


</Project>


Binary file removed buildsupport/GitVersionTask/GitVersion.exe
Binary file not shown.
Binary file modified buildsupport/GitVersionTask/GitVersionTask.dll
Binary file not shown.
Binary file removed buildsupport/GitVersionTask/LibGit2Sharp.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified buildsupport/NuGet.Core.dll
Binary file not shown.
Binary file modified buildsupport/RippleRestoreTask.dll
Binary file not shown.
Binary file modified buildsupport/ripple.exe
Binary file not shown.
6 changes: 3 additions & 3 deletions ripple.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<DefaultFixedConstraint>Current,NextMajor</DefaultFixedConstraint>
<Feeds>
<Feed Url="https://www.myget.org/F/particular/" Mode="Float" Stability="Anything" StabilityConvention="GitFlow" />
<Feed Url="http://nuget.org/api/v2" Mode="Float" Stability="ReleasedOnly" StabilityConvention="None" />
<Feed Url="https://nuget.org/api/v2" Mode="Float" Stability="ReleasedOnly" StabilityConvention="None" />
</Feeds>
<Nugets>
<Dependency Name="Autofac" Version="3.1.5.0" Mode="Fixed" />
Expand All @@ -28,7 +28,7 @@
<Dependency Name="NLog" Version="2.0.1.2" Mode="Fixed" />
<Dependency Name="NUnit" Version="2.6.2.0" Mode="Fixed" />
<Dependency Name="Obsolete.Fody" Version="3.0.4.0" Mode="Fixed" />
<Dependency Name="Particular.Licensing.Sources" Version="0.1.0.51" Mode="Fixed" />
<Dependency Name="Particular.Licensing.Sources" Version="0.1.54" Mode="Fixed" />
<Dependency Name="RavenDB.Client" Version="2.0.2375.0" Mode="Fixed" />
<Dependency Name="RavenDB.Database" Version="2.0.2380.0" Mode="Fixed" />
<Dependency Name="RavenDB.Embedded" Version="2.0.2380.0" Mode="Fixed" />
Expand Down Expand Up @@ -58,4 +58,4 @@
<Nuspec File="nservicebus.testing.nuspec" Project="nservicebus.testing" />
<Nuspec File="nservicebus.unity.nuspec" Project="ObjectBuilder.unity" />
</Nuspecs>
</ripple>
</ripple>
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void Handlers_are_executed_in_the_right_order()
"ThirdHandler:Executed",
"FirstHandler:Executed",
"SecondHandler:Handling the message this time",
"ThirdHandler:Executed",
"ThirdHandler:Executed"
},
events);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public void non_dotnet_files_are_skipped()
"libzmq-v120-mt-3_2_3.dll",
"Tail.exe",
"some_random.dll",
"some_random.exe",
"some_random.exe"
};

foreach (var notProperDll in notProperDotNetDlls)
Expand Down
3 changes: 2 additions & 1 deletion src/NServiceBus.Core.Tests/AttributeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ static IEnumerable<Type> GetAttributeTypes(Assembly assembly)
{
return assembly.GetTypes()
.Where(type =>
(type.Namespace != null) &&
typeof(Attribute).IsAssignableFrom(type) &&
//Ignore log4net attributes
!type.Namespace.Contains("log4net") &&
//Ignore Newtonsoft attributes
//Ignore Newtonsoft attributes
!type.Namespace.Contains("Newtonsoft") &&
//TODO: remove when gitversion is updated
!type.Name.EndsWith("ReleaseDateAttribute") &&
Expand Down
2 changes: 0 additions & 2 deletions src/NServiceBus.Core.Tests/Fakes/FakeBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,5 @@ public IBus Start()
{
throw new NotImplementedException();
}

public event EventHandler Started;
}
}
6 changes: 6 additions & 0 deletions src/NServiceBus.Core.Tests/NServiceBusVersionTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace NServiceBus
{
using System;
using NUnit.Framework;

[TestFixture]
Expand All @@ -9,6 +10,11 @@ public class NServiceBusVersionTests
public void Verify_has_a_version_and_can_be_parsed()
{
Assert.IsNotNullOrEmpty(NServiceBusVersion.Version);
Version.Parse(NServiceBusVersion.Version);
Assert.IsNotNullOrEmpty(GitFlowVersion.MajorMinor);
Version.Parse(GitFlowVersion.MajorMinor);
Assert.IsNotNullOrEmpty(GitFlowVersion.MajorMinorPatch);
Version.Parse(GitFlowVersion.MajorMinorPatch);
}
}
}
24 changes: 24 additions & 0 deletions src/NServiceBus.Core.Tests/Unicast/DeferedMessages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
using System;
using Contexts;
using NServiceBus.Settings;
using NUnit.Framework;
using Timeout;

Expand All @@ -20,6 +21,29 @@ public void Should_use_a_convention_to_set_the_address()
}
}


[TestFixture]
public class When_deferring_a_message_when_involving_worker : using_the_unicastBus
{
[Test]
public void Should_use_master_node_address_when_worker_is_enabled()
{
SettingsHolder.SetDefault("Worker.Enabled", true);
RegisterMessageType<DeferredMessage>();
bus.Defer(TimeSpan.FromDays(1), new DeferredMessage());
VerifyThatMessageWasSentWithHeaders(h => h["NServiceBus.Timeout.RouteExpiredTimeoutTo"] == MasterNodeAddress.ToString());
}

[Test]
public void Should_use_local_address_when_worker_is_disabled()
{
SettingsHolder.SetDefault("Worker.Enabled", false);
RegisterMessageType<DeferredMessage>();
bus.Defer(TimeSpan.FromDays(1), new DeferredMessage());
VerifyThatMessageWasSentWithHeaders(h => h["NServiceBus.Timeout.RouteExpiredTimeoutTo"] == Address.Local.ToString());
}
}

[TestFixture]
public class When_deferring_a_message_with_a_set_delay : using_the_unicastBus
{
Expand Down
6 changes: 1 addition & 5 deletions src/NServiceBus.Core.Tests/Unicast/HandlerInvocationCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,10 @@ public class StubMessage

public class StubTimeoutHandler : IHandleTimeouts<StubTimeoutState>
{
public bool TimeoutCalled;
public StubTimeoutState HandledState;



public void Timeout(StubTimeoutState state)
{
TimeoutCalled = true;
HandledState = state;
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/NServiceBus.Core.Tests/Unicast/Receiving.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,9 @@ public void Handle(EventMessage message)

class CheckMessageIdHandler : IHandleMessages<EventMessage>
{
public static bool Called;

public void Handle(EventMessage message)
{
Called = true;
}
}

Expand Down
51 changes: 51 additions & 0 deletions src/NServiceBus.Core/App_Packages/Particular.Licensing/License.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
namespace Particular.Licensing
{
using System;
using System.Collections.Generic;

class License
{
public static License TrialLicense(DateTime trialStartDate)
{
return new License
{
LicenseType = "Trial",
ExpirationDate = trialStartDate.AddDays(14),
IsExtendedTrial = false,
ValidApplications = new List<string> { "All"}
};
}

public License()
{
ValidApplications = new List<string>();
}

public DateTime? ExpirationDate { get; set; }

public bool IsTrialLicense
{
get { return !IsCommercialLicense; }
}

public bool IsExtendedTrial { get; set; }

public bool IsCommercialLicense
{
get { return LicenseType.ToLower() != "trial"; }
}

public string LicenseType { get; set; }

public string RegisteredTo { get; set; }

public DateTime? UpgradeProtectionExpiration { get; internal set; }

public List<string> ValidApplications{ get; internal set; }

public bool ValidForApplication(string applicationName)
{
return ValidApplications.Contains(applicationName) || ValidApplications.Contains("All");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
namespace Particular.Licensing
{
using System;
using System.Linq;
using System.Xml;

static class LicenseDeserializer
{
public static License Deserialize(string licenseText)
{
var license = new License();
var doc = new XmlDocument();
doc.LoadXml(licenseText);


var applications = doc.SelectSingleNode("/license/@Applications");


if (applications != null)
{
license.ValidApplications.AddRange(applications.Value.Split(';'));
}

var upgradeProtectionExpiration = doc.SelectSingleNode("/license/@UpgradeProtectionExpiration");

if (upgradeProtectionExpiration != null)
{
license.UpgradeProtectionExpiration = Parse(upgradeProtectionExpiration.Value);
}
else
{
var expirationDate = doc.SelectSingleNode("/license/@expiration");

if (expirationDate != null)
{
license.ExpirationDate = Parse(expirationDate.Value);

}
}

var licenseType = doc.SelectSingleNode("/license/@LicenseType");

if (licenseType == null)
{
licenseType = doc.SelectSingleNode("/license/@type");
}

if (licenseType != null)
{
license.LicenseType = licenseType.Value;
}

var name = doc.SelectSingleNode("/license/name");

if (name != null)
{
license.RegisteredTo = name.InnerText;
}

return license;
}

static DateTime Parse(string dateStringFromLicense)
{
if (string.IsNullOrEmpty(dateStringFromLicense))
{
throw new Exception("Invalid datestring found in xml");
}

return UniversalDateParser.Parse(dateStringFromLicense.Split('T').First());
}

}
}
Loading

0 comments on commit 1f7b020

Please sign in to comment.