qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oru...@apache.org
Subject [qpid-broker-j] 02/06: QPID-8334: [Broker-J] Stop using hamcrest deprecated matchers
Date Mon, 08 Jul 2019 14:31:38 GMT
This is an automated email from the ASF dual-hosted git repository.

orudyy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git

commit 22031f4ee8bad4d7cd2fa6d240bfc1e3cb52d832
Author: Alex Rudyy <orudyy@apache.org>
AuthorDate: Mon Jul 8 13:47:28 2019 +0100

    QPID-8334: [Broker-J] Stop using hamcrest deprecated matchers
---
 .../protocol/v1_0/extensions/soleconn/CloseExistingPolicy.java | 10 +++++-----
 .../v1_0/extensions/soleconn/RefuseConnectionPolicy.java       |  4 ++--
 .../qpid/tests/protocol/v1_0/messaging/MultiTransferTest.java  |  8 ++++----
 .../qpid/tests/protocol/v1_0/messaging/TransferTest.java       |  4 ++--
 .../protocol/v1_0/transport/link/ResumeDeliveriesTest.java     |  6 +++---
 .../java/org/apache/qpid/tests/http/rest/model/ReadTest.java   |  4 ++--
 6 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicy.java
b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicy.java
index 5be5482..8e4f676 100644
--- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicy.java
+++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicy.java
@@ -28,8 +28,8 @@ import static org.hamcrest.CoreMatchers.hasItem;
 import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.equalTo;
+import static org.hamcrest.Matchers.in;
 import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.isIn;
 import static org.junit.Assume.assumeThat;
 
 import java.net.InetSocketAddress;
@@ -79,7 +79,7 @@ public class CloseExistingPolicy extends BrokerAdminUsingTestBase
             if (responseOpen.getProperties().containsKey(SOLE_CONNECTION_DETECTION_POLICY))
             {
                 assertThat(responseOpen.getProperties().get(SOLE_CONNECTION_DETECTION_POLICY),
-                           isIn(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(),
+                           in(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(),
                                    SoleConnectionDetectionPolicy.WEAK.getValue()}));
             }
         }
@@ -119,7 +119,7 @@ public class CloseExistingPolicy extends BrokerAdminUsingTestBase
                 if (responseOpen2.getProperties().containsKey(SOLE_CONNECTION_DETECTION_POLICY))
                 {
                     assertThat(responseOpen2.getProperties().get(SOLE_CONNECTION_DETECTION_POLICY),
-                               isIn(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(),
+                               in(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(),
                                        SoleConnectionDetectionPolicy.WEAK.getValue()}));
                 }
             }
@@ -159,7 +159,7 @@ public class CloseExistingPolicy extends BrokerAdminUsingTestBase
                 if (responseOpen2.getProperties().containsKey(SOLE_CONNECTION_DETECTION_POLICY))
                 {
                     assertThat(responseOpen2.getProperties().get(SOLE_CONNECTION_DETECTION_POLICY),
-                               isIn(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(),
+                               in(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(),
                                        SoleConnectionDetectionPolicy.WEAK.getValue()}));
                 }
             }
@@ -205,7 +205,7 @@ public class CloseExistingPolicy extends BrokerAdminUsingTestBase
                 if (responseOpen2.getProperties().containsKey(SOLE_CONNECTION_DETECTION_POLICY))
                 {
                     assertThat(responseOpen2.getProperties().get(SOLE_CONNECTION_DETECTION_POLICY),
-                               isIn(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(),
+                               in(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(),
                                        SoleConnectionDetectionPolicy.WEAK.getValue()}));
                 }
             }
diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicy.java
b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicy.java
index dea12a3..ca7d4a7 100644
--- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicy.java
+++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicy.java
@@ -29,8 +29,8 @@ import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.hasKey;
+import static org.hamcrest.Matchers.in;
 import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.isIn;
 import static org.junit.Assume.assumeThat;
 
 import java.net.InetSocketAddress;
@@ -80,7 +80,7 @@ public class RefuseConnectionPolicy extends BrokerAdminUsingTestBase
             if (responseOpen.getProperties().containsKey(SOLE_CONNECTION_DETECTION_POLICY))
             {
                 assertThat(responseOpen.getProperties().get(SOLE_CONNECTION_DETECTION_POLICY),
-                           isIn(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(),
+                           in(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(),
                                    SoleConnectionDetectionPolicy.WEAK.getValue()}));
             }
         }
diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MultiTransferTest.java
b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MultiTransferTest.java
index 0a45410..126c882 100644
--- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MultiTransferTest.java
+++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/MultiTransferTest.java
@@ -26,7 +26,7 @@ import static org.hamcrest.CoreMatchers.nullValue;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.isOneOf;
+import static org.hamcrest.Matchers.oneOf;
 
 import java.net.InetSocketAddress;
 import java.util.HashMap;
@@ -127,7 +127,7 @@ public class MultiTransferTest extends BrokerAdminUsingTestBase
                 payload.dispose();
             }
             assertThat(disposition.getFirst(), is(equalTo(deliveryId)));
-            assertThat(disposition.getLast(), isOneOf(null, deliveryId));
+            assertThat(disposition.getLast(), oneOf(null, deliveryId));
             assertThat(disposition.getSettled(), is(equalTo(false)));
         }
     }
@@ -187,7 +187,7 @@ public class MultiTransferTest extends BrokerAdminUsingTestBase
                 payload.dispose();
             }
             assertThat(disposition.getFirst(), is(equalTo(deliveryId)));
-            assertThat(disposition.getLast(), isOneOf(null, deliveryId));
+            assertThat(disposition.getLast(), oneOf(null, deliveryId));
             assertThat(disposition.getSettled(), is(equalTo(false)));
             assertThat(disposition.getState(), is(instanceOf(Accepted.class)));
         }
@@ -327,7 +327,7 @@ public class MultiTransferTest extends BrokerAdminUsingTestBase
                                                      .getLatestResponse(Disposition.class);
                 dispositionMap.put(disposition.getFirst(), disposition);
 
-                assertThat(disposition.getLast(), isOneOf(null, disposition.getFirst()));
+                assertThat(disposition.getLast(), oneOf(null, disposition.getFirst()));
                 assertThat(disposition.getSettled(), is(equalTo(false)));
                 assertThat(disposition.getState(), is(instanceOf(Accepted.class)));
             }
diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java
b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java
index da7f82a..53a8af6 100644
--- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java
+++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java
@@ -29,10 +29,10 @@ import static org.hamcrest.Matchers.both;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.greaterThan;
 import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.isOneOf;
 import static org.hamcrest.Matchers.lessThan;
 import static org.hamcrest.Matchers.not;
 import static org.hamcrest.Matchers.nullValue;
+import static org.hamcrest.Matchers.oneOf;
 import static org.junit.Assert.fail;
 import static org.junit.Assume.assumeThat;
 
@@ -706,7 +706,7 @@ public class TransferTest extends BrokerAdminUsingTestBase
 
             Transfer second = interaction.consumeResponse(Transfer.class)
                                          .getLatestResponse(Transfer.class);
-            assertThat(second.getMore(), isOneOf(false, null));
+            assertThat(second.getMore(), oneOf(false, null));
             messageDecoder.addTransfer(second);
 
             assertThat(messageDecoder.getData(), is(equalTo(testMessageData)));
diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/link/ResumeDeliveriesTest.java
b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/link/ResumeDeliveriesTest.java
index ad56ea9..a98d76f 100644
--- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/link/ResumeDeliveriesTest.java
+++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transport/link/ResumeDeliveriesTest.java
@@ -27,7 +27,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.anyOf;
 import static org.hamcrest.Matchers.empty;
 import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.isIn;
+import static org.hamcrest.Matchers.in;
 import static org.hamcrest.Matchers.not;
 import static org.hamcrest.Matchers.nullValue;
 import static org.hamcrest.Matchers.typeCompatibleWith;
@@ -245,7 +245,7 @@ public class ResumeDeliveriesTest extends BrokerAdminUsingTestBase
                 assertThat(remoteUnsettled.keySet(), is(not(empty())));
                 for (Binary deliveryTag : remoteUnsettled.keySet())
                 {
-                    assertThat(deliveryTag, isIn(localUnsettled.keySet()));
+                    assertThat(deliveryTag, in(localUnsettled.keySet()));
                 }
                 assertThat(responseAttach2.getIncompleteUnsettled(), is(equalTo(true)));
             }
@@ -428,7 +428,7 @@ public class ResumeDeliveriesTest extends BrokerAdminUsingTestBase
             assertThat(remoteUnsettled.keySet(), is(not(empty())));
             for (Binary deliveryTag : remoteUnsettled.keySet())
             {
-                assertThat(deliveryTag, isIn(localUnsettled.keySet()));
+                assertThat(deliveryTag, in(localUnsettled.keySet()));
             }
             assertThat(resumingAttach.getIncompleteUnsettled(), is(equalTo(true)));
 
diff --git a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/rest/model/ReadTest.java
b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/rest/model/ReadTest.java
index 8dda12b..ac4e897 100644
--- a/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/rest/model/ReadTest.java
+++ b/systests/qpid-systests-http-management/src/test/java/org/apache/qpid/tests/http/rest/model/ReadTest.java
@@ -30,7 +30,7 @@ import static org.hamcrest.CoreMatchers.notNullValue;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.containsInAnyOrder;
 import static org.hamcrest.Matchers.greaterThanOrEqualTo;
-import static org.hamcrest.Matchers.isOneOf;
+import static org.hamcrest.Matchers.oneOf;
 import static org.junit.Assume.assumeThat;
 
 import java.io.ByteArrayInputStream;
@@ -321,7 +321,7 @@ public class ReadTest extends HttpTestBase
         Map<String, Object> parentAttrs = Collections.singletonMap(ConfiguredObject.TYPE,
VirtualHostFileLogger.TYPE);
 
         int response = getHelper().submitRequest(parentUrl, "PUT", parentAttrs);
-        assertThat(response, is(isOneOf(SC_CREATED, SC_OK)));
+        assertThat(response, is(oneOf(SC_CREATED, SC_OK)));
 
         final String childUrl = String.format("virtualhostloginclusionrule/%s/%s", loggerName,
inclusionRuleName);
         Map<String, Object> childAttrs = Collections.singletonMap(ConfiguredObject.TYPE,
VirtualHostNameAndLevelLogInclusionRule.TYPE);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message