harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From odea...@apache.org
Subject svn commit: r995054 - /harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/KeyManagerImplTest.java
Date Wed, 08 Sep 2010 13:36:01 GMT
Author: odeakin
Date: Wed Sep  8 13:36:01 2010
New Revision: 995054

URL: http://svn.apache.org/viewvc?rev=995054&view=rev
Log:
Modify KeyManagerImplTest to use SSLContextImpl to construct SSLEngine instances rather than
doing it directly, which was causing a NullPointerException.

Modified:
    harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/KeyManagerImplTest.java

Modified: harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/KeyManagerImplTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/KeyManagerImplTest.java?rev=995054&r1=995053&r2=995054&view=diff
==============================================================================
--- harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/KeyManagerImplTest.java
(original)
+++ harmony/enhanced/java/branches/omd/classlib/modules/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/KeyManagerImplTest.java
Wed Sep  8 13:36:01 2010
@@ -35,15 +35,18 @@ public class KeyManagerImplTest extends 
         ks = KeyStore.getInstance("BKS");
         ks.load(null, null);
 
+        SSLContextImpl context = new SSLContextImpl();
+        context.engineInit(null, null, null);
+
         KeyManagerImpl km = new KeyManagerImpl(ks, new char[0]);
         String[] keyType = {"RSA", "DSA"};
         String al = km.chooseClientAlias(keyType, null, new Socket());
         assertNull(al);
         
-        al = km.chooseEngineClientAlias(keyType, null, new SSLEngineImpl(null));
+        al = km.chooseEngineClientAlias(keyType, null, context.engineCreateSSLEngine());
         assertNull(al);
         
-        al = km.chooseEngineServerAlias("RSA", null, new SSLEngineImpl(null));
+        al = km.chooseEngineServerAlias("RSA", null, context.engineCreateSSLEngine());
         assertNull(al);
         
         al = km.chooseServerAlias("RSA", null, new Socket());
@@ -61,16 +64,19 @@ public class KeyManagerImplTest extends 
         
         KeyStore ks = JSSETestData.getKeyStore();
         char[] pwd = JSSETestData.KS_PASSWORD;
+
+        SSLContextImpl context = new SSLContextImpl();
+        context.engineInit(null, null, null);
         
         KeyManagerImpl km = new KeyManagerImpl(ks, pwd);
         String[] keyType = { "RSA", "DSA" };
         String al = km.chooseClientAlias(keyType, null, new Socket());
         assertEquals("ssl_test_store", al);
 
-        al = km.chooseEngineClientAlias(keyType, null, new SSLEngineImpl(null));
+        al = km.chooseEngineClientAlias(keyType, null, context.engineCreateSSLEngine());
         assertEquals("ssl_test_store", al);
 
-        al = km.chooseEngineServerAlias("RSA", null, new SSLEngineImpl(null));
+        al = km.chooseEngineServerAlias("RSA", null, context.engineCreateSSLEngine());
         assertEquals("ssl_test_store", al);
 
         al = km.chooseServerAlias("RSA", null, new Socket());



Mime
View raw message