Package org.jboss.util.id

Examples of org.jboss.util.id.VMID


    public void testVMID() throws Exception
    {
        HashSet repositoryIDs = new HashSet();
        System.out.println();
        System.out.println("---------------------- testProveVMIDHashCodeIsSame");
        VMID guid = null;
        Method method = VMID.class.getDeclaredMethod("create", new Class[]{});
        method.setAccessible(true);
        for (int i = 0; i < ITERATIONS; i++)
        {
            guid = (VMID) method.invoke(null, new Object[]{});

            Integer hashKey = new Integer(guid.hashCode());

            if (!repositoryIDs.contains(hashKey))
            {
                repositoryIDs.add(hashKey);
            }
            System.out.println("guid.hashCode()=" + guid.hashCode());
        }

        if (repositoryIDs.size()==1)
        {
            fail("HashCode is always returning the same hash");
View Full Code Here

TOP

Related Classes of org.jboss.util.id.VMID

Copyright © 2018 www.massapicom. 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.