1 16 17 23 24 package test.components; 25 26 import junit.framework.Test; 27 import junit.framework.TestCase; 28 import junit.framework.TestSuite; 29 import org.apache.axis.components.uuid.UUIDGen; 30 import org.apache.axis.components.uuid.UUIDGenFactory; 31 32 public class TestUUID extends TestCase { 33 34 public TestUUID(String name) { 35 super(name); 36 } 37 38 public static Test suite() { 39 return new TestSuite(TestUUID.class); 40 } 41 42 public void testUUID() { 43 long startTime = 0; 44 long endTime = 0; 45 UUIDGen uuidgen = null; 46 47 uuidgen = UUIDGenFactory.getUUIDGen(); 48 startTime = System.currentTimeMillis(); 49 for (int i = 1; i <= 10; ++i) { 50 String u = uuidgen.nextUUID(); 51 System.out.println(i + ": " + u); 52 } 53 endTime = System.currentTimeMillis(); 54 System.out.println("UUIDGen took " + (endTime - startTime) + " milliseconds"); 55 } 56 } 57 | Popular Tags |