Author: ron.sigal(a)jboss.com
Date: 2010-02-15 20:24:03 -0500 (Mon, 15 Feb 2010)
New Revision: 5692
Modified:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/ssl/emptystore/EmptyStoreTestCase.java
Log:
JBREM-1185, JBREM-1172, JBREM-1161: Added testDistinctNONEKeyStore().
Modified:
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/ssl/emptystore/EmptyStoreTestCase.java
===================================================================
---
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/ssl/emptystore/EmptyStoreTestCase.java 2010-02-16
01:23:14 UTC (rev 5691)
+++
remoting2/branches/2.2/src/tests/org/jboss/test/remoting/ssl/emptystore/EmptyStoreTestCase.java 2010-02-16
01:24:03 UTC (rev 5692)
@@ -116,4 +116,51 @@
log.info(getName() + " PASSES");
}
+
+ /**
+ * Creates "NONE" dynamically to test JBREM-1185.
+ */
+ public void testDistinctNONEKeyStore() throws Throwable
+ {
+ log.info("entering " + getName());
+
+ // Create SSLSocketBuilder.
+ HashMap config = new HashMap();
+ String none = new StringBuilder("NONE").toString();
+ config.put(SSLSocketBuilder.REMOTING_KEY_STORE_TYPE, "JKS");
+ config.put(SSLSocketBuilder.REMOTING_KEY_STORE_FILE_PATH, none);
+// config.put(SSLSocketBuilder.REMOTING_KEY_STORE_PASSWORD, "dummy");
+ config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_TYPE, "JKS");
+ config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_FILE_PATH, none);
+// config.put(SSLSocketBuilder.REMOTING_TRUST_STORE_PASSWORD, "dummy");
+ SSLSocketBuilder socketBuilder = new SSLSocketBuilder(config);
+ socketBuilder.setUseSSLServerSocketFactory(false);
+ socketBuilder.setUseSSLSocketFactory(false);
+
+ // Create ServerSocket.
+ try
+ {
+ ServerSocketFactory ssf = socketBuilder.createSSLServerSocketFactory();
+ ServerSocket ss = ssf.createServerSocket();
+ ss.close();
+ }
+ catch (IOException e)
+ {
+ fail("Unable to create ServerSocket");
+ }
+
+ // Create Socket.
+ try
+ {
+ SocketFactory sf = socketBuilder.createSSLSocketFactory();
+ Socket s = sf.createSocket();
+ s.close();
+ }
+ catch (IOException e)
+ {
+ fail("Unable to create Socket");
+ }
+
+ log.info(getName() + " PASSES");
+ }
}
\ No newline at end of file
Show replies by date