use of javax.security.cert.CertificateNotYetValidException in project j2objc by google.
the class CertificateNotYetValidExceptionTest method testCertificateNotYetValidException03.
/**
* Test for <code>CertificateNotYetValidException(String)</code>
* constructor Assertion: constructs CertificateNotYetValidException when
* <code>msg</code> is null
*/
public void testCertificateNotYetValidException03() {
String msg = null;
CertificateNotYetValidException tE = new CertificateNotYetValidException(msg);
assertNull("getMessage() must return null.", tE.getMessage());
assertNull("getCause() must return null", tE.getCause());
}
use of javax.security.cert.CertificateNotYetValidException in project j2objc by google.
the class CertificateNotYetValidExceptionTest method testCertificateNotYetValidException01.
/**
* Test for <code>CertificateNotYetValidException()</code> constructor
* Assertion: constructs CertificateNotYetValidException with no detail
* message
*/
public void testCertificateNotYetValidException01() {
CertificateNotYetValidException tE = new CertificateNotYetValidException();
assertNull("getMessage() must return null.", tE.getMessage());
assertNull("getCause() must return null", tE.getCause());
}
use of javax.security.cert.CertificateNotYetValidException in project j2objc by google.
the class X509CertificateTest method testCheckValidity1.
/**
* checkValidity() method testing.
* @throws CertificateNotYetValidException
* @throws CertificateExpiredException
* @throws java.security.cert.CertificateExpiredException
* @throws java.security.cert.CertificateNotYetValidException
*/
public void testCheckValidity1() throws CertificateExpiredException, CertificateNotYetValidException, java.security.cert.CertificateExpiredException, java.security.cert.CertificateNotYetValidException {
if (this.cert == null) {
// Test can not be applied.
return;
}
Date date = new Date();
Date nb_date = tbt_cert.getNotBefore();
Date na_date = tbt_cert.getNotAfter();
try {
tbt_cert.checkValidity();
assertFalse("CertificateExpiredException expected", date.compareTo(na_date) > 0);
assertFalse("CertificateNotYetValidException expected", date.compareTo(nb_date) < 0);
} catch (CertificateExpiredException e) {
assertTrue("Unexpected CertificateExpiredException was thrown", date.compareTo(na_date) > 0);
} catch (CertificateNotYetValidException e) {
assertTrue("Unexpected CertificateNotYetValidException was thrown", date.compareTo(nb_date) < 0);
}
try {
tbt_cert.checkValidity();
} catch (CertificateExpiredException e) {
// ok
}
try {
cert.checkValidity();
} catch (java.security.cert.CertificateExpiredException e) {
// ok
}
}
use of javax.security.cert.CertificateNotYetValidException in project robovm by robovm.
the class CertificateNotYetValidExceptionTest method testCertificateNotYetValidException03.
/**
* Test for <code>CertificateNotYetValidException(String)</code>
* constructor Assertion: constructs CertificateNotYetValidException when
* <code>msg</code> is null
*/
public void testCertificateNotYetValidException03() {
String msg = null;
CertificateNotYetValidException tE = new CertificateNotYetValidException(msg);
assertNull("getMessage() must return null.", tE.getMessage());
assertNull("getCause() must return null", tE.getCause());
}
Aggregations