Examples of UUID


Examples of org.mule.util.UUID

 
  public MessageExchangeImpl() {
    this.status =  ExchangeStatus.ACTIVE;
    this.messages = new HashMap();
    this.properties = new HashMap();
    this.exchangeId = new UUID().getUUID();
  }
View Full Code Here

Examples of org.safehaus.uuid.UUID

    UUIDGenerator generator = UUIDGenerator.getInstance();

    @Test
    public void testEquality()
    {
        UUID a = generator.generateTimeBasedUUID();
        UUID b = new UUID(a.asByteArray());

        timeUUIDType.validate(ByteBuffer.wrap(a.asByteArray()));
        timeUUIDType.validate(ByteBuffer.wrap(b.asByteArray()));
        assertEquals(0, timeUUIDType.compare(ByteBuffer.wrap(a.asByteArray()), ByteBuffer.wrap(b.asByteArray())));
    }
View Full Code Here

Examples of org.teiid.core.id.UUID

    /**
     * Test UUID generation for IDs generated from powers of 2.
     */
    private static void helpTestGenPowers( int nGen ) {
        UUID uuid = null;

        // First test some fairly "regular" numbers...
        for ( int j = 0; j < Math.min(nGen,63); j++ ) {
            long v1 = 1L << j;
            long v2 = (1L << j)/2;
            uuid = new UUID(v1,v2);
            checkStringToObject(uuid)// Test case may fail here
        }
    }
View Full Code Here

Examples of org.teiid.core.id.UUID

   
    /**
     * Test UUID generation for IDs generated randomly.
     */
    private static void helpTestGenRandom( int nGen ) {
        UUID uuid = null;

        // Then test some random numbers...
        java.util.Random rng = new java.util.Random();
        for ( int k = 0; k < nGen; k++ ) {
            long v1 = rng.nextLong();
            long v2 = rng.nextLong();
            uuid = new UUID(v1,v2);
            checkStringToObject(uuid)// Test case may fail here
        }
    }
View Full Code Here

Examples of org.teiid.core.id.UUID

   
    /**
     * Test for duplicates when generating a bunch of IDs.
     */
    private static void helpTestDuplicates( int nGen ) {
        UUID uuid = null;
        Set uuids = new HashSet();
//        Set duplicates = new HashSet();

        // First test some fairly "regular" numbers...
        for ( int j = 0; j < Math.min(nGen,63); j++ ) {
            long v1 = 1L << j;
            long v2 = (1L << j)/2;
            uuid = new UUID(v1,v2);
            assertTrue( "UUID '" + uuid + "' is a duplicate!", !uuids.contains(uuid) ); //$NON-NLS-1$ //$NON-NLS-2$
            uuids.add(uuid);
        }

        // Then test some random numbers...
        java.util.Random rng = new java.util.Random();
        for ( int k = 0; k < nGen; k++ ) {
            long v1 = rng.nextLong();
            long v2 = rng.nextLong();
            uuid = new UUID(v1,v2);
            if ( uuids.contains(uuid) ) {
                fail( "UUID '" + uuid + "' is a duplicate!" ); //$NON-NLS-1$ //$NON-NLS-2$
            }
            uuids.add(uuid);
        }
View Full Code Here

Examples of org.teiid.core.id.UUID

     * @param id1 The ID to test
     */
    public static void checkStringToObject( UUID id1 ) {
        String uuidString = id1.exportableForm();

        UUID id2 = null;
        try {
            id2 = (UUID)UUID.stringToObject( uuidString );
        } catch ( InvalidIDException e ) {
            fail( "Could not convert UUID exportable form '" + uuidString + "' to UUID: " //$NON-NLS-1$ //$NON-NLS-2$
                + e.getMessage() );
View Full Code Here

Examples of pygmy.core.UUID

        String topicUuidStr = request.getParameter("topic");
        String contents = request.getParameter("contents");

//        if( topicUuidStr == null ) return readForum( request, response );

        UUID topicUuid = UUID.parse( topicUuidStr );
        UUID parentMessage = null;
        if( messageUuidStr != null ) {
            parentMessage = UUID.parse( messageUuidStr );
        }

//        NewsGroup topic = forum.getTopic( topicUuid );
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.