~brian-thomason/+junk/bouncycastle

« back to all changes in this revision

Viewing changes to jdk1.0/org/bouncycastle/crypto/test/CipherTest.java

  • Committer: Brian Thomason
  • Date: 2011-12-20 17:20:32 UTC
  • Revision ID: brian.thomason@canonical.com-20111220172032-rdtm13jgdxtksacr
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.bouncycastle.crypto.test;
 
2
 
 
3
import org.bouncycastle.util.test.SimpleTestResult;
 
4
import org.bouncycastle.util.test.Test;
 
5
import org.bouncycastle.util.test.TestResult;
 
6
 
 
7
/**
 
8
 */
 
9
public abstract class CipherTest
 
10
    implements Test
 
11
{
 
12
    Test[]      tests;
 
13
 
 
14
    protected CipherTest(
 
15
        Test[]  tests)
 
16
    {
 
17
        this.tests = tests;
 
18
    }
 
19
 
 
20
    public abstract String getName();
 
21
 
 
22
    public TestResult perform()
 
23
    {
 
24
        for (int i = 0; i != tests.length; i++)
 
25
        {
 
26
            TestResult  res = tests[i].perform();
 
27
 
 
28
            if (!res.isSuccessful())
 
29
            {
 
30
                return res;
 
31
            }
 
32
        }
 
33
 
 
34
        return new SimpleTestResult(true, getName() + ": Okay");
 
35
    }
 
36
}