diff --git a/src/test/com/wolfssl/WolfSSLSessionTest.java b/src/test/com/wolfssl/WolfSSLSessionTest.java index f0a8bea..1ca51ce 100644 --- a/src/test/com/wolfssl/WolfSSLSessionTest.java +++ b/src/test/com/wolfssl/WolfSSLSessionTest.java @@ -33,34 +33,29 @@ public class WolfSSLSessionTest { @Test public void testWolfSSLSession() throws WolfSSLException { - WolfSSL lib = null; + WolfSSLContext ctx = null; + WolfSSLSession ssl = null; - try { - lib = new WolfSSL(); - } catch (WolfSSLException e) { - fail("failed to create WolfSSL object"); - } + ctx = new WolfSSLContext(WolfSSL.SSLv23_ClientMethod()); System.out.println("WolfSSLSession Class"); - test_WolfSSL_new(lib); + test_WolfSSLSession_new(ssl, ctx); } - public void test_WolfSSL_new(WolfSSL lib) { + public void test_WolfSSLSession_new(WolfSSLSession ssl, + WolfSSLContext ctx) { try { - System.out.print("\tWolfSSL()"); - lib = new WolfSSL(); - } catch (UnsatisfiedLinkError ule) { - System.out.println("\t\t... failed"); - fail("failed to load native JNI library"); + System.out.print("\tWolfSSLSession()"); + ssl = new WolfSSLSession(ctx); } catch (WolfSSLException we) { - System.out.println("\t\t... failed"); - fail("failed to create WolfSSL object"); + System.out.println("\t... failed"); + fail("failed to create WolfSSLSession object"); } - System.out.println("\t\t... passed"); + System.out.println("\t... passed"); } } diff --git a/src/test/com/wolfssl/WolfSSLTest.java b/src/test/com/wolfssl/WolfSSLTest.java index dc01941..64a9f73 100644 --- a/src/test/com/wolfssl/WolfSSLTest.java +++ b/src/test/com/wolfssl/WolfSSLTest.java @@ -44,17 +44,27 @@ public class WolfSSLTest { public void testWolfSSL() throws WolfSSLException { WolfSSL lib = null; + System.out.println("WolfSSL Class"); + + test_WolfSSL_new(lib); + test_WolfSSL_Method_Allocators(lib); + + } + + public void test_WolfSSL_new(WolfSSL lib) { try { + System.out.print("\tWolfSSL()"); lib = new WolfSSL(); - } catch (WolfSSLException e) { + } catch (UnsatisfiedLinkError ule) { + System.out.println("\t\t... failed"); + fail("failed to load native JNI library"); + } catch (WolfSSLException we) { + System.out.println("\t\t... failed"); fail("failed to create WolfSSL object"); } - System.out.println("WolfSSL Class"); - - test_WolfSSL_Method_Allocators(lib); - + System.out.println("\t\t... passed"); } public void test_WolfSSL_Method_Allocators(WolfSSL lib) { diff --git a/src/test/com/wolfssl/WolfSSLTestSuite.java b/src/test/com/wolfssl/WolfSSLTestSuite.java index 7bf8f36..098024c 100644 --- a/src/test/com/wolfssl/WolfSSLTestSuite.java +++ b/src/test/com/wolfssl/WolfSSLTestSuite.java @@ -27,8 +27,8 @@ import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({ WolfSSLTest.class, - WolfSSLSessionTest.class, - WolfSSLContextTest.class + WolfSSLContextTest.class, + WolfSSLSessionTest.class }) public class WolfSSLTestSuite {