Skip to content

Commit 7580540

Browse files
committed
enable netstandard build for Spring.Messaging.Nms
1 parent 1a03920 commit 7580540

File tree

10 files changed

+25
-27
lines changed

10 files changed

+25
-27
lines changed

Spring.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ Commandline Examples:
417417
<include name="${spring.basedir}/test/Spring/Spring.Testing.NUnit.Tests/Spring.Testing.NUnit.Tests.csproj" />
418418
<include name="${spring.basedir}/test/Spring/Spring.Data.NHibernate5.Integration.Tests/Spring.Data.NHibernate5.Integration.Tests.csproj" />
419419
<include name="${spring.basedir}/test/Spring/Spring.Data.NHibernate5.Tests/Spring.Data.NHibernate5.Tests.csproj" />
420+
<include name="${spring.basedir}/test/Spring/Spring.Messaging.Nms.Tests/Spring.Messaging.Nms.Tests.csproj" />
421+
<include name="${spring.basedir}/test/Spring/Spring.Messaging.Nms.Integration.Tests/Spring.Messaging.Nms.Integration.Tests.csproj" />
420422
<include name="${spring.basedir}/test/Spring/Spring.Scheduling.Quartz3.Tests/Spring.Scheduling.Quartz3.Tests.csproj" />
421423
</items>
422424
</in>

src/Directory.Build.props

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<PropertyGroup>
44

5+
<VersionPrefix>3.0.0-fbs-1</VersionPrefix>
6+
57
<OutputPath>..\..\..\build\$(Configuration)\$(MSBuildProjectName)</OutputPath>
68

79
<RootNamespace>Spring</RootNamespace>
@@ -47,7 +49,7 @@
4749
</ItemGroup>
4850

4951
<ItemGroup>
50-
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="2.0.0" PrivateAssets="All" />
52+
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="4.0.0" PrivateAssets="All" />
5153
</ItemGroup>
5254

5355
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">

src/Spring/Spring.Messaging.Nms/Spring.Messaging.Nms.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>$(TargetFullFrameworkVersion)</TargetFramework>
3+
<TargetFrameworks>netstandard2.0;$(TargetFullFrameworkVersion)</TargetFrameworks>
44
<Description>ActiveMQ support</Description>
55
</PropertyGroup>
66
<ItemGroup>

test/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
1414
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
1515

16-
<ApacheNmsVersion>1.7.1</ApacheNmsVersion>
16+
<ApacheNmsVersion>1.8.0</ApacheNmsVersion>
1717
<CommonLoggingVersion>3.4.1</CommonLoggingVersion>
1818
<Log4NetVersion>2.0.8</Log4NetVersion>
1919

test/Spring/Spring.Benchmark/Spring.Benchmark.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFrameworks>net471;netcoreapp2.1</TargetFrameworks>
5+
<TargetFrameworks>net472;netcoreapp2.1</TargetFrameworks>
66
<RootNamespace>Spring.Benchmark</RootNamespace>
77
</PropertyGroup>
88

test/Spring/Spring.Messaging.Nms.Integration.Tests/Messaging/Nms/Core/NmsTemplateTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
using System;
2222

2323
using Apache.NMS;
24-
using Apache.NMS.ActiveMQ;
25-
2624
using NUnit.Framework;
2725

2826
using Spring.Testing.NUnit;
@@ -46,14 +44,15 @@ public NmsTemplateTests()
4644
this.PopulateProtectedVariables = true;
4745
}
4846

47+
#if NETFRAMEWORK
4948
[Test]
5049
public void ConnectionThrowException()
5150
{
52-
ConnectionFactory cf = new ConnectionFactory();
51+
var cf = new Apache.NMS.ActiveMQ.ConnectionFactory();
5352
cf.BrokerUri = new Uri("tcp://localaaahost:61616");
5453
Assert.Throws<NMSConnectionException>(() => cf.CreateConnection());
5554
}
56-
55+
#endif
5756

5857
[Test]
5958
public void ConvertAndSend()
@@ -97,4 +96,4 @@ protected override string[] ConfigLocations
9796

9897
#endregion
9998
}
100-
}
99+
}

test/Spring/Spring.Messaging.Nms.Integration.Tests/Spring.Messaging.Nms.Integration.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net452</TargetFramework>
3+
<TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
44
</PropertyGroup>
55
<ItemGroup>
66
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.csproj" />
@@ -11,7 +11,7 @@
1111
</ItemGroup>
1212
<ItemGroup>
1313
<PackageReference Include="Apache.NMS" Version="$(ApacheNmsVersion)" />
14-
<PackageReference Include="Apache.NMS.ActiveMQ" Version="$(ApacheNmsVersion)" />
14+
<PackageReference Include="Apache.NMS.ActiveMQ" Version="1.7.2" Condition=" '$(TargetFramework)' == '$(TargetFullFrameworkVersion)' " />
1515
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftTestSDKVersion)" />
1616
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
1717
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" />

test/Spring/Spring.Messaging.Nms.Tests/Messaging/Nms/Connections/CachingConnectionFactoryTests.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#region License
22

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

1919
#endregion
2020

21-
#region Imports
22-
2321
using Apache.NMS;
24-
using Apache.NMS.ActiveMQ.Commands;
25-
2622
using FakeItEasy;
27-
2823
using NUnit.Framework;
2924

30-
#endregion
31-
3225
namespace Spring.Messaging.Nms.Connections
3326
{
3427
/// <summary>
@@ -171,6 +164,7 @@ public void CachedMessageProducerTwoRequests()
171164
Assert.AreSame(tmpA, tmpC);
172165
}
173166

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

188182
ISession sessionA = con1.CreateSession(AcknowledgementMode.Transactional);
189-
IDestination destination = new ActiveMQQueue("test.dest");
183+
IDestination destination = new Apache.NMS.ActiveMQ.Commands.ActiveMQQueue("test.dest");
190184
IMessageConsumer consumerA = sessionA.CreateConsumer(destination);
191185
TestMessageConsumer tmpA = GetTestMessageConsumer(consumerA);
192186

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

199193
Assert.AreSame(tmpA, tmpB);
200194
}
195+
#endif
201196

202197
private IConnectionFactory CreateConnectionFactory()
203198
{

test/Spring/Spring.Messaging.Nms.Tests/Messaging/Nms/Connections/TestSession.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
using System;
2222
using Apache.NMS;
23-
using Apache.NMS.ActiveMQ.Commands;
23+
using FakeItEasy;
2424

2525
namespace Spring.Messaging.Nms.Connections
2626
{
@@ -126,7 +126,7 @@ public void DeleteDurableConsumer(string name, TimeSpan requestTimeout)
126126

127127
public IQueue GetQueue(string name)
128128
{
129-
return new ActiveMQQueue(name);
129+
return A.Fake<IQueue>();
130130
}
131131

132132
public ITopic GetTopic(string name)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net452</TargetFramework>
3+
<TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
44
</PropertyGroup>
55
<ItemGroup>
66
<ProjectReference Include="..\..\..\src\Spring\Spring.Core\Spring.Core.csproj" />
@@ -13,19 +13,19 @@
1313
<PackageReference Include="FakeItEasy" Version="$(FakeItEasyVersion)" />
1414
<PackageReference Include="FakeItEasy.Analyzer" Version="$(FakeItEasyVersion)" PrivateAssets="All" />
1515
<PackageReference Include="Apache.NMS" Version="$(ApacheNmsVersion)" />
16-
<PackageReference Include="Apache.NMS.ActiveMQ" Version="$(ApacheNmsVersion)" />
16+
<PackageReference Include="Apache.NMS.ActiveMQ" Version="1.7.2" Condition=" '$(TargetFramework)' == '$(TargetFullFrameworkVersion)' " />
1717
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftTestSDKVersion)" />
1818
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
1919
<PackageReference Include="NUnit3TestAdapter" Version="$(NUnitTestAdapterVersion)" />
2020
</ItemGroup>
21-
<ItemGroup>
22-
<Reference Include="Accessibility" />
23-
</ItemGroup>
2421
<ItemGroup>
2522
<Content Include="App.config">
2623
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2724
</Content>
2825
<EmbeddedResource Include="Messaging\Nms\Integration\SimpleMessageListenerContainerTests.xml" />
2926
<EmbeddedResource Include="Messaging\Nms\Config\NmsNamespaceHandlerTests.xml" />
3027
</ItemGroup>
28+
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
29+
<Exec Command="copy &quot;$(ProjectDir)App.config&quot; &quot;$(OutDir)testhost.dll.config&quot;" />
30+
</Target>
3131
</Project>

0 commit comments

Comments
 (0)