01: package org.bouncycastle.jce.provider.test;
02:
03: import java.security.Security;
04:
05: import org.bouncycastle.jce.provider.BouncyCastleProvider;
06: import org.bouncycastle.jce.provider.test.rsa3.RSA3CertTest;
07: import org.bouncycastle.util.test.SimpleTestResult;
08:
09: import junit.framework.*;
10:
11: public class AllTests extends TestCase {
12: public void testJCE() {
13: org.bouncycastle.util.test.Test[] tests = RegressionTest.tests;
14:
15: for (int i = 0; i != tests.length; i++) {
16: SimpleTestResult result = (SimpleTestResult) tests[i]
17: .perform();
18:
19: if (!result.isSuccessful()) {
20: fail(result.toString());
21: }
22: }
23: }
24:
25: public static void main(String[] args) {
26: junit.textui.TestRunner.run(suite());
27: }
28:
29: public static Test suite() {
30: TestSuite suite = new TestSuite("JCE Tests");
31:
32: if (Security.getProvider("BC") == null) {
33: Security.addProvider(new BouncyCastleProvider());
34: }
35:
36: suite.addTestSuite(RSA3CertTest.class);
37: suite.addTestSuite(AllTests.class);
38:
39: return suite;
40: }
41: }
|