Java 8 ExemptionMechanismException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ExemptionMechanismException class.

This code example shows how to use the following methods:
    public static String[] msgs = { 
            "New message", 
            "Long message for Exception. Long message for Exception. Long message for Exception." }; 
 
    protected Object[] getData() { 
        return new Object[] { new ExemptionMechanismException(), 
                new ExemptionMechanismException(null), new ExemptionMechanismException(msgs[1]) }; 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
    public static String[] msgs = { 
            "New message", 
            "Long message for Exception. Long message for Exception. Long message for Exception." }; 
 
    protected Object[] getData() { 
        return new Object[] { new ExemptionMechanismException(), 
                new ExemptionMechanismException(null), new ExemptionMechanismException(msgs[1]) }; 
    } 
 
    public static void main(String[] args) { 
        junit.textui.TestRunner.run(ExemptionMechanismExceptionTest.class); 
    } 
} 
4
CodeRank
This code example shows how to use the following methods:
            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) { 
4
CodeRank
This code example shows how to use the following methods:getMessage
        key = new SecretKeySpec(new byte[10], "DSA");
        try { 
            exMech.init(key);
            fail("ExemptionMechanismException must be thrown");
        } catch (ExemptionMechanismException e) {
            assertTrue("Empty message", (e.getMessage().length() > 0));
        } 
        try { 
            exMech.init(key, params);
            fail("ExemptionMechanismException must be thrown");
        } catch (ExemptionMechanismException e) {
            assertTrue("Empty message", (e.getMessage().length() > 0));
        } 
        try { 
            exMech.init(key, parSpec);
            fail("ExemptionMechanismException must be thrown");
        } catch (ExemptionMechanismException e) {
            assertTrue("Empty message", (e.getMessage().length() > 0));
        } 
    } 

4
CodeRank
This code example shows how to use the following methods:
            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) { 
4
CodeRank
This code example shows how to use the following methods:
    public static String[] msgs = { 
            "New message", 
            "Long message for Exception. Long message for Exception. Long message for Exception." }; 
 
    protected Object[] getData() { 
        return new Object[] { new ExemptionMechanismException(), 
                new ExemptionMechanismException(null), new ExemptionMechanismException(msgs[1]) }; 
    } 
} 
4
CodeRank
This code example shows how to use the following methods:
 
    class Mock_ExemptionMechanismSpi extends MyExemptionMechanismSpi { 
        @Override 
        protected byte[] engineGenExemptionBlob() 
        throws ExemptionMechanismException { 
            throw new ExemptionMechanismException();
        } 
 
        @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);
        } 
4
CodeRank
This code example shows how to use the following methods:
            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) { 
4
CodeRank
This code example shows how to use the following methods:
 
    class Mock_ExemptionMechanismSpi extends MyExemptionMechanismSpi { 
        @Override 
        protected byte[] engineGenExemptionBlob() 
        throws ExemptionMechanismException { 
            throw new ExemptionMechanismException();
        } 
 
        @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);
        } 
3
CodeRank
See Code Examples for Java 8 ExemptionMechanismException Methods: