You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by se...@apache.org on 2011/09/19 16:52:55 UTC

svn commit: r1172650 - /httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/SSLTestContexts.java

Author: sebb
Date: Mon Sep 19 14:52:55 2011
New Revision: 1172650

URL: http://svn.apache.org/viewvc?rev=1172650&view=rev
Log:
Better info than NPE

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/SSLTestContexts.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/SSLTestContexts.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/SSLTestContexts.java?rev=1172650&r1=1172649&r2=1172650&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/SSLTestContexts.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/SSLTestContexts.java Mon Sep 19 14:52:55 2011
@@ -37,6 +37,8 @@ import javax.net.ssl.SSLContext;
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.TrustManagerFactory;
 
+import junit.framework.Assert;
+
 public class SSLTestContexts {
 
     private static KeyManagerFactory createKeyManagerFactory() throws NoSuchAlgorithmException {
@@ -51,6 +53,7 @@ public class SSLTestContexts {
     public static SSLContext createServerSSLContext() throws Exception {
         ClassLoader cl = SSLTestContexts.class.getClassLoader();
         URL url = cl.getResource("test.keystore");
+        Assert.assertNotNull("Keystore URL should not be null", url);
         KeyStore keystore  = KeyStore.getInstance("jks");
         keystore.load(url.openStream(), "nopassword".toCharArray());
         KeyManagerFactory kmfactory = createKeyManagerFactory();