Code example for ExemptionMechanism

Methods: init

0
                "Provider for ExemptionMechanism testing", 
                srvExemptionMechanism.concat(".").concat(defaultAlg),
                ExemptionMechanismProviderClass);
 
        try { 
            ExemptionMechanism.getInstance((String) null, mProv);
            fail("NullPointerException expected");
        } catch (NullPointerException e) {
            //expected 
        } 
     
        ExemptionMechanism em = new ExemptionMechanism(
                new Mock_ExemptionMechanismSpi(), mProv, defaultAlg) {
        }; 
 
        try { 
            em.getInstance("WrongAlgName", mProv);
            fail("NoSuchAlgorithmException expected");
        } catch (NoSuchAlgorithmException e) {
            //expected 
        } 
 
        try { 
            em.getInstance("WrongAlgName", (Provider)null);
            fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {
            //expected 
        } 
    } 
 
    @TestTargetNew(