org.apache.commons.id.uuid
Class UUIDTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.id.uuid.UUIDTest
All Implemented Interfaces:
junit.framework.Test

public class UUIDTest
extends junit.framework.TestCase

Unit tests for UUID.

Version:
$Revision: 480488 $ $Date: 2006-11-29 08:57:26 +0000 (Wed, 29 Nov 2006) $
Author:
Commons-id team

Constructor Summary
UUIDTest()
           
 
Method Summary
protected  void setUp()
           
 void testByteArrayConstructor()
          Test byte[] constructor
 void testClockSequence()
          Test the clockSequence() method.
 void testCompareTo()
          Test compareTo of Comparable interface impl.
 void testCopyConstructor()
          Test copy constructor
 void testDataInputConstructor()
          Test DataInput constructor
 void testFromString()
          Test the static fromString method
 void testLongLongConstructor()
          Test long long constructor
 void testNameUUIDFromString()
          Test the static nameUUIDFromString(String name, UUID namespaceUUID) method.
 void testNameUUIDFromStringSha1()
          Test the static #{link UUID.nameUUIDFromString} method, with explicit SHA-1 encoding as specified in version 4 of the UUID draft.
 void testNiltoString()
          Test the nil UUID() contructor returns a zero'd out UUID
 void testNode()
          Test the node method.
 void testStringConstructor()
          Test String constructor
 void testTimestamp()
          Test the timestamp method.
 void testToString()
          Test the toString of UUID
 void testToUrn()
          Test the toUrn method
 void testVariant()
          Test the variant method.
 void testVersion()
          Test the version method.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UUIDTest

public UUIDTest()
Method Detail

setUp

protected void setUp()
              throws java.lang.Exception
Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

testNiltoString

public void testNiltoString()
                     throws java.lang.Exception
Test the nil UUID() contructor returns a zero'd out UUID

Throws:
java.lang.Exception - an exception while testing

testCopyConstructor

public void testCopyConstructor()
                         throws java.lang.Exception
Test copy constructor

Throws:
java.lang.Exception - an exception while testing

testByteArrayConstructor

public void testByteArrayConstructor()
                              throws java.lang.Exception
Test byte[] constructor

Throws:
java.lang.Exception - an exception while testing

testDataInputConstructor

public void testDataInputConstructor()
                              throws java.lang.Exception
Test DataInput constructor

Throws:
java.lang.Exception - an exception while testing

testLongLongConstructor

public void testLongLongConstructor()
                             throws java.lang.Exception
Test long long constructor

Throws:
java.lang.Exception - an exception while testing

testStringConstructor

public void testStringConstructor()
                           throws java.lang.Exception
Test String constructor

Throws:
java.lang.Exception - an exception while testing

testFromString

public void testFromString()
                    throws java.lang.Exception
Test the static fromString method

Throws:
java.lang.Exception - an exception while testing

testNameUUIDFromString

public void testNameUUIDFromString()
                            throws java.lang.Exception
Test the static nameUUIDFromString(String name, UUID namespaceUUID) method.

Throws:
java.lang.Exception - an exception while testing

testNameUUIDFromStringSha1

public void testNameUUIDFromStringSha1()
                                throws java.lang.Exception
Test the static #{link UUID.nameUUIDFromString} method, with explicit SHA-1 encoding as specified in version 4 of the UUID draft.

Throws:
java.lang.Exception

testToString

public void testToString()
                  throws java.lang.Exception
Test the toString of UUID

Throws:
java.lang.Exception - an exception while testing

testToUrn

public void testToUrn()
               throws java.lang.Exception
Test the toUrn method

Throws:
java.lang.Exception - an exception while testing

testCompareTo

public void testCompareTo()
                   throws java.lang.Exception

Test compareTo of Comparable interface impl.

Throws:
java.lang.Exception - a testing Exception.

testClockSequence

public void testClockSequence()
                       throws java.lang.Exception

Test the clockSequence() method.

Throws:
java.lang.Exception - a testing Exception.

testVersion

public void testVersion()
                 throws java.lang.Exception

Test the version method.

Throws:
java.lang.Exception - a testing Exception.

testVariant

public void testVariant()
                 throws java.lang.Exception

Test the variant method.

Throws:
java.lang.Exception - a testing Exception.

testTimestamp

public void testTimestamp()
                   throws java.lang.Exception

Test the timestamp method.

Throws:
java.lang.Exception - a testing Exception.

testNode

public void testNode()
              throws java.lang.Exception

Test the node method.

Throws:
java.lang.Exception - a testing Exception.


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.