Package org.apache.harmony.security.tests.support

Examples of org.apache.harmony.security.tests.support.MyMessageDigest1.update()


    /**
     * @tests java.security.MessageDigest#update(byte)
     */
    public void test_updateLB() {
        MyMessageDigest1 md = new MyMessageDigest1("ABC");
        md.update((byte) 1);
        assertTrue(md.runEngineUpdate1);
    }

    /**
     * @tests java.security.MessageDigest#update(byte[], int, int)
View Full Code Here


     * @tests java.security.MessageDigest#update(byte[], int, int)
     */
    public void test_updateLB$LILI() {
        MyMessageDigest1 md = new MyMessageDigest1("ABC");
        final byte[] bytes = { 1, 2, 3, 4, 5 };
        md.update(bytes, 1, 2);
        assertTrue(md.runEngineUpdate2);

        // Regression for HARMONY-1120
        try {
            // buf == null
View Full Code Here

        assertTrue(md.runEngineUpdate2);

        // Regression for HARMONY-1120
        try {
            // buf == null
            md.update(null, 0, 1);
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }
        try {
            // offset + len > buf.length
View Full Code Here

            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }
        try {
            // offset + len > buf.length
            md.update(bytes, 0, bytes.length + 1);
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }
        try {
            // offset + len > Integer.MAX_VALUE
View Full Code Here

            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }
        try {
            // offset + len > Integer.MAX_VALUE
            md.update(bytes, Integer.MAX_VALUE, 1);
            fail("No expected IllegalArgumentException");
        } catch (IllegalArgumentException e) {
        }
        // offset<0 and len<0 are passed to provider
        final int offset = -1;
View Full Code Here

                assertEquals("offset", offset, arg1);
                assertEquals("len", len, arg2);
                runEngineUpdate2 = true;
            }
        };
        md.update(bytes, offset, len);
        assertTrue(md.runEngineUpdate2);
    }

    /**
     * @tests java.security.MessageDigest#update(byte[])
View Full Code Here

     * @tests java.security.MessageDigest#update(byte[])
     */
    public void test_updateLB$() {
        MyMessageDigest1 md = new MyMessageDigest1("ABC");
        byte[] b = { 1, 2, 3, 4, 5 };
        md.update(b);
        assertTrue(md.runEngineUpdate2);
    }

    /**
     * @tests java.security.MessageDigest#update(ByteBuffer)
View Full Code Here

        MyMessageDigest1 md = new MyMessageDigest1("ABC");
        byte[] b = { 1, 2, 3, 4, 5 };
        ByteBuffer byteBuffer = ByteBuffer.wrap(b);

        int limit = byteBuffer.limit();
        md.update(byteBuffer);
        assertTrue(md.runEngineUpdate2);
        assertEquals(byteBuffer.limit(), byteBuffer.position());
        assertEquals(limit, byteBuffer.limit());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.