You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ta...@apache.org on 2016/02/22 23:31:56 UTC

qpid-proton git commit: PROTON-1141 Update to JUnit 4.12 and fix some tests that use deprecated assertions.

Repository: qpid-proton
Updated Branches:
  refs/heads/master ce05826f6 -> 6c09f1c9f


PROTON-1141 Update to JUnit 4.12 and fix some tests that use deprecated
assertions.

Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/6c09f1c9
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/6c09f1c9
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/6c09f1c9

Branch: refs/heads/master
Commit: 6c09f1c9fbf1603fe729e53874a6825e3290fcaf
Parents: ce05826
Author: Timothy Bish <ta...@gmail.com>
Authored: Mon Feb 22 17:31:42 2016 -0500
Committer: Timothy Bish <ta...@gmail.com>
Committed: Mon Feb 22 17:31:51 2016 -0500

----------------------------------------------------------------------
 pom.xml                                         |  6 +-
 .../proton/engine/EventExtensibilityTest.java   | 60 ++++++++++++--------
 .../proton/engine/impl/FrameParserTest.java     |  8 ---
 .../impl/ssl/SimpleSslTransportWrapperTest.java |  2 +-
 .../systemtests/DefaultDeliveryStateTest.java   |  7 ---
 .../qpid/proton/systemtests/DeliveryTest.java   |  7 +--
 .../systemtests/engine/ConnectionTest.java      |  3 -
 7 files changed, 44 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6c09f1c9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 655ebb1..075040b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,9 +6,9 @@
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
-  
+
   http://www.apache.org/licenses/LICENSE-2.0
-  
+
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -30,7 +30,7 @@
   <packaging>pom</packaging>
 
   <properties>
-    <junit-version>4.10</junit-version>
+    <junit-version>4.12</junit-version>
   </properties>
 
   <distributionManagement>

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6c09f1c9/proton-j/src/test/java/org/apache/qpid/proton/engine/EventExtensibilityTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/engine/EventExtensibilityTest.java b/proton-j/src/test/java/org/apache/qpid/proton/engine/EventExtensibilityTest.java
index 230788f..81c7470 100644
--- a/proton-j/src/test/java/org/apache/qpid/proton/engine/EventExtensibilityTest.java
+++ b/proton-j/src/test/java/org/apache/qpid/proton/engine/EventExtensibilityTest.java
@@ -21,7 +21,8 @@
 package org.apache.qpid.proton.engine;
 
 import java.io.IOException;
-import java.nio.file.FileVisitOption;
+
+import junit.framework.TestCase;
 
 import org.apache.qpid.proton.engine.Event.Type;
 import org.apache.qpid.proton.engine.EventExtensibilityTest.ExtraEvent.ExtraTypes;
@@ -30,8 +31,6 @@ import org.apache.qpid.proton.reactor.Selectable;
 import org.apache.qpid.proton.reactor.Task;
 import org.junit.Test;
 
-import junit.framework.TestCase;
-
 public class EventExtensibilityTest extends TestCase {
 
     // //////////////
@@ -49,7 +48,7 @@ public class EventExtensibilityTest extends TestCase {
 
     /**
      * Additional events generated by this extension.
-     * 
+     *
      */
     public interface ExtraEvent extends Event {
         /**
@@ -71,7 +70,7 @@ public class EventExtensibilityTest extends TestCase {
         /**
          * typesafe access to event type generated by this extension useful for
          * handling in switch statements
-         * 
+         *
          * @return one of enum values. When invoked on an Event that is not an
          *         ExtraEvent the return value shall be
          */
@@ -79,7 +78,7 @@ public class EventExtensibilityTest extends TestCase {
 
         /**
          * typesafe access to extra information attached to additional events
-         * 
+         *
          * @return ExtraInfo stored in the event attachment
          */
         ExtraInfo getExtraInfo();
@@ -179,42 +178,52 @@ public class EventExtensibilityTest extends TestCase {
 
         // ---- delegate methods for the Event
 
-        public Record attachments() {
+        @Override
+		public Record attachments() {
             return impl.attachments();
         }
 
-        public EventType getEventType() {
+        @Override
+		public EventType getEventType() {
             return impl.getEventType();
         }
 
-        public Type getType() {
+        @Override
+		public Type getType() {
             return impl.getType();
         }
 
-        public Object getContext() {
+        @Override
+		public Object getContext() {
             return impl.getContext();
         }
 
-        public Handler getRootHandler() {
+        @Override
+		public Handler getRootHandler() {
             return impl.getRootHandler();
         }
 
-        public void dispatch(Handler handler) throws HandlerException {
+        @Override
+		public void dispatch(Handler handler) throws HandlerException {
             impl.dispatch(handler);
         }
 
-        public void redispatch(EventType as_type, Handler handler) throws HandlerException {
+        @Override
+		public void redispatch(EventType as_type, Handler handler) throws HandlerException {
             impl.redispatch(as_type, handler);
         }
-        public Connection getConnection() {
+        @Override
+		public Connection getConnection() {
             return impl.getConnection();
         }
 
-        public Session getSession() {
+        @Override
+		public Session getSession() {
             return impl.getSession();
         }
 
-        public Link getLink() {
+        @Override
+		public Link getLink() {
             return impl.getLink();
         }
 
@@ -228,27 +237,33 @@ public class EventExtensibilityTest extends TestCase {
             return impl.getReceiver();
         }
 
-        public Delivery getDelivery() {
+        @Override
+		public Delivery getDelivery() {
             return impl.getDelivery();
         }
 
-        public Transport getTransport() {
+        @Override
+		public Transport getTransport() {
             return impl.getTransport();
         }
 
-        public Reactor getReactor() {
+        @Override
+		public Reactor getReactor() {
             return impl.getReactor();
         }
 
-        public Selectable getSelectable() {
+        @Override
+		public Selectable getSelectable() {
             return impl.getSelectable();
         }
 
-        public Task getTask() {
+        @Override
+		public Task getTask() {
             return impl.getTask();
         }
 
-        public Event copy() {
+        @Override
+		public Event copy() {
             return new ExtraEventImpl(impl.copy());
         }
 
@@ -288,7 +303,6 @@ public class EventExtensibilityTest extends TestCase {
             if (e.getEventType() == ExtraTypes.FOO) {
                 seenFoo = true;
             }
-            FileVisitOption o;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6c09f1c9/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/FrameParserTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/FrameParserTest.java b/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/FrameParserTest.java
index 347184b..be66b3b 100644
--- a/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/FrameParserTest.java
+++ b/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/FrameParserTest.java
@@ -22,9 +22,6 @@ import static org.apache.qpid.proton.engine.Transport.DEFAULT_MAX_FRAME_SIZE;
 import static org.apache.qpid.proton.engine.impl.AmqpHeader.HEADER;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.fail;
-import static org.junit.matchers.JUnitMatchers.containsString;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.argThat;
 import static org.mockito.Mockito.inOrder;
@@ -43,14 +40,10 @@ import org.apache.qpid.proton.codec.DecoderImpl;
 import org.apache.qpid.proton.codec.EncoderImpl;
 import org.apache.qpid.proton.engine.Transport;
 import org.apache.qpid.proton.engine.TransportException;
-import org.apache.qpid.proton.engine.TransportResult;
-import org.apache.qpid.proton.engine.TransportResult.Status;
 import org.apache.qpid.proton.framing.TransportFrame;
 import org.hamcrest.Description;
 import org.junit.Before;
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.ExpectedException;
 import org.mockito.ArgumentMatcher;
 import org.mockito.InOrder;
 
@@ -75,7 +68,6 @@ public class FrameParserTest
     @Test
     public void testInputOfInvalidProtocolHeader_causesErrorAndRefusesFurtherInput()
     {
-        String headerMismatchMessage = "AMQP header mismatch";
         ByteBuffer buffer = _frameParser.tail();
         buffer.put("hello".getBytes());
         _frameParser.process();

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6c09f1c9/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapperTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapperTest.java b/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapperTest.java
index 45e2273..92455e1 100644
--- a/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapperTest.java
+++ b/proton-j/src/test/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapperTest.java
@@ -19,12 +19,12 @@
  *
  */
 package org.apache.qpid.proton.engine.impl.ssl;
+
 import static org.apache.qpid.proton.engine.impl.ByteBufferUtils.pour;
 import static org.apache.qpid.proton.engine.impl.TransportTestHelper.assertByteBufferContentEquals;
 import static org.apache.qpid.proton.engine.impl.TransportTestHelper.pourBufferToString;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6c09f1c9/proton-j/src/test/java/org/apache/qpid/proton/systemtests/DefaultDeliveryStateTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/DefaultDeliveryStateTest.java b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/DefaultDeliveryStateTest.java
index 3ad9d3a..136d5ff 100644
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/DefaultDeliveryStateTest.java
+++ b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/DefaultDeliveryStateTest.java
@@ -46,7 +46,6 @@ import org.apache.qpid.proton.engine.Sender;
 import org.apache.qpid.proton.message.Message;
 import org.junit.Test;
 
-
 public class DefaultDeliveryStateTest extends EngineTestBase
 {
     private static final Logger LOGGER = Logger.getLogger(DefaultDeliveryStateTest.class.getName());
@@ -74,16 +73,12 @@ public class DefaultDeliveryStateTest extends EngineTestBase
         getServer().connection = Proton.connection();
         getServer().transport.bind(getServer().connection);
 
-
-
         LOGGER.fine(bold("======== About to open connections"));
         getClient().connection.open();
         getServer().connection.open();
 
         doOutputInputCycle();
 
-
-
         LOGGER.fine(bold("======== About to open sessions"));
         getClient().session = getClient().connection.session();
         getClient().session.open();
@@ -99,7 +94,6 @@ public class DefaultDeliveryStateTest extends EngineTestBase
         pumpServerToClient();
         assertEndpointState(getClient().session, ACTIVE, ACTIVE);
 
-
         LOGGER.fine(bold("======== About to create reciever"));
 
         getClient().source = new Source();
@@ -122,7 +116,6 @@ public class DefaultDeliveryStateTest extends EngineTestBase
 
         pumpClientToServer();
 
-
         LOGGER.fine(bold("======== About to set up implicitly created sender"));
 
         getServer().sender = (Sender) getServer().connection.linkHead(of(UNINITIALIZED), of(ACTIVE));

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6c09f1c9/proton-j/src/test/java/org/apache/qpid/proton/systemtests/DeliveryTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/DeliveryTest.java b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/DeliveryTest.java
index 67c0462..69db7c1 100644
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/DeliveryTest.java
+++ b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/DeliveryTest.java
@@ -19,13 +19,13 @@
 package org.apache.qpid.proton.systemtests;
 
 import static java.util.EnumSet.of;
-import static junit.framework.Assert.assertEquals;
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
 import static org.apache.qpid.proton.engine.EndpointState.ACTIVE;
 import static org.apache.qpid.proton.engine.EndpointState.UNINITIALIZED;
 import static org.apache.qpid.proton.systemtests.TestLoggingHelper.bold;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
 import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
@@ -163,7 +163,6 @@ public class DeliveryTest extends EngineTestBase
         assertEquals("Unexpected message format", 0, clientDelivery2.getMessageFormat());
         assertEquals("Unexpected message format", 1, clientDelivery3.getMessageFormat());
         assertEquals("Unexpected message format", UnsignedInteger.MAX_VALUE.intValue(), clientDelivery4.getMessageFormat());
-
     }
 
     private Delivery receiveMessageFromServer(String deliveryTag, String messageContent)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6c09f1c9/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/ConnectionTest.java
----------------------------------------------------------------------
diff --git a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/ConnectionTest.java b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/ConnectionTest.java
index 6bf5077..10f6d52 100644
--- a/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/ConnectionTest.java
+++ b/proton-j/src/test/java/org/apache/qpid/proton/systemtests/engine/ConnectionTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.qpid.proton.systemtests.engine;
 
-
 import static java.util.EnumSet.of;
 import static org.apache.qpid.proton.engine.EndpointState.ACTIVE;
 import static org.apache.qpid.proton.engine.EndpointState.CLOSED;
@@ -26,7 +25,6 @@ import static org.apache.qpid.proton.engine.EndpointState.UNINITIALIZED;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
-import static org.junit.Assume.assumeTrue;
 
 import java.util.Arrays;
 import java.util.HashMap;
@@ -42,7 +40,6 @@ import org.apache.qpid.proton.engine.Endpoint;
 import org.apache.qpid.proton.engine.EndpointState;
 import org.apache.qpid.proton.engine.Session;
 import org.apache.qpid.proton.engine.Transport;
-import org.apache.qpid.proton.engine.TransportException;
 import org.apache.qpid.proton.engine.impl.AmqpFramer;
 import org.junit.Ignore;
 import org.junit.Test;


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