Tibor17 commented on a change in pull request #300: URL: https://github.com/apache/maven-surefire/pull/300#discussion_r436304538
########## File path: maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/extensions/E2ETest.java ########## @@ -184,4 +192,74 @@ public void close() .isPositive() .isLessThanOrEqualTo( 6_000L ); } + + @Test( timeout = 10_000L ) + public void shouldAuthenticateClient() throws Exception + { + ForkNodeArguments forkNodeArguments = mock( ForkNodeArguments.class ); + when( forkNodeArguments.getSessionId() ).thenReturn( UUID.randomUUID() ); + + try ( SurefireForkChannel server = new SurefireForkChannel( forkNodeArguments ) ) + { + Thread t = new Thread() + { + @Override + public void run() + { + SurefireMasterProcessChannelProcessorFactory client + = new SurefireMasterProcessChannelProcessorFactory(); + try + { + client.connect( server.getForkNodeConnectionString() ); + } + catch ( IOException e ) + { + e.printStackTrace(); + throw new RuntimeException( e ); + } + } + }; + t.setDaemon( true ); + t.start(); + server.connectToClient(); + } + } + + @Test( timeout = 10_000L ) + public void shouldNotAuthenticateClient() throws Exception + { + ForkNodeArguments forkNodeArguments = mock( ForkNodeArguments.class ); + when( forkNodeArguments.getSessionId() ).thenReturn( UUID.randomUUID() ); + + try ( SurefireForkChannel server = new SurefireForkChannel( forkNodeArguments ) ) + { + Thread t = new Thread() + { + @Override + public void run() + { + SurefireMasterProcessChannelProcessorFactory client + = new SurefireMasterProcessChannelProcessorFactory(); + try + { + URI connectionString = new URI( server.getForkNodeConnectionString() ); + client.connect( "tcp://127.0.0.1:" + connectionString.getPort() Review comment: Need for rebase. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org