Skip to content

Commit d0e1a08

Browse files
committed
Bump test and build dependencies
1 parent c737a93 commit d0e1a08

File tree

4 files changed

+34
-30
lines changed

4 files changed

+34
-30
lines changed

pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@
6060
<jackson.version>2.9.9.3</jackson.version>
6161
<logback.version>1.2.3</logback.version>
6262
<junit.version>4.12</junit.version>
63-
<awaitility.version>3.1.6</awaitility.version>
63+
<awaitility.version>4.0.1</awaitility.version>
6464
<mockito.version>3.0.0</mockito.version>
65-
<assertj.version>3.12.2</assertj.version>
66-
<jetty.version>9.4.19.v20190610</jetty.version>
67-
<bouncycastle.version>1.61</bouncycastle.version>
65+
<assertj.version>3.13.2</assertj.version>
66+
<jetty.version>9.4.20.v20190813</jetty.version>
67+
<bouncycastle.version>1.63</bouncycastle.version>
6868

69-
<maven.javadoc.plugin.version>3.0.1</maven.javadoc.plugin.version>
69+
<maven.javadoc.plugin.version>3.1.1</maven.javadoc.plugin.version>
7070
<maven.release.plugin.version>2.5.3</maven.release.plugin.version>
7171
<versions.maven.plugin.version>2.3</versions.maven.plugin.version>
7272
<maven.resources.plugin.version>3.0.2</maven.resources.plugin.version>
@@ -75,9 +75,9 @@
7575
<groovy.all.version>2.4.8</groovy.all.version>
7676
<keytool.maven.plugin.version>1.5</keytool.maven.plugin.version>
7777
<build.helper.maven-plugin.version>1.12</build.helper.maven-plugin.version>
78-
<maven.compiler.plugin.version>3.6.1</maven.compiler.plugin.version>
79-
<maven.surefire.plugin.version>2.22.1</maven.surefire.plugin.version>
80-
<maven.failsafe.plugin.version>2.22.1</maven.failsafe.plugin.version>
78+
<maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
79+
<maven.surefire.plugin.version>2.22.2</maven.surefire.plugin.version>
80+
<maven.failsafe.plugin.version>2.22.2</maven.failsafe.plugin.version>
8181
<maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
8282
<maven.jar.plugin.version>3.0.2</maven.jar.plugin.version>
8383
<maven.bundle.plugin.version>3.2.0</maven.bundle.plugin.version>

src/test/java/com/rabbitmq/client/test/JavaNioTest.java

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.rabbitmq.client.impl.nio.BlockingQueueNioQueue;
55
import com.rabbitmq.client.impl.nio.DefaultByteBufferFactory;
66
import com.rabbitmq.client.impl.nio.NioParams;
7+
import org.assertj.core.api.Condition;
78
import org.junit.After;
89
import org.junit.Before;
910
import org.junit.Test;
@@ -14,10 +15,8 @@
1415
import java.util.concurrent.*;
1516
import java.util.concurrent.atomic.AtomicInteger;
1617

17-
import static org.hamcrest.Matchers.hasSize;
18-
import static org.hamcrest.Matchers.isOneOf;
18+
import static org.assertj.core.api.Assertions.assertThat;
1919
import static org.junit.Assert.assertEquals;
20-
import static org.junit.Assert.assertThat;
2120
import static org.junit.Assert.assertTrue;
2221

2322
/**
@@ -125,19 +124,21 @@ public void shutdownCompleted(ShutdownSignalException cause) {
125124
public void nioLoopCleaning() throws Exception {
126125
ConnectionFactory connectionFactory = new ConnectionFactory();
127126
connectionFactory.useNio();
128-
for(int i = 0; i < 10; i++) {
127+
for (int i = 0; i < 10; i++) {
129128
Connection connection = connectionFactory.newConnection();
130129
connection.abort();
131130
}
132131
}
133132

134-
@Test public void messageSize() throws Exception {
133+
@Test
134+
public void messageSize() throws Exception {
135135
for (int i = 0; i < 50; i++) {
136136
sendAndVerifyMessage(testConnection, 76390);
137137
}
138138
}
139139

140-
@Test public void byteBufferFactory() throws Exception {
140+
@Test
141+
public void byteBufferFactory() throws Exception {
141142
ConnectionFactory cf = new ConnectionFactory();
142143
cf.useNio();
143144
int baseCapacity = 32768;
@@ -155,12 +156,15 @@ public void nioLoopCleaning() throws Exception {
155156
sendAndVerifyMessage(c, 100);
156157
}
157158

158-
assertThat(byteBuffers, hasSize(2));
159-
assertThat(byteBuffers.get(0).capacity(), isOneOf(nioParams.getReadByteBufferSize(), nioParams.getWriteByteBufferSize()));
160-
assertThat(byteBuffers.get(1).capacity(), isOneOf(nioParams.getReadByteBufferSize(), nioParams.getWriteByteBufferSize()));
159+
assertThat(byteBuffers).hasSize(2);
160+
Condition<Integer> condition = new Condition<>(c -> c == nioParams.getReadByteBufferSize() ||
161+
c == nioParams.getWriteByteBufferSize(), "capacity set by factory");
162+
assertThat(byteBuffers.get(0).capacity()).is(condition);
163+
assertThat(byteBuffers.get(1).capacity()).is(condition);
161164
}
162165

163-
@Test public void directByteBuffers() throws Exception {
166+
@Test
167+
public void directByteBuffers() throws Exception {
164168
ConnectionFactory cf = new ConnectionFactory();
165169
cf.useNio();
166170
cf.setNioParams(new NioParams().setByteBufferFactory(new DefaultByteBufferFactory(capacity -> ByteBuffer.allocateDirect(capacity))));
@@ -169,15 +173,16 @@ public void nioLoopCleaning() throws Exception {
169173
}
170174
}
171175

172-
@Test public void customWriteQueue() throws Exception {
176+
@Test
177+
public void customWriteQueue() throws Exception {
173178
ConnectionFactory cf = new ConnectionFactory();
174179
cf.useNio();
175180
AtomicInteger count = new AtomicInteger(0);
176181
cf.setNioParams(new NioParams().setWriteQueueFactory(ctx -> {
177182
count.incrementAndGet();
178183
return new BlockingQueueNioQueue(
179-
new LinkedBlockingQueue<>(ctx.getNioParams().getWriteQueueCapacity()),
180-
ctx.getNioParams().getWriteEnqueuingTimeoutInMs()
184+
new LinkedBlockingQueue<>(ctx.getNioParams().getWriteQueueCapacity()),
185+
ctx.getNioParams().getWriteEnqueuingTimeoutInMs()
181186
);
182187
}));
183188
try (Connection c = cf.newConnection()) {
@@ -193,7 +198,7 @@ private void sendAndVerifyMessage(Connection connection, int size) throws Except
193198
}
194199

195200
private Connection basicGetBasicConsume(ConnectionFactory connectionFactory, String queue, final CountDownLatch latch)
196-
throws IOException, TimeoutException {
201+
throws IOException, TimeoutException {
197202
Connection connection = connectionFactory.newConnection();
198203
Channel channel = connection.createChannel();
199204
channel.queueDeclare(queue, false, false, false, null);
@@ -213,7 +218,7 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp
213218
}
214219

215220
private boolean basicGetBasicConsume(Connection connection, String queue, final CountDownLatch latch, int msgSize)
216-
throws Exception {
221+
throws Exception {
217222
Channel channel = connection.createChannel();
218223
channel.queueDeclare(queue, false, false, false, null);
219224
channel.queuePurge(queue);

src/test/java/com/rabbitmq/client/test/RpcTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2017-Present Pivotal Software, Inc. All rights reserved.
1+
// Copyright (c) 2017-2019 Pivotal Software, Inc. All rights reserved.
22
//
33
// This software, the RabbitMQ Java client library, is triple-licensed under the
44
// Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2
@@ -24,13 +24,12 @@
2424
import com.rabbitmq.client.impl.recovery.RecordedQueue;
2525
import com.rabbitmq.client.impl.recovery.TopologyRecoveryFilter;
2626
import com.rabbitmq.tools.Host;
27-
import org.awaitility.Awaitility;
28-
import org.awaitility.Duration;
2927
import org.junit.After;
3028
import org.junit.Before;
3129
import org.junit.Test;
3230

3331
import java.io.IOException;
32+
import java.time.Duration;
3433
import java.util.HashMap;
3534
import java.util.Map;
3635
import java.util.UUID;
@@ -301,7 +300,7 @@ public void handleRecoveryStarted(Recoverable recoverable) {
301300

302301
serverThread.interrupt();
303302

304-
waitAtMost(Duration.ONE_SECOND).until(() -> !serverThread.isAlive()) ;
303+
waitAtMost(Duration.ofSeconds(1)).until(() -> !serverThread.isAlive()) ;
305304

306305
client.close();
307306
}

src/test/java/com/rabbitmq/client/test/functional/Metrics.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2007-Present Pivotal Software, Inc. All rights reserved.
1+
// Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
22
//
33
// This software, the RabbitMQ Java client library, is triple-licensed under the
44
// Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2
@@ -30,13 +30,13 @@
3030
import com.rabbitmq.client.test.BrokerTestCase;
3131
import com.rabbitmq.client.test.TestUtils;
3232
import com.rabbitmq.tools.Host;
33-
import org.awaitility.Duration;
3433
import org.junit.Test;
3534
import org.junit.runner.RunWith;
3635
import org.junit.runners.Parameterized;
3736

3837
import java.io.IOException;
3938
import java.lang.reflect.Field;
39+
import java.time.Duration;
4040
import java.util.ArrayList;
4141
import java.util.Collection;
4242
import java.util.List;
@@ -637,7 +637,7 @@ private void sendMessage(Channel channel) throws IOException {
637637
}
638638

639639
private Duration timeout() {
640-
return new Duration(10, TimeUnit.SECONDS);
640+
return Duration.ofSeconds(10);
641641
}
642642

643643
private static class MultipleAckConsumer extends DefaultConsumer {

0 commit comments

Comments
 (0)