Code example for CertificateEncodingException

Methods: getCause, getMessage

0
    /** 
     * Test for <code>CertificateEncodingException()</code> constructor 
     * Assertion: constructs CertificateEncodingException with no detail message 
     */ 
    public void testCertificateEncodingException01() { 
        CertificateEncodingException tE = new CertificateEncodingException();
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
 
    /** 
     * Test for <code>CertificateEncodingException(String)</code> constructor 
     * Assertion: constructs CertificateEncodingException with detail message 
     * msg. Parameter <code>msg</code> is not null. 
     */ 
    public void testCertificateEncodingException02() { 
        CertificateEncodingException tE;
        for (int i = 0; i < msgs.length; i++) {
            tE = new CertificateEncodingException(msgs[i]);
            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
                    .getMessage(), msgs[i]);