Skip to content

Commit

Permalink
Don't load JNI when testing JNA
Browse files Browse the repository at this point in the history
Temporary work-round for CRYPTO-175
Ideally need to change AbstractTest classes to be generic.
  • Loading branch information
sebbASF committed Nov 9, 2023
1 parent 291e709 commit e63e246
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,26 @@ public void testSkip() throws Exception {

doSkipTest(CIPHER_OPENSSL_JNA, true);
}

@Override
@Test
@Timeout(value = 120000, unit = TimeUnit.MILLISECONDS)
public void testExceptions() throws Exception {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
doExceptionTest(CIPHER_OPENSSL_JNA, baos, false);

doExceptionTest(CIPHER_OPENSSL_JNA, baos, true);
}

@Override
@Test
@Timeout(value = 120000, unit = TimeUnit.MILLISECONDS)
public void testFieldGetters() throws Exception {
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
doFieldGetterTest(CIPHER_OPENSSL_JNA, baos, false);

doFieldGetterTest(CIPHER_OPENSSL_JNA, baos, true);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public void init() {
assumeTrue(OpenSslJna.isEnabled());
}

@Test
@Override // Don't load JNI!
public void testJNI() throws Exception {
}

@Test
public void testCipher() throws Exception {
testCipher(OpenSslJnaCipher.class.getName());
Expand Down

0 comments on commit e63e246

Please sign in to comment.