Code example for ExemptionMechanism

Methods: getProvider

0
            fail("NoSuchAlgorithmException expected");
        } catch (NoSuchAlgorithmException e) {
            //expected 
        } 
    } 
 
    @TestTargetNew( 
        level = TestLevel.COMPLETE, 
        notes = "Tests Exceptions", 
        method = "getInstance", 
        args = {java.lang.String.class, java.security.Provider.class}
    ) 
    public void test_getInstanceLjava_lang_StringLjava_security_Provider() 
    throws Exception { 
        Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
                "Provider for ExemptionMechanism testing", 
                srvExemptionMechanism.concat(".").concat(defaultAlg),
                ExemptionMechanismProviderClass);
 
        try { 
            ExemptionMechanism.getInstance((String) null, mProv);