Skip to content

Commit

Permalink
enable netstandard build for Spring.Messaging.Nms
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma committed Sep 7, 2019
1 parent 1a03920 commit 7580540
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 27 deletions.
2 changes: 2 additions & 0 deletions Spring.build
Expand Up @@ -417,6 +417,8 @@ Commandline Examples:
<include name="${spring.basedir}/test/Spring/Spring.Testing.NUnit.Tests/Spring.Testing.NUnit.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Data.NHibernate5.Integration.Tests/Spring.Data.NHibernate5.Integration.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Data.NHibernate5.Tests/Spring.Data.NHibernate5.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Messaging.Nms.Tests/Spring.Messaging.Nms.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Messaging.Nms.Integration.Tests/Spring.Messaging.Nms.Integration.Tests.csproj" />
<include name="${spring.basedir}/test/Spring/Spring.Scheduling.Quartz3.Tests/Spring.Scheduling.Quartz3.Tests.csproj" />
</items>
</in>
Expand Down
4 changes: 3 additions & 1 deletion src/Directory.Build.props
Expand Up @@ -2,6 +2,8 @@

<PropertyGroup>

<VersionPrefix>3.0.0-fbs-1</VersionPrefix>

<OutputPath>..\..\..\build\$(Configuration)\$(MSBuildProjectName)</OutputPath>

<RootNamespace>Spring</RootNamespace>
Expand Down Expand Up @@ -47,7 +49,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="4.0.0" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand Down
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(TargetFullFrameworkVersion)</TargetFramework>
<TargetFrameworks>netstandard2.0;$(TargetFullFrameworkVersion)</TargetFrameworks>
<Description>ActiveMQ support</Description>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/Directory.Build.props
Expand Up @@ -13,7 +13,7 @@
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>

<ApacheNmsVersion>1.7.1</ApacheNmsVersion>
<ApacheNmsVersion>1.8.0</ApacheNmsVersion>
<CommonLoggingVersion>3.4.1</CommonLoggingVersion>
<Log4NetVersion>2.0.8</Log4NetVersion>

Expand Down
2 changes: 1 addition & 1 deletion test/Spring/Spring.Benchmark/Spring.Benchmark.csproj
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net471;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net472;netcoreapp2.1</TargetFrameworks>
<RootNamespace>Spring.Benchmark</RootNamespace>
</PropertyGroup>

Expand Down
Expand Up @@ -21,8 +21,6 @@
using System;

using Apache.NMS;
using Apache.NMS.ActiveMQ;

using NUnit.Framework;

using Spring.Testing.NUnit;
Expand All @@ -46,14 +44,15 @@ public NmsTemplateTests()
this.PopulateProtectedVariables = true;
}

#if NETFRAMEWORK
[Test]
public void ConnectionThrowException()
{
ConnectionFactory cf = new ConnectionFactory();
var cf = new Apache.NMS.ActiveMQ.ConnectionFactory();
cf.BrokerUri = new Uri("tcp://localaaahost:61616");
Assert.Throws<NMSConnectionException>(() => cf.CreateConnection());
}

#endif

[Test]
public void ConvertAndSend()
Expand Down Expand Up @@ -97,4 +96,4 @@ protected override string[] ConfigLocations

#endregion
}
}
}
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net452</TargetFramework>
<TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.csproj" />
Expand All @@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Apache.NMS" Version="$(ApacheNmsVersion)" />
<PackageReference Include="Apache.NMS.ActiveMQ" Version="$(ApacheNmsVersion)" />
<PackageReference Include="Apache.NMS.ActiveMQ" Version="1.7.2" Condition=" '$(TargetFramework)' == '$(TargetFullFrameworkVersion)' " />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftTestSDKVersion)" />
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" />
Expand Down
@@ -1,7 +1,7 @@
#region License

/*
* Copyright © 2002-2011 the original author or authors.
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,17 +18,10 @@

#endregion

#region Imports

using Apache.NMS;
using Apache.NMS.ActiveMQ.Commands;

using FakeItEasy;

using NUnit.Framework;

#endregion

namespace Spring.Messaging.Nms.Connections
{
/// <summary>
Expand Down Expand Up @@ -171,6 +164,7 @@ public void CachedMessageProducerTwoRequests()
Assert.AreSame(tmpA, tmpC);
}

#if NETFRAMEWORK
/// <summary>
/// Tests that the same underlying instance of the message consumer is returned after
/// creating a session, creating the consumer (A), closing the session, and creating another
Expand All @@ -186,7 +180,7 @@ public void CachedMessageConsumer()
IConnection con1 = cachingConnectionFactory.CreateConnection();

ISession sessionA = con1.CreateSession(AcknowledgementMode.Transactional);
IDestination destination = new ActiveMQQueue("test.dest");
IDestination destination = new Apache.NMS.ActiveMQ.Commands.ActiveMQQueue("test.dest");
IMessageConsumer consumerA = sessionA.CreateConsumer(destination);
TestMessageConsumer tmpA = GetTestMessageConsumer(consumerA);

Expand All @@ -198,6 +192,7 @@ public void CachedMessageConsumer()

Assert.AreSame(tmpA, tmpB);
}
#endif

private IConnectionFactory CreateConnectionFactory()
{
Expand Down
Expand Up @@ -20,7 +20,7 @@

using System;
using Apache.NMS;
using Apache.NMS.ActiveMQ.Commands;
using FakeItEasy;

namespace Spring.Messaging.Nms.Connections
{
Expand Down Expand Up @@ -126,7 +126,7 @@ public void DeleteDurableConsumer(string name, TimeSpan requestTimeout)

public IQueue GetQueue(string name)
{
return new ActiveMQQueue(name);
return A.Fake<IQueue>();
}

public ITopic GetTopic(string name)
Expand Down
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net452</TargetFramework>
<TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.csproj" />
Expand All @@ -13,19 +13,19 @@
<PackageReference Include="FakeItEasy" Version="$(FakeItEasyVersion)" />
<PackageReference Include="FakeItEasy.Analyzer" Version="$(FakeItEasyVersion)" PrivateAssets="All" />
<PackageReference Include="Apache.NMS" Version="$(ApacheNmsVersion)" />
<PackageReference Include="Apache.NMS.ActiveMQ" Version="$(ApacheNmsVersion)" />
<PackageReference Include="Apache.NMS.ActiveMQ" Version="1.7.2" Condition=" '$(TargetFramework)' == '$(TargetFullFrameworkVersion)' " />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftTestSDKVersion)" />
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" />
</ItemGroup>
<ItemGroup>
<Reference Include="Accessibility" />
</ItemGroup>
<ItemGroup>
<Content Include="App.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="Messaging\Nms\Integration\SimpleMessageListenerContainerTests.xml" />
<EmbeddedResource Include="Messaging\Nms\Config\NmsNamespaceHandlerTests.xml" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy &quot;$(ProjectDir)App.config&quot; &quot;$(OutDir)testhost.dll.config&quot;" />
</Target>
</Project>

0 comments on commit 7580540

Please sign in to comment.