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 2021/10/19 21:46:16 UTC

[qpid-protonj2] branch main updated (4ce91f3 -> b2923f5)

This is an automated email from the ASF dual-hosted git repository.

tabish pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-protonj2.git.


    from 4ce91f3  PROTON-2395 Update proton-j test dep to latest 0.33.10
     new 7acf2f8  PROTON-2394 Fix some typos in some Javadocs
     new b2923f5  PROTON-2398 Fix some spelling errors in test names and some cleanup

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../qpid/protonj2/client/impl/ClientExceptionSupport.java  | 14 +++++++-------
 .../qpid/protonj2/engine/impl/ProtonReceiverTest.java      |  2 +-
 .../apache/qpid/protonj2/engine/impl/ProtonSenderTest.java |  4 ++--
 .../qpid/protonj2/engine/impl/ProtonSessionTest.java       |  9 +++++----
 .../engine/impl/ProtonTransactionControllerTest.java       | 10 +++++++++-
 .../engine/sasl/client/AnonymousMechanismTest.java         |  6 +++---
 .../protonj2/engine/sasl/client/CramMD5MechanismTest.java  |  6 +++---
 .../protonj2/engine/sasl/client/PlainMechanismTest.java    |  6 +++---
 8 files changed, 33 insertions(+), 24 deletions(-)

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


[qpid-protonj2] 01/02: PROTON-2394 Fix some typos in some Javadocs

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tabish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-protonj2.git

commit 7acf2f8f5ad3763651361337a22b209721089565
Author: Timothy Bish <ta...@gmail.com>
AuthorDate: Tue Oct 19 17:44:58 2021 -0400

    PROTON-2394 Fix some typos in some Javadocs
    
    Exception support APIs had some bad type references.
---
 .../qpid/protonj2/client/impl/ClientExceptionSupport.java  | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/impl/ClientExceptionSupport.java b/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/impl/ClientExceptionSupport.java
index 9608e8a..60756c1 100644
--- a/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/impl/ClientExceptionSupport.java
+++ b/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/impl/ClientExceptionSupport.java
@@ -45,13 +45,13 @@ import org.apache.qpid.protonj2.types.transport.LinkError;
 class ClientExceptionSupport {
 
     /**
-     * Checks the given cause to determine if it's already an ProviderIOException type and
+     * Checks the given cause to determine if it's already an ClientIOException type and
      * if not creates a new ProviderIOException to wrap it.
      *
      * @param cause
      *        The initiating exception that should be cast or wrapped.
      *
-     * @return an ProviderIOException instance.
+     * @return an ClientIOException instance.
      */
     public static ClientIOException createOrPassthroughFatal(Throwable cause) {
         if (cause instanceof ClientIOException) {
@@ -71,15 +71,15 @@ class ClientExceptionSupport {
     }
 
     /**
-     * Checks the given cause to determine if it's already an ProviderException type and
-     * if not creates a new ProviderException to wrap it.  If the inbound exception is a
+     * Checks the given cause to determine if it's already an ClientException type and
+     * if not creates a new ClientException to wrap it.  If the inbound exception is a
      * fatal type then it will pass through this method untouched to preserve the fatal
      * status of the error.
      *
      * @param cause
      *        The initiating exception that should be cast or wrapped.
      *
-     * @return an ProviderException instance.
+     * @return an ClientException instance.
      */
     public static ClientException createNonFatalOrPassthrough(Throwable cause) {
         if (cause instanceof ClientException) {
@@ -162,7 +162,7 @@ class ClientExceptionSupport {
 
     /**
      * Given an ErrorCondition instance create a new Exception that best matches
-     * the error type that indicates the connection creation failed for some reason.
+     * the error type that indicates the session creation failed for some reason.
      *
      * @param errorCondition
      *      The ErrorCondition returned from the remote peer.
@@ -188,7 +188,7 @@ class ClientExceptionSupport {
 
     /**
      * Given an ErrorCondition instance create a new Exception that best matches
-     * the error type that indicates the connection creation failed for some reason.
+     * the error type that indicates the link creation failed for some reason.
      *
      * @param errorCondition
      *      The ErrorCondition returned from the remote peer.

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


[qpid-protonj2] 02/02: PROTON-2398 Fix some spelling errors in test names and some cleanup

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tabish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-protonj2.git

commit b2923f572bcdcd967b0761610b325c0671393627
Author: Timothy Bish <ta...@gmail.com>
AuthorDate: Tue Oct 19 17:45:56 2021 -0400

    PROTON-2398 Fix some spelling errors in test names and some cleanup
---
 .../apache/qpid/protonj2/engine/impl/ProtonReceiverTest.java   |  2 +-
 .../org/apache/qpid/protonj2/engine/impl/ProtonSenderTest.java |  4 ++--
 .../apache/qpid/protonj2/engine/impl/ProtonSessionTest.java    |  9 +++++----
 .../protonj2/engine/impl/ProtonTransactionControllerTest.java  | 10 +++++++++-
 .../protonj2/engine/sasl/client/AnonymousMechanismTest.java    |  6 +++---
 .../qpid/protonj2/engine/sasl/client/CramMD5MechanismTest.java |  6 +++---
 .../qpid/protonj2/engine/sasl/client/PlainMechanismTest.java   |  6 +++---
 7 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonReceiverTest.java b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonReceiverTest.java
index 0f2ac46..bedfcf6 100644
--- a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonReceiverTest.java
+++ b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonReceiverTest.java
@@ -433,7 +433,7 @@ public class ProtonReceiverTest extends ProtonEngineTestSupport {
         peer.expectOpen().respond().withContainerId("driver");
         peer.expectBegin().respond();
         peer.expectAttach().withRole(Role.RECEIVER.getValue())
-                           .withTarget(notNullValue())
+                           .withSource(notNullValue())
                            .withTarget(notNullValue())
                            .respond();
         peer.expectDetach().respond();
diff --git a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonSenderTest.java b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonSenderTest.java
index 1ee4ec2..66d44bd 100644
--- a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonSenderTest.java
+++ b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonSenderTest.java
@@ -4207,7 +4207,7 @@ public class ProtonSenderTest extends ProtonEngineTestSupport {
     }
 
     @Test
-    void testWriteThatExceedConfiguredSessionIncomingCreditLimitOnTransfer() throws Exception {
+    public void testWriteThatExceedConfiguredSessionIncomingCreditLimitOnTransfer() throws Exception {
         Engine engine = EngineFactory.PROTON.createNonSaslEngine();
         engine.errorHandler(result -> failure = result.failureCause());
         ProtonTestConnector peer = createTestPeer(engine);
@@ -4283,7 +4283,7 @@ public class ProtonSenderTest extends ProtonEngineTestSupport {
     }
 
     @Test
-    void testWriteThatExceedsConfiguredSessionIncomingCreditLimitOnTransferFromCreditUpdatedhandler() throws Exception {
+    public void testWriteThatExceedsConfiguredSessionIncomingCreditLimitOnTransferFromCreditUpdatedhandler() throws Exception {
         Engine engine = EngineFactory.PROTON.createNonSaslEngine();
         engine.errorHandler(result -> failure = result.failureCause());
         ProtonTestConnector peer = createTestPeer(engine);
diff --git a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonSessionTest.java b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonSessionTest.java
index c854785..1cb5c3e 100644
--- a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonSessionTest.java
+++ b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonSessionTest.java
@@ -169,7 +169,7 @@ public class ProtonSessionTest extends ProtonEngineTestSupport {
         }
 
         if (remotelyClosed && !locallyClosed) {
-            peer.remoteEnd();
+            peer.remoteEnd().now();
         }
 
         engine.shutdown();
@@ -307,15 +307,16 @@ public class ProtonSessionTest extends ProtonEngineTestSupport {
         assertNotNull(connection);
 
         connection.open();
-        connection.openHandler((result) -> {
-            remoteOpened.set(true);
-        });
 
         Session session = connection.session();
+        session.openHandler((result) -> {
+            remoteOpened.set(true);
+        });
         session.open();
 
         peer.waitForScriptToComplete();
 
+        assertTrue(remoteOpened.get());
         assertNull(failure);
     }
 
diff --git a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonTransactionControllerTest.java b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonTransactionControllerTest.java
index 78899e0..2186ffb 100644
--- a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonTransactionControllerTest.java
+++ b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/impl/ProtonTransactionControllerTest.java
@@ -195,6 +195,8 @@ class ProtonTransactionControllerTest extends ProtonEngineTestSupport {
         txnController.open();
         txnController.declare();
 
+        assertTrue(openedWithCoordinatorTarget.get());
+
         session.close();
         connection.close();
 
@@ -253,6 +255,8 @@ class ProtonTransactionControllerTest extends ProtonEngineTestSupport {
         txnController.open();
         txnController.declare();
 
+        assertTrue(openedWithCoordinatorTarget.get());
+
         connection.close();
 
         peer.waitForScriptToComplete();
@@ -309,6 +313,8 @@ class ProtonTransactionControllerTest extends ProtonEngineTestSupport {
         txnController.open();
         txnController.declare();
 
+        assertTrue(openedWithCoordinatorTarget.get());
+
         engine.shutdown();
 
         peer.waitForScriptToComplete();
@@ -316,7 +322,7 @@ class ProtonTransactionControllerTest extends ProtonEngineTestSupport {
         assertTrue(engineShutdown.get());
         assertNull(failure);
     }
-
+    
     @Test
     public void testTransactionControllerDoesNotSignalsWhenParentConnectionClosedIfAlreadyClosed() {
         final byte[] TXN_ID = new byte[] { 1, 2, 3, 4 };
@@ -368,6 +374,8 @@ class ProtonTransactionControllerTest extends ProtonEngineTestSupport {
         txnController.declare();
         txnController.close();
 
+        assertTrue(openedWithCoordinatorTarget.get());
+
         connection.close();
 
         peer.waitForScriptToComplete();
diff --git a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/AnonymousMechanismTest.java b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/AnonymousMechanismTest.java
index f875651..b4667bb 100644
--- a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/AnonymousMechanismTest.java
+++ b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/AnonymousMechanismTest.java
@@ -65,19 +65,19 @@ public class AnonymousMechanismTest extends MechanismTestBase {
     @Test
     public void testIsApplicableWithEmtpyUser() {
         assertTrue(SaslMechanisms.ANONYMOUS.createMechanism().isApplicable(credentials("", "pass", false)),
-            "Should be applicable with empty username");
+            "Should be applicable with  username");
     }
 
     @Test
     public void testIsApplicableWithEmtpyPassword() {
         assertTrue(SaslMechanisms.ANONYMOUS.createMechanism().isApplicable(credentials("user", "", false)),
-            "Should be applicable with empty password");
+            "Should be applicable with  password");
     }
 
     @Test
     public void testIsApplicableWithEmtpyUserAndPassword() {
         assertTrue(SaslMechanisms.ANONYMOUS.createMechanism().isApplicable(credentials("", "", false)),
-            "Should be applicable with empty user and password");
+            "Should be applicable with  user and password");
     }
 
     @Test
diff --git a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/CramMD5MechanismTest.java b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/CramMD5MechanismTest.java
index 1829aa8..a9bb6fa 100644
--- a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/CramMD5MechanismTest.java
+++ b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/CramMD5MechanismTest.java
@@ -77,19 +77,19 @@ public class CramMD5MechanismTest extends MechanismTestBase {
     }
 
     @Test
-    public void testIsNotApplicableWithEmtpyUser() {
+    public void testIsNotApplicableWithEmptyUser() {
         assertFalse(SaslMechanisms.CRAM_MD5.createMechanism().isApplicable(credentials("", "pass", false)),
             "Should not be applicable with empty username");
     }
 
     @Test
-    public void testIsNotApplicableWithEmtpyPassword() {
+    public void testIsNotApplicableWithEmptyPassword() {
         assertFalse(SaslMechanisms.CRAM_MD5.createMechanism().isApplicable(credentials("user", "", false)),
             "Should not be applicable with empty password");
     }
 
     @Test
-    public void testIsNotApplicableWithEmtpyUserAndPassword() {
+    public void testIsNotApplicableWithEmptyUserAndPassword() {
         assertFalse(SaslMechanisms.CRAM_MD5.createMechanism().isApplicable(credentials("", "", false)),
             "Should not be applicable with empty user and password");
     }
diff --git a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/PlainMechanismTest.java b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/PlainMechanismTest.java
index 96a90a6..e0aa7ba 100644
--- a/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/PlainMechanismTest.java
+++ b/protonj2/src/test/java/org/apache/qpid/protonj2/engine/sasl/client/PlainMechanismTest.java
@@ -64,19 +64,19 @@ public class PlainMechanismTest extends MechanismTestBase {
     }
 
     @Test
-    public void testIsNotApplicableWithEmtpyUser() {
+    public void testIsNotApplicableWithEmptyUser() {
         assertFalse(SaslMechanisms.PLAIN.createMechanism().isApplicable(credentials("", "pass", false)),
             "Should not be applicable with empty username");
     }
 
     @Test
-    public void testIsNotApplicableWithEmtpyPassword() {
+    public void testIsNotApplicableWithEmptyPassword() {
         assertFalse(SaslMechanisms.PLAIN.createMechanism().isApplicable(credentials("user", "", false)),
             "Should not be applicable with empty password");
     }
 
     @Test
-    public void testIsNotApplicableWithEmtpyUserAndPassword() {
+    public void testIsNotApplicableWithEmptyUserAndPassword() {
         assertFalse(SaslMechanisms.PLAIN.createMechanism().isApplicable(credentials("", "", false)),
             "Should not be applicable with empty user and password");
     }

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