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());
}
}
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);
}
}
Aggregations