12
12
import org .junit .Assume ;
13
13
14
14
public abstract class AbstractRMQTestSuite extends TestSuite {
15
- private static final int DEFAULT_SSL_PORT = 443 ;
16
-
15
+ private static final String DEFAULT_SSL_HOSTNAME = "localhost" ;
16
+ private static final int DEFAULT_SSL_PORT = 5671 ;
17
+
17
18
private static boolean buildPropertiesFound = false ;
18
19
19
20
private static final Properties TESTS_PROPS = new Properties (System .getProperties ());
@@ -37,14 +38,19 @@ public static boolean isUnderUmbrella() {
37
38
return new File ("../../UMBRELLA.md" ).isFile ();
38
39
}
39
40
40
- public static boolean isSSlAvailable () {
41
+ public static boolean isSSLAvailable () {
42
+ /*
43
+ * FIXME: This method tries to reproduce what was done in Ant's
44
+ * build.xml. It's probably not enough to have a working SSL
45
+ * testsuite with Maven.
46
+ */
41
47
System .setProperty ("SSL_CERTS_DIR" , System .getenv ("SSL_CERTS_DIR" ));
42
- String sslClientPath = System .getProperty ("SSL_CERTS_DIR" ) + FileSystems . getDefault (). getSeparator () + "client" ;
43
- System . setProperty ( "CLIENT_KEYSTORE_PHRASE" , System . getenv ( "bunnies" )) ;
44
- System . setProperty ( "SSL_P12_PASSWORD" , System . getenv ( "PASSWORD" ));
45
- // IF certificate is present and some server is listening on port 443
46
- if ( new File ( sslClientPath ). isFile () && checkServerListening (System . getProperty ( "broker.hostname" ) , DEFAULT_SSL_PORT )) {
47
- System .setProperty ("SSL_AVAILABLE" , sslClientPath );
48
+ String sslClientCertsDir = System .getProperty ("SSL_CERTS_DIR" ) +
49
+ FileSystems . getDefault (). getSeparator () + "client" ;
50
+ // If certificate is present and some server is listening on port 5671
51
+ if ( new File ( sslClientCertsDir ). exists () &&
52
+ checkServerListening (DEFAULT_SSL_HOSTNAME , DEFAULT_SSL_PORT )) {
53
+ System .setProperty ("SSL_AVAILABLE" , sslClientCertsDir );
48
54
return true ;
49
55
} else
50
56
return false ;
0 commit comments