use of org.apache.harmony.security.tests.support.cert.MyCertPath in project robovm by robovm.
the class invalidParams method testCertPathValidator11.
/**
* Test for <code>validate(CertPath certpath, CertPathParameters params)</code> method
* Assertion: throws InvalidAlgorithmParameterException params is not
* instance of PKIXParameters or null
*/
public void testCertPathValidator11() throws NoSuchAlgorithmException, NoSuchProviderException, CertPathValidatorException {
if (!PKIXSupport) {
fail(NotSupportMsg);
return;
}
CertPathValidator[] certPV = createCPVs();
assertNotNull("CertPathValidator objects were not created", certPV);
MyCertPath mCP = new MyCertPath(new byte[0]);
invalidParams mPar = new invalidParams();
for (int i = 0; i < certPV.length; i++) {
try {
certPV[i].validate(mCP, mPar);
fail("InvalidAlgorithmParameterException must be thrown");
} catch (InvalidAlgorithmParameterException e) {
}
try {
certPV[i].validate(mCP, null);
fail("InvalidAlgorithmParameterException must be thrown");
} catch (InvalidAlgorithmParameterException e) {
}
}
}
use of org.apache.harmony.security.tests.support.cert.MyCertPath in project robovm by robovm.
the class CertPathTest method testGetEncodings.
/**
* This test just calls <code>getEncodings()</code> method<br>
*/
public final void testGetEncodings() {
CertPath cp1 = new MyCertPath(testEncoding);
cp1.getEncodings();
}
use of org.apache.harmony.security.tests.support.cert.MyCertPath in project robovm by robovm.
the class CertPathTest method testHashCodeEqualsObject.
/**
* Test for <code>hashCode()</code> method<br>
* Assertion: hash code of equal objects should be the same
*/
public final void testHashCodeEqualsObject() {
CertPath cp1 = new MyCertPath(testEncoding);
CertPath cp2 = new MyCertPath(testEncoding);
assertTrue((cp1.hashCode() == cp2.hashCode()) && cp1.equals(cp2));
}
use of org.apache.harmony.security.tests.support.cert.MyCertPath in project robovm by robovm.
the class CertPathTest method testWriteReplace.
/**
* This test just calls <code>writeReplace()</code> method<br>
*/
public final void testWriteReplace() {
try {
MyCertPath cp1 = new MyCertPath(testEncoding);
Object obj = cp1.writeReplace();
assertTrue(obj.toString().contains("java.security.cert.CertPath$CertPathRep"));
} catch (ObjectStreamException e) {
fail("Unexpected ObjectStreamException " + e.getMessage());
}
}
use of org.apache.harmony.security.tests.support.cert.MyCertPath in project robovm by robovm.
the class CertPathTest method testEqualsObject02.
/**
* Test for <code>equals(Object)</code> method<br>
* Assertion: object equals to other <code>CertPath</code>
* instance with the same state
*/
public final void testEqualsObject02() {
CertPath cp1 = new MyCertPath(testEncoding);
CertPath cp2 = new MyCertPath(testEncoding);
assertTrue(cp1.equals(cp2) && cp2.equals(cp1));
}
Aggregations