diff options
author | Sergio Giro <sgiro@google.com> | 2016-02-01 18:54:35 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-02-01 18:54:35 +0000 |
commit | 3e75bd6b407dd472c834a50f16aae54cca67ea9c (patch) | |
tree | b5eb091b97b2aade28e5b45a15352125a4a776d7 /bcprov/src/main/java/org/bouncycastle/util/test/SimpleTest.java | |
parent | 9218edabd1ef9852bc2f13115dcadc81b442dd6c (diff) | |
parent | c1040cb5656c3299f1c2d0fe0bd7c44b10466aaf (diff) | |
download | android_external_bouncycastle-3e75bd6b407dd472c834a50f16aae54cca67ea9c.tar.gz android_external_bouncycastle-3e75bd6b407dd472c834a50f16aae54cca67ea9c.tar.bz2 android_external_bouncycastle-3e75bd6b407dd472c834a50f16aae54cca67ea9c.zip |
Merge "Restoring the contents of aosp after"
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/util/test/SimpleTest.java')
-rw-r--r-- | bcprov/src/main/java/org/bouncycastle/util/test/SimpleTest.java | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/util/test/SimpleTest.java b/bcprov/src/main/java/org/bouncycastle/util/test/SimpleTest.java deleted file mode 100644 index ef8ee61..0000000 --- a/bcprov/src/main/java/org/bouncycastle/util/test/SimpleTest.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.bouncycastle.util.test; - -import java.io.PrintStream; - -import org.bouncycastle.util.Arrays; - -public abstract class SimpleTest - implements Test -{ - public abstract String getName(); - - private TestResult success() - { - return SimpleTestResult.successful(this, "Okay"); - } - - protected void fail( - String message) - { - throw new TestFailedException(SimpleTestResult.failed(this, message)); - } - - protected void fail( - String message, - Throwable throwable) - { - throw new TestFailedException(SimpleTestResult.failed(this, message, throwable)); - } - - protected void fail( - String message, - Object expected, - Object found) - { - throw new TestFailedException(SimpleTestResult.failed(this, message, expected, found)); - } - - protected boolean areEqual( - byte[] a, - byte[] b) - { - return Arrays.areEqual(a, b); - } - - public TestResult perform() - { - try - { - performTest(); - - return success(); - } - catch (TestFailedException e) - { - return e.getResult(); - } - catch (Exception e) - { - return SimpleTestResult.failed(this, "Exception: " + e, e); - } - } - - protected static void runTest( - Test test) - { - runTest(test, System.out); - } - - protected static void runTest( - Test test, - PrintStream out) - { - TestResult result = test.perform(); - - out.println(result.toString()); - if (result.getException() != null) - { - result.getException().printStackTrace(out); - } - } - - public abstract void performTest() - throws Exception; -} |