joakime commented on a change in pull request #46: [MNG-6731] Jetty 
getLocalPort() returns -1 resulting in build failures
URL: 
https://github.com/apache/maven-integration-testing/pull/46#discussion_r314348659
 
 

 ##########
 File path: 
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2305MultipleProxiesTest.java
 ##########
 @@ -71,20 +78,16 @@ public void testit()
         String keyPwd = "key-passwd";
 
         Server server = new Server( 0 );
-        server.addConnector( newHttpsConnector( storePath, storePwd, keyPwd ) 
);
+        addHttpsConnector( server, storePath, storePwd, keyPwd );
         server.setHandler( new RepoHandler() );
         server.start();
-        while ( !server.isRunning() || !server.isStarted() )
+        if ( server.isFailed() )
         {
-            if ( server.isFailed() )
-            {
-                fail( "Couldn't bind the server socket to a free port!" );
-            }
-            Thread.sleep( 100L );
+            fail( "Couldn't bind the server socket to a free port!" );
         }
-        int httpPort = server.getConnectors()[0].getLocalPort();
+        int httpPort = ( (NetworkConnector) server.getConnectors()[0] 
).getLocalPort();
         System.out.println( "Bound server socket to HTTP port " + httpPort );
-        int httpsPort = server.getConnectors()[1].getLocalPort();
+        int httpsPort = ( (NetworkConnector) server.getConnectors()[1] 
).getLocalPort();
 
 Review comment:
   Then your Requests never indicate that they are secure.
   The Requests will not contain the security details.
   The Requests will not have the javax attributes for the SSL / Certificate 
state of the connection.
   Nor will you have ability to use the "confidential" constraints.
   And usages that redirect from HTTP to HTTPS will also fail. (such as 
SecureRedirectHandler)

----------------------------------------------------------------
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


With regards,
Apache Git Services

Reply via email to