Search in sources :

Example 1 with MyCertPathRep

use of org.apache.harmony.security.tests.support.cert.MyCertPath.MyCertPathRep in project robovm by robovm.

the class CertPathCertPathRepTest method testCertPathCertPathRep.

/**
     * Test for <code>CertPath.CertPathRep(String type, byte[] data)</code>
     * method<br>
     */
public final void testCertPathCertPathRep() {
    MyCertPath cp = new MyCertPath(testEncoding);
    MyCertPathRep rep = cp.new MyCertPathRep("MyEncoding", testEncoding);
    assertEquals(testEncoding, rep.getData());
    assertEquals("MyEncoding", rep.getType());
    try {
        cp.new MyCertPathRep(null, null);
    } catch (Exception e) {
        fail("Unexpected exeption " + e.getMessage());
    }
}
Also used : MyCertPath(org.apache.harmony.security.tests.support.cert.MyCertPath) MyCertPathRep(org.apache.harmony.security.tests.support.cert.MyCertPath.MyCertPathRep) ObjectStreamException(java.io.ObjectStreamException)

Example 2 with MyCertPathRep

use of org.apache.harmony.security.tests.support.cert.MyCertPath.MyCertPathRep in project robovm by robovm.

the class CertPathCertPathRepTest method testReadResolve.

public final void testReadResolve() {
    MyCertPath cp = new MyCertPath(testEncoding);
    MyCertPathRep rep = cp.new MyCertPathRep("MyEncoding", testEncoding);
    try {
        Object obj = rep.readResolve();
        fail("ObjectStreamException was not thrown.");
    } catch (ObjectStreamException e) {
    //expected
    }
    rep = cp.new MyCertPathRep("MyEncoding", new byte[] { (byte) 1, (byte) 2, (byte) 3 });
    try {
        rep.readResolve();
        fail("ObjectStreamException expected");
    } catch (ObjectStreamException e) {
        // expected
        System.out.println(e);
    }
}
Also used : MyCertPath(org.apache.harmony.security.tests.support.cert.MyCertPath) MyCertPathRep(org.apache.harmony.security.tests.support.cert.MyCertPath.MyCertPathRep) ObjectStreamException(java.io.ObjectStreamException)

Aggregations

ObjectStreamException (java.io.ObjectStreamException)2 MyCertPath (org.apache.harmony.security.tests.support.cert.MyCertPath)2 MyCertPathRep (org.apache.harmony.security.tests.support.cert.MyCertPath.MyCertPathRep)2