Fixed #38 - JUnit3 runner is being used instead of JUnit4 (#39)

- Remove `extends TestCase` which triggered usage of the JUnit3 runner
- Replace `import static org.junit.Assert.assertArrayEquals;` with `import static org.junit.Assert.*;`
- Replace `import junit.framework.TestCase;` with `import org.junit.Test;`
- Annotate all existing test methods (that are prefixed with 'test' and have no args) with `@Test`
This commit is contained in:
Jordan Mews
2017-08-31 09:12:02 -07:00
committed by quannguyentm
parent f755ff0279
commit 9cd6c67936
17 changed files with 144 additions and 35 deletions
@@ -16,6 +16,8 @@
package com.google.security.wycheproof;
import static org.junit.Assert.*;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.gson.JsonElement;
@@ -30,14 +32,14 @@ import java.security.PublicKey;
import java.security.Signature;
import java.security.SignatureException;
import java.security.spec.X509EncodedKeySpec;
import junit.framework.TestCase;
import org.junit.Test;
/**
* This test uses test vectors in JSON format to check digital signature schemes.
* There are still a lot of open questions, e.g. the format for the test vectors is not
* yet finalized. Therefore, we are not integrating the tests here into other tests
*/
public class JsonSignatureTest extends TestCase {
public class JsonSignatureTest {
static protected String getString(JsonObject object, String name) throws Exception {
return object.get(name).getAsString();
@@ -210,10 +212,12 @@ public class JsonSignatureTest extends TestCase {
testVectors(tests, algorithm);
}
@Test
public void testEcdsa() throws Exception {
testSignatureScheme("ecdsa_test.json", "ECDSA");
}
@Test
public void testRsaSignatures() throws Exception {
testSignatureScheme("rsa_signature_test.json", "RSA");
}