Package java.util

Examples of java.util.UUID.version()


     * @see UUID#randomUUID()
     */
    public void test_randomUUID() {
        UUID uuid = UUID.randomUUID();
        assertEquals(2, uuid.variant());
        assertEquals(4, uuid.version());
    }

    /**
     * @see UUID#nameUUIDFromBytes(byte[])
     */
 
View Full Code Here


                (byte) 0x4f, (byte) 0xd4, (byte) 0x30, (byte) 0xc8 };

        UUID uuid = UUID.nameUUIDFromBytes(name);

        assertEquals(2, uuid.variant());
        assertEquals(3, uuid.version());

        assertEquals(0xaff565bc2f771745L, uuid.getLeastSignificantBits());
        assertEquals(0x14cdb9b4de013faaL, uuid.getMostSignificantBits());

        uuid = UUID.nameUUIDFromBytes(new byte[0]);
View Full Code Here

        assertEquals(0xaff565bc2f771745L, uuid.getLeastSignificantBits());
        assertEquals(0x14cdb9b4de013faaL, uuid.getMostSignificantBits());

        uuid = UUID.nameUUIDFromBytes(new byte[0]);
        assertEquals(2, uuid.variant());
        assertEquals(3, uuid.version());

        assertEquals(0xa9800998ecf8427eL, uuid.getLeastSignificantBits());
        assertEquals(0xd41d8cd98f003204L, uuid.getMostSignificantBits());

        try {
View Full Code Here

     * @see UUID#UUID(long, long)
     */
    public void test_ConstructorJJ() {
        UUID uuid = new UUID(0xf81d4fae7dec11d0L, 0xa76500a0c91e6bf6L);
        assertEquals(2, uuid.variant());
        assertEquals(1, uuid.version());
        assertEquals(0x1d07decf81d4faeL, uuid.timestamp());
        assertEquals(130742845922168750L, uuid.timestamp());
        assertEquals(0x2765, uuid.clockSequence());
        assertEquals(0xA0C91E6BF6L, uuid.node());
    }
View Full Code Here

    /**
     * @see UUID#version()
     */
    public void test_version() {
        UUID uuid = new UUID(0, 0);
        assertEquals(0, uuid.version());
        uuid = new UUID(0x0000000000001000L, 0);
        assertEquals(1, uuid.version());
        uuid = new UUID(0x0000000000002000L, 0);
        assertEquals(2, uuid.version());
        uuid = new UUID(0x0000000000003000L, 0);
View Full Code Here

     */
    public void test_version() {
        UUID uuid = new UUID(0, 0);
        assertEquals(0, uuid.version());
        uuid = new UUID(0x0000000000001000L, 0);
        assertEquals(1, uuid.version());
        uuid = new UUID(0x0000000000002000L, 0);
        assertEquals(2, uuid.version());
        uuid = new UUID(0x0000000000003000L, 0);
        assertEquals(3, uuid.version());
        uuid = new UUID(0x0000000000004000L, 0);
View Full Code Here

        UUID uuid = new UUID(0, 0);
        assertEquals(0, uuid.version());
        uuid = new UUID(0x0000000000001000L, 0);
        assertEquals(1, uuid.version());
        uuid = new UUID(0x0000000000002000L, 0);
        assertEquals(2, uuid.version());
        uuid = new UUID(0x0000000000003000L, 0);
        assertEquals(3, uuid.version());
        uuid = new UUID(0x0000000000004000L, 0);
        assertEquals(4, uuid.version());
        uuid = new UUID(0x0000000000005000L, 0);
View Full Code Here

        uuid = new UUID(0x0000000000001000L, 0);
        assertEquals(1, uuid.version());
        uuid = new UUID(0x0000000000002000L, 0);
        assertEquals(2, uuid.version());
        uuid = new UUID(0x0000000000003000L, 0);
        assertEquals(3, uuid.version());
        uuid = new UUID(0x0000000000004000L, 0);
        assertEquals(4, uuid.version());
        uuid = new UUID(0x0000000000005000L, 0);
        assertEquals(5, uuid.version());
    }
View Full Code Here

        uuid = new UUID(0x0000000000002000L, 0);
        assertEquals(2, uuid.version());
        uuid = new UUID(0x0000000000003000L, 0);
        assertEquals(3, uuid.version());
        uuid = new UUID(0x0000000000004000L, 0);
        assertEquals(4, uuid.version());
        uuid = new UUID(0x0000000000005000L, 0);
        assertEquals(5, uuid.version());
    }

    /**
 
View Full Code Here

        uuid = new UUID(0x0000000000003000L, 0);
        assertEquals(3, uuid.version());
        uuid = new UUID(0x0000000000004000L, 0);
        assertEquals(4, uuid.version());
        uuid = new UUID(0x0000000000005000L, 0);
        assertEquals(5, uuid.version());
    }

    /**
     * @see UUID#variant()
     */
 
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.