/** * Test for <code>ExemptionMechanismException()</code> constructor * Assertion: constructs ExemptionMechanismException with no detail message */ @TestTargetNew( level = TestLevel.COMPLETE, notes = "", method = "ExemptionMechanismException", args = {} ) public void testExemptionMechanismException01() { ExemptionMechanismException tE = new ExemptionMechanismException(); assertNull("getMessage() must return null.", tE.getMessage()); assertNull("getCause() must return null", tE.getCause()); try { throw tE; } catch (Exception e) { assertTrue(createErr(tE, e), tE.equals(e)); } }
/** * Test for <code>ExemptionMechanismException(String)</code> constructor * Assertion: constructs ExemptionMechanismException when <code>msg</code> * is null */ @TestTargetNew( level = TestLevel.COMPLETE, notes = "", method = "ExemptionMechanismException", args = {java.lang.String.class} ) public void testExemptionMechanismException03() { String msg = null; ExemptionMechanismException tE = new ExemptionMechanismException(msg); assertNull("getMessage() must return null.", tE.getMessage()); assertNull("getCause() must return null", tE.getCause()); try { throw tE; } catch (Exception e) { assertTrue(createErr(tE, e), tE.equals(e)); } }
@Override protected int engineGenExemptionBlob(byte[] output, int outputOffset) throws ShortBufferException, ExemptionMechanismException { if (output.length - outputOffset < super.engineGenExemptionBlob(output, outputOffset)) { throw new ShortBufferException(); } if (output[outputOffset + 3] == 33) { throw new ExemptionMechanismException(); } return super.engineGenExemptionBlob(output, outputOffset); }
@Override protected void engineInit(Key key) throws InvalidKeyException, ExemptionMechanismException { if (key == null) { throw new InvalidKeyException("key is null"); } if (!(key instanceof tmpKey)) { throw new ExemptionMechanismException("Incorrect key"); } }
@Override protected void engineInit(Key key, AlgorithmParameters params) throws InvalidKeyException, InvalidAlgorithmParameterException, ExemptionMechanismException { if (key == null) { throw new InvalidKeyException("key is null"); } if (!(key instanceof tmpKey)) { throw new ExemptionMechanismException("Incorrect key"); } if (params == null) { throw new InvalidAlgorithmParameterException("params is null"); } }
@Override protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException, ExemptionMechanismException { if (key == null) { throw new InvalidKeyException("key is null"); } if (!(key instanceof tmpKey)) { throw new ExemptionMechanismException("Incorrect key"); } if (params == null) { throw new InvalidAlgorithmParameterException("params is null"); } }
/** * Test for <code>ExemptionMechanismException()</code> constructor * Assertion: constructs ExemptionMechanismException with no detail message */ public void testExemptionMechanismException01() { ExemptionMechanismException tE = new ExemptionMechanismException(); assertNull("getMessage() must return null.", tE.getMessage()); assertNull("getCause() must return null", tE.getCause()); try { throw tE; } catch (Exception e) { assertTrue(createErr(tE, e), tE.equals(e)); } }
/** * Test for <code>ExemptionMechanismException(String)</code> constructor * Assertion: constructs ExemptionMechanismException when <code>msg</code> * is null */ public void testExemptionMechanismException03() { String msg = null; ExemptionMechanismException tE = new ExemptionMechanismException(msg); assertNull("getMessage() must return null.", tE.getMessage()); assertNull("getCause() must return null", tE.getCause()); try { throw tE; } catch (Exception e) { assertTrue(createErr(tE, e), tE.equals(e)); } }
@Override protected void engineInit(Key key, AlgorithmParameters params) throws InvalidKeyException, InvalidAlgorithmParameterException, ExemptionMechanismException { if (key == null) { throw new InvalidKeyException("key is null"); } if (!(key instanceof tmpKey)) { throw new ExemptionMechanismException("Incorrect key"); } }
@Override protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException, ExemptionMechanismException { if (key == null) { throw new InvalidKeyException("key is null"); } if (!(key instanceof tmpKey)) { throw new ExemptionMechanismException("Incorrect key"); } }
protected Object[] getData() { return new Object[] { new ExemptionMechanismException(), new ExemptionMechanismException(null), new ExemptionMechanismException(msgs[1]) }; }
@Override protected byte[] engineGenExemptionBlob() throws ExemptionMechanismException { return super.engineGenExemptionBlob(); }
@Override protected int engineGenExemptionBlob(byte[] output, int outputOffset) throws ShortBufferException, ExemptionMechanismException { return super.engineGenExemptionBlob(output, outputOffset); }
@Override protected void engineInit(Key key) throws InvalidKeyException, ExemptionMechanismException { super.engineInit(key); }
@Override protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException, ExemptionMechanismException { super.engineInit(key, params); }
@Override protected void engineInit(Key key, AlgorithmParameters params) throws InvalidKeyException, InvalidAlgorithmParameterException, ExemptionMechanismException { super.engineInit(key, params); }
@Override protected byte[] engineGenExemptionBlob() throws ExemptionMechanismException { throw new ExemptionMechanismException(); }
@Override protected byte[] engineGenExemptionBlob() throws ExemptionMechanismException { return new byte[byteArrayLength]; }
@Override protected int engineGenExemptionBlob(byte[] output, int outputOffset) throws ShortBufferException, ExemptionMechanismException { return byteArrayLength; }