JNI: call WolfSSL.loadLibrary() in WolfSSLContextTest and WolfSSLSessionTest in @BeforeClass so tests can run independently

pull/153/head
Chris Conlon 2023-10-11 15:04:13 -06:00
parent 7da3a34dd7
commit 5f8e2f55f4
2 changed files with 20 additions and 0 deletions

View File

@ -22,6 +22,7 @@
package com.wolfssl.test;
import org.junit.Test;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.*;
@ -48,6 +49,15 @@ public class WolfSSLContextTest {
WolfSSLContext ctx;
@BeforeClass
public static void loadLibrary() {
try {
WolfSSL.loadLibrary();
} catch (UnsatisfiedLinkError ule) {
fail("failed to load native JNI library");
}
}
@Test
public void testWolfSSLContext() throws WolfSSLException {

View File

@ -22,6 +22,7 @@
package com.wolfssl.test;
import org.junit.Test;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.*;
@ -55,6 +56,15 @@ public class WolfSSLSessionTest {
WolfSSLContext ctx;
WolfSSLSession ssl;
@BeforeClass
public static void loadLibrary() {
try {
WolfSSL.loadLibrary();
} catch (UnsatisfiedLinkError ule) {
fail("failed to load native JNI library");
}
}
@Test
public void testWolfSSLSession() throws WolfSSLException {