Skip to content

Commit

Permalink
Merge branch 'master' into junit4_address
Browse files Browse the repository at this point in the history
  • Loading branch information
prbprbprb authored Oct 28, 2024
2 parents db15c6d + d286b36 commit dbac949
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
10 changes: 8 additions & 2 deletions openjdk/src/test/java/org/conscrypt/NativeRefTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@

package org.conscrypt;

import junit.framework.TestCase;
import static org.junit.Assert.fail;

public class NativeRefTest extends TestCase {
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public class NativeRefTest {
@Test
public void test_zeroContextThrowsNullPointException() {
try {
new NativeRef(0) {
Expand Down
11 changes: 9 additions & 2 deletions openjdk/src/test/java/org/conscrypt/OpenSSLKeyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@

package org.conscrypt;

import static org.junit.Assert.assertEquals;

import java.io.ByteArrayInputStream;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;

import junit.framework.TestCase;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

public class OpenSSLKeyTest extends TestCase {
@RunWith(JUnit4.class)
public class OpenSSLKeyTest {
static final String RSA_PUBLIC_KEY =
"-----BEGIN PUBLIC KEY-----\n" +
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3G7PGpfZx68wTY9eLb4b\n" +
Expand Down Expand Up @@ -84,6 +89,7 @@ public class OpenSSLKeyTest extends TestCase {
"13e6825df950a3bd4509f9d3b12da304fe5b00c443ff33326b8bfb3fe111fd4b" +
"8872822c7f2832dafa0fe10d9aba22310849e978e51c8aa9da7bc1c07511d883", 16);

@Test
public void test_fromPublicKeyPemInputStream() throws Exception {
ByteArrayInputStream is = new ByteArrayInputStream(RSA_PUBLIC_KEY.getBytes(StandardCharsets.UTF_8));
OpenSSLKey key = OpenSSLKey.fromPublicKeyPemInputStream(is);
Expand All @@ -92,6 +98,7 @@ public void test_fromPublicKeyPemInputStream() throws Exception {
assertEquals(RSA_PUBLIC_EXPONENT, publicKey.getPublicExponent());
}

@Test
public void test_fromPrivateKeyPemInputStream() throws Exception {
ByteArrayInputStream is = new ByteArrayInputStream(RSA_PRIVATE_KEY.getBytes(StandardCharsets.UTF_8));
OpenSSLKey key = OpenSSLKey.fromPrivateKeyPemInputStream(is);
Expand Down

0 comments on commit dbac949

Please sign in to comment.