You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by el...@apache.org on 2022/02/05 05:12:37 UTC

[mina] branch 2.1.X updated: Removed the re-establishment of a SSL session in the connector test

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

elecharny pushed a commit to branch 2.1.X
in repository https://gitbox.apache.org/repos/asf/mina.git


The following commit(s) were added to refs/heads/2.1.X by this push:
     new f1f7467  Removed the re-establishment of a SSL session in the connector test
f1f7467 is described below

commit f1f74675ceb6d9cfdd89b3e50288202a81b3013f
Author: emmanuel lecharny <el...@apache.org>
AuthorDate: Sat Feb 5 06:12:06 2022 +0100

    Removed the re-establishment of a SSL session in the connector test
---
 .../mina/example/echoserver/ConnectorTest.java     | 33 ++--------------------
 1 file changed, 2 insertions(+), 31 deletions(-)

diff --git a/mina-example/src/test/java/org/apache/mina/example/echoserver/ConnectorTest.java b/mina-example/src/test/java/org/apache/mina/example/echoserver/ConnectorTest.java
index 8f3163f..7406970 100644
--- a/mina-example/src/test/java/org/apache/mina/example/echoserver/ConnectorTest.java
+++ b/mina-example/src/test/java/org/apache/mina/example/echoserver/ConnectorTest.java
@@ -20,7 +20,6 @@
 package org.apache.mina.example.echoserver;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.net.InetAddress;
@@ -39,7 +38,6 @@ import org.apache.mina.transport.socket.nio.NioDatagramConnector;
 import org.apache.mina.transport.socket.nio.NioSocketConnector;
 import org.apache.mina.util.AvailablePortFinder;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -81,7 +79,7 @@ public class ConnectorTest extends AbstractTest {
     }
 
     @Test
-    @Ignore
+    //@Ignore
     public void testTCPWithSSL() throws Exception {
         useSSL = true;
         // Create a connector
@@ -135,34 +133,7 @@ public class ConnectorTest extends AbstractTest {
 
         // Send closeNotify to test TLS closure if it is TLS connection.
         if (useSSL) {
-            connectorSSLFilter.stopSsl(session).awaitUninterruptibly();
-
-            System.out
-                    .println("-------------------------------------------------------------------------------");
-            // Test again after we finished TLS session.
-            testConnector0(session);
-
-            System.out
-                    .println("-------------------------------------------------------------------------------");
-
-            // Test if we can enter TLS mode again.
-            //// Send StartTLS request.
-            handler.readBuf.clear();
-            IoBuffer buf = IoBuffer.allocate(1);
-            buf.put((byte) '.');
-            buf.flip();
-            session.write(buf).awaitUninterruptibly();
-
-            //// Wait for StartTLS response.
-            waitForResponse(handler, 1);
-
-            handler.readBuf.flip();
-            assertEquals(1, handler.readBuf.remaining());
-            assertEquals((byte) '.', handler.readBuf.get());
-
-            // Now start TLS connection
-            assertTrue(connectorSSLFilter.startSsl(session));
-            testConnector0(session);
+            session.getFilterChain().remove("SSL");
         }
 
         session.closeNow().awaitUninterruptibly();