use of java.security.cert.CertPath in project robovm by robovm.
the class CertPathTest method testHashCode.
/**
* Test for <code>hashCode()</code> method<br>
* Assertion: returns hash of the <code>Certificate</code> instance
*/
public final void testHashCode() {
CertPath cp1 = new MyCertPath(testEncoding);
CertPath cp2 = new MyCertPath(testEncoding);
CertPath cp3 = new MyCertPath(testEncoding1);
assertTrue(cp1.hashCode() == cp2.hashCode());
assertTrue(cp1.hashCode() != cp3.hashCode());
}
use of java.security.cert.CertPath in project robovm by robovm.
the class CertPathTest method testCertPath.
//
// Tests
//
/**
* Test for <code>CertPath(String type)</code> method<br>
* Assertion: returns hash of the <code>Certificate</code> instance
*/
public final void testCertPath() {
try {
CertPath cp1 = new MyCertPath(testEncoding);
assertEquals("MyEncoding", cp1.getType());
assertTrue(Arrays.equals(testEncoding, cp1.getEncoded()));
} catch (CertificateEncodingException e) {
fail("Unexpected CertificateEncodingException " + e.getMessage());
}
try {
CertPath cp1 = new MyCertPath(null);
} catch (Exception e) {
fail("Unexpected exception " + e.getMessage());
}
}
use of java.security.cert.CertPath in project robovm by robovm.
the class CertPathTest method testEqualsObject04.
/**
* Test for <code>equals(Object)</code> method<br>
* Assertion: object not equals to other which is not
* instance of <code>CertPath</code>
*/
public final void testEqualsObject04() {
CertPath cp1 = new MyCertPath(testEncoding);
assertFalse(cp1.equals("MyEncoding"));
}
use of java.security.cert.CertPath in project robovm by robovm.
the class CertPathTest method testGetEncodedString.
/**
* This test just calls <code>getEncoded(String)</code> method<br>
*
* @throws CertificateEncodingException
*/
public final void testGetEncodedString() throws CertificateEncodingException {
CertPath cp1 = new MyCertPath(testEncoding);
cp1.getEncoded("MyEncoding");
}
use of java.security.cert.CertPath in project robovm by robovm.
the class CertPathTest method testGetCertificates.
//
// the following tests just call methods
// that are abstract in <code>CertPath</code>
// (So they just like signature tests)
//
/**
* This test just calls <code>getCertificates()</code> method<br>
*/
public final void testGetCertificates() {
CertPath cp1 = new MyCertPath(testEncoding);
cp1.getCertificates();
}
Aggregations