You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ga...@apache.org on 2004/11/05 01:11:39 UTC

cvs commit: ws-axis/java/test/components build.xml TestUUID.java

gawor       2004/11/04 16:11:39

  Modified:    java/test/components TestUUID.java
  Added:       java/test/components build.xml
  Log:
  simple uuid gen tests
  
  Revision  Changes    Path
  1.5       +15 -0     ws-axis/java/test/components/TestUUID.java
  
  Index: TestUUID.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/components/TestUUID.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestUUID.java	25 Feb 2004 14:02:54 -0000	1.4
  +++ TestUUID.java	5 Nov 2004 00:11:39 -0000	1.5
  @@ -26,6 +26,7 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.apache.axis.components.uuid.FastUUIDGen;
   import org.apache.axis.components.uuid.UUIDGen;
   import org.apache.axis.components.uuid.UUIDGenFactory;
   
  @@ -52,5 +53,19 @@
           }
           endTime = System.currentTimeMillis();
           System.out.println("UUIDGen took " + (endTime - startTime) + " milliseconds");
  +    }
  +
  +    public void testSequence() {
  +        String current = null;
  +        String prev = null;
  +        
  +        FastUUIDGen g = new FastUUIDGen();
  +        for (int i=0;i<1000;i++) {
  +            current = g.nextUUID();
  +            if (current.equals(prev)) {
  +                fail("same uuid generated: " + current + " " + prev);
  +            }
  +            prev = current;
  +        }
       }
   }
  
  
  
  1.1                  ws-axis/java/test/components/build.xml
  
  Index: build.xml
  ===================================================================
  <?xml version="1.0" ?>
  <!DOCTYPE project [
          <!ENTITY properties SYSTEM "file:../../xmls/properties.xml">
          <!ENTITY paths  SYSTEM "file:../../xmls/path_refs.xml">
          <!ENTITY taskdefs SYSTEM "file:../../xmls/taskdefs.xml">
          <!ENTITY taskdefs_post_compile SYSTEM "file:../../xmls/taskdefs_post_compile.xml">
          <!ENTITY targets SYSTEM "file:../../xmls/targets.xml">
  ]>
  
  <!-- ===================================================================
  <description>
     Test/Sample Component file for Axis
  
  Notes:
     This is a build file for use with the Jakarta Ant build tool.
  
  Prerequisites:
  
     jakarta-ant from http://jakarta.apache.org
  
  Build Instructions:
     To compile
          ant compile
     To execute
          ant run
  
  Author:
    Matt Seibert mseibert@us.ibm.com
  
  Copyright:
    Copyright (c) 2002-2003 Apache Software Foundation.
  </description>
  ==================================================================== -->
  
  <project default="compile">
  <property name="axis.home" location="../.." />
  <property name="componentName" value="test/components" />
  
          &properties;
          &paths;
          &taskdefs;
          &taskdefs_post_compile;
  	&targets;
  
  <target name="clean">
      <echo message="Removing ${build.dir}/classes/${componentName} and ${build.dir}/work/${componentName}" />
      <delete dir="${build.dir}/classes/${componentName}"/>
      <delete dir="${build.dir}/work/${componentName}"/>
  </target>
  
  
  <target name="compile">
    <javac srcdir="${axis.home}" destdir="${build.dest}" debug="${debug}" nowarn="${nowarn}" source="${source}" fork="${javac.fork}">
      <classpath>
          <path refid="classpath"/>
      </classpath>
      <include name="test/components/*.java"/>
    </javac>
  </target>
  
  <target name="run" >
    <antcall target="execute-Component" />
  </target>
  
  </project>