Skip to content

Commit f46f224

Browse files
committed
NO-JIRA Try to fix tests
1 parent d0c8708 commit f46f224

28 files changed

Lines changed: 123 additions & 98 deletions

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# editorconfig.org
2+
# top-most EditorConfig file
3+
root = true
4+
5+
# Visual Studio XML project files
6+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
7+
indent_size = 2
8+
charset = utf-8
9+
10+
# Visual Studio and .NET related XML config files
11+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct,stylecop}]
12+
indent_size = 2

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup .NET
1818
uses: actions/setup-dotnet@v4
1919
with:
20-
dotnet-version: '9.0.x'
20+
dotnet-version: '8.0.x'
2121

2222
- name: Start ActiveMQ with Docker Compose
2323
run: docker compose up -d activemq
@@ -32,7 +32,7 @@ jobs:
3232
run: dotnet test test/nms-openwire-test.csproj --configuration Release --no-build --verbosity normal --logger trx --results-directory TestResults --filter "TestCategory!=Manual"
3333
env:
3434
NMSTestBroker: localhost
35-
35+
activemqhost: localhost
3636
- name: Upload test results
3737
uses: actions/upload-artifact@v4
3838
if: always()

Directory.Build.props

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<PropertyGroup>
3+
<LangVersion>12</LangVersion>
4+
<TargetFramework>net8.0</TargetFramework>
5+
</PropertyGroup>
6+
</Project>

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ services:
1111
retries: 5
1212
start_period: 60s
1313
environment:
14-
- ACTIVEMQ_ADMIN_LOGIN=admin
15-
- ACTIVEMQ_ADMIN_PASSWORD=admin
14+
- ACTIVEMQ_CONNECTION_USER=guest
15+
- ACTIVEMQ_CONNECTION_PASSWORD=guest

nms-openwire.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nms-openwire", "src\nms-ope
77
EndProject
88
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nms-openwire-test", "test\nms-openwire-test.csproj", "{D4034BFD-21F1-4836-B0A0-1C4161AB0110}"
99
EndProject
10+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{A3B1E8EF-F189-4DF4-8531-4C37128AA3C3}"
11+
ProjectSection(SolutionItems) = preProject
12+
Directory.Build.props = Directory.Build.props
13+
LICENSE.txt = LICENSE.txt
14+
RELEASE.md = RELEASE.md
15+
README.md = README.md
16+
NOTICE.txt = NOTICE.txt
17+
docker-compose.yml = docker-compose.yml
18+
.github\workflows\build.yml = .github\workflows\build.yml
19+
.editorconfig = .editorconfig
20+
EndProjectSection
21+
EndProject
1022
Global
1123
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1224
Debug|Any CPU = Debug|Any CPU

src/nms-openwire.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2222
<Authors>Apache ActiveMQ</Authors>
2323
<TargetFramework>netstandard2.0</TargetFramework>
24-
<LangVersion>8</LangVersion>
2524
</PropertyGroup>
2625

2726
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

test/AMQNET366Test.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ public override void SetUp()
4646
[Test, Timeout(30_000)]
4747
public void TestConnection()
4848
{
49-
IConnectionFactory factory = new NMSConnectionFactory(NMSTestSupport.ReplaceEnvVar(connectionUri));
49+
IConnectionFactory factory = new NMSConnectionFactory(ReplaceEnvVar(connectionUri));
5050

51-
using (connection = factory.CreateConnection())
51+
using (connection = factory.CreateConnection("guest", "guest"))
5252
using (ISession session = connection.CreateSession())
5353
{
5454
IDestination destination = SessionUtil.GetDestination(session, "queue://TEST.test.in");

test/AMQNET375Test.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void TestZeroPrefetchConsumerGetsAllMessages()
5353
private void Receive(int numberOfMessages)
5454
{
5555
IConnectionFactory connectionFactory = new NMSConnectionFactory(NMSTestSupport.ReplaceEnvVar(BrokerUri));
56-
using (IConnection connection = connectionFactory.CreateConnection())
56+
using (IConnection connection = connectionFactory.CreateConnection("guest", "guest"))
5757
{
5858
connection.Start();
5959

@@ -83,8 +83,8 @@ private void Receive(int numberOfMessages)
8383

8484
private void Send(int numberOfMessages)
8585
{
86-
IConnectionFactory connectionFactory = new NMSConnectionFactory(NMSTestSupport.ReplaceEnvVar(BrokerUri));
87-
using (IConnection connection = connectionFactory.CreateConnection())
86+
IConnectionFactory connectionFactory = new NMSConnectionFactory(ReplaceEnvVar(BrokerUri));
87+
using (IConnection connection = connectionFactory.CreateConnection("guest", "guest"))
8888
{
8989
connection.Start();
9090

test/Async/ConnectionFactoryTestAsync.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public async Task TestURI(string connectionURI)
4747
Uri uri = URISupport.CreateCompatibleUri(NMSTestSupport.ReplaceEnvVar(connectionURI));
4848
ConnectionFactory factory = new ConnectionFactory(uri);
4949
Assert.IsNotNull(factory);
50-
using(IConnection connection = await factory.CreateConnectionAsync("", ""))
50+
using(IConnection connection = await factory.CreateConnectionAsync("guest", "guest"))
5151
{
5252
Assert.IsNotNull(connection);
5353

@@ -74,7 +74,7 @@ public async Task TestURI(string connectionURI)
7474
{
7575
ConnectionFactory factory = new ConnectionFactory(NMSTestSupport.ReplaceEnvVar(connectionURI));
7676
Assert.IsNotNull(factory);
77-
using(IConnection connection = await factory.CreateConnectionAsync("", ""))
77+
using(IConnection connection = await factory.CreateConnectionAsync("guest", "guest"))
7878
{
7979
Assert.IsNotNull(connection);
8080

@@ -131,7 +131,7 @@ public async Task TestConnectionFactorySetParams(
131131
factory.SendAcksAsync = sendAcksAsync;
132132
factory.DispatchAsync = dispatchAsync;
133133

134-
using(Connection connection = await factory.CreateConnectionAsync() as Connection)
134+
using(Connection connection = await factory.CreateConnectionAsync("guest", "guest") as Connection)
135135
{
136136
Assert.AreEqual(ackMode, connection.AcknowledgementMode);
137137
Assert.AreEqual(asyncSend, connection.AsyncSend);
@@ -178,7 +178,7 @@ public async Task TestConnectionFactoryParseParams(
178178

179179
ConnectionFactory factory = new ConnectionFactory(NMSTestSupport.ReplaceEnvVar(connectionURI));
180180

181-
using(Connection connection = await factory.CreateConnectionAsync() as Connection)
181+
using(Connection connection = await factory.CreateConnectionAsync("guest", "guest") as Connection)
182182
{
183183
Assert.AreEqual(ackMode, connection.AcknowledgementMode);
184184
Assert.AreEqual(asyncSend, connection.AsyncSend);

test/Async/MessageProducerTestAsync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public async Task TestProducerSendWithExpiry()
3535
IConnectionFactory factory = new ConnectionFactory(NMSTestSupport.ReplaceEnvVar(uri));
3636

3737
// ConnectionFactory factory = new ConnectionFactory(uri);
38-
using(IConnection connection = await factory.CreateConnectionAsync())
38+
using(IConnection connection = await factory.CreateConnectionAsync("guest", "guest"))
3939
using(ISession session = await connection.CreateSessionAsync())
4040
{
4141
IDestination destination = await session.GetTopicAsync("Test");

0 commit comments

Comments
 (0)