You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by da...@apache.org on 2004/06/22 19:57:40 UTC

cvs commit: xml-xmlbeans/v2/test/src/misc/detailed ThreadingTest.java

daveremy    2004/06/22 10:57:39

  Modified:    v2       build.xml testbuild.xml
               v2/test/src/misc/checkin RuntimeSchemaLoaderTest.java
  Added:       v2/test/src/misc/checkin ThreadingTest.java
  Removed:     v2/test/src/misc/detailed ThreadingTest.java
  Log:
  Contributed by: Yana Kadiyska. Adding detailed target. Fixing checkin target. Moving Threading Test from detailed to Checkin
  
  Revision  Changes    Path
  1.70      +3 -0      xml-xmlbeans/v2/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/build.xml,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- build.xml	15 Jun 2004 18:47:34 -0000	1.69
  +++ build.xml	22 Jun 2004 17:57:39 -0000	1.70
  @@ -825,6 +825,9 @@
   
     <target name="checkintest">
       <ant antfile="${testbuild.file}" target="checkin"/>
  +    <!--<antcall target="bootstrap"/> -->
  +    <antcall target="marshal-drt"/>
  +    <antcall target="binding-drt"/>
     </target>
   
     <target name="detailed">
  
  
  
  1.12      +33 -18    xml-xmlbeans/v2/testbuild.xml
  
  Index: testbuild.xml
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/testbuild.xml,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- testbuild.xml	17 Jun 2004 21:46:24 -0000	1.11
  +++ testbuild.xml	22 Jun 2004 17:57:39 -0000	1.12
  @@ -485,7 +485,15 @@
       </target>
   
       <target name="build.xpath">
  +      <condition property="xbean_xpath.jar.exists">
  +          <available file="${build.lib}/xbean_xpath.jar" /> 
  +      </condition>
  +      <if>
  +      <not><isset property="xbean_xpath.jar.exists"/></not>
  +      <then>
           <ant target="xbean_xpath.jar"/>
  +         </then>
  +      </if>
       </target>
   
       <!-- Builds the tests -->
  @@ -591,6 +599,7 @@
               excludes="${excludes.from.compile}"
               classpathref="test.run.classpath"
               optimize="on"
  +            source="1.4"
               verbose="false"
               failonerror="true"/>
           <jar destfile="${build.dir.test.lib}/testcases.jar"
  @@ -619,8 +628,13 @@
                       <loop>
                           <basename property="testcase" path="${case}"/>
                           <basename property="feature.basename" path="${feature}"/>
  -                    
  -
  +                       
  +                         <available file="${build.dir.test.schemas.lib}/${feature.basename}_${testcase}.jar" property="jar.exists"/>
  +                       <!--  uptodate srcfile= targetfile="${jarname}" property="jar.exists"/-->
  +                       <echo message="JAR ${build.dir.test.schemas.lib}/${feature.basename}_${testcase}.jar, Exists: ${jar.exists}"/>
  +                        <if>
  +                         <isfalse value="${jar.exists}"/>
  +                        <then>
                           <java classname="${schema.compiler}"
                               classpathref="build.classpath"
                               fork="true">
  @@ -629,7 +643,8 @@
                                ${xbeans.test.cases}/xbean/extensions/${feature.basename}/${testcase}"
                                   />
                           </java>
  -                      
  +                         </then>
  +                      </if>
                       </loop>
                   </foreachloop>
               </loop>
  @@ -637,7 +652,7 @@
           </foreachloop>
       </target>
       
  -    <target name="build.area.xmlobject">
  +    <target name="build.area.xmlobject" depends="extensions.build">
           <property name="this.schema.dirs"
               value="${build.dir.test.schemas}/xbean/xmlobject,
                     ${build.dir.test.schemas}/xbean/xmlcursor,
  @@ -651,14 +666,9 @@
   
           <property name="includes.for.compile"
               value="**/xmlobject/**/*.java"/>
  -        <property name="excludes.from.compile"
  -            value="**/extensions/**"/>
  -        <!--   <property name="includes.for.compile"
  -           value="**/xmlobject/checkin/*.java,
  -                 **/xmlobject/common/*.java,
  -                 **/xmlobject/detailed/*.java,
  -                 **/xmlobject/schematypes/*.java,
  -                 **/xmlobject/xmlloader/*.java"/>-->
  +       <!-- <property name="excludes.from.compile"
  +            value="**/extensions/**"/> -->
  +      
           <property name="testcasejar.update" value="true"/>
           <antcall target="unit.build"/>
   
  @@ -708,11 +718,11 @@
   
       <!--TODO: need to compile a subset of the schemas; figure out what and set a separate var-->
       <!-- FREQ Target -->
  -    <target name="build.area.checkin" depends="clean.tests">
  +    <target name="build.area.checkin" depends="clean.tests,extensions.build">
           <property name="includes.for.compile"
               value="**/checkin/**/*.java, **/common/**/*.java"/>
  -        <property name="excludes.from.compile"
  -            value="**/extensions/**"/>
  +        <!--<property name="excludes.from.compile"
  +            value="**/extensions/**"/>-->
           <property name="this.schema.dirs"
               value="${checkin.schema.dirs}"/>
           <property name="this.schema.standalone.dirs"
  @@ -728,10 +738,15 @@
       <!-- =============================================================== -->
       <!-- START: JUNIT Tests                                              -->
       <target name="checkin">
  -        <property name="area.name" value="checkin"/>
  +        <property name="build.area" value="checkin"/>
  +        <antcall target="build"/>
  +      
  +        <antcall target="run.junit"/>
  +    </target>
  +
  +    <target name="detailed">
  +        <property name="tests.spec" value="**/detailed/**"/>
           <antcall target="build"/>
  -        <ant target="marshal-drt"/>
  -        <ant target="binding-drt"/>
           <antcall target="run.junit"/>
       </target>
   
  
  
  
  1.3       +1 -0      xml-xmlbeans/v2/test/src/misc/checkin/RuntimeSchemaLoaderTest.java
  
  Index: RuntimeSchemaLoaderTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/misc/checkin/RuntimeSchemaLoaderTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RuntimeSchemaLoaderTest.java	17 Jun 2004 16:29:37 -0000	1.2
  +++ RuntimeSchemaLoaderTest.java	22 Jun 2004 17:57:39 -0000	1.3
  @@ -29,6 +29,7 @@
   import junit.framework.TestCase;
   import junit.framework.Test;
   import junit.framework.TestSuite;
  +
   import org.w3.x2001.xmlSchema.SchemaDocument.Schema;
   
   
  
  
  
  1.1                  xml-xmlbeans/v2/test/src/misc/checkin/ThreadingTest.java
  
  Index: ThreadingTest.java
  ===================================================================
  /*   Copyright 2004 The Apache Software Foundation
   *
   *   Licensed under the Apache License, Version 2.0 (the "License");
   *   you may not use this file except in compliance with the License.
   *   You may obtain a copy of the License at
   *
   *       http://www.apache.org/licenses/LICENSE-2.0
   *
   *   Unless required by applicable law or agreed to in writing, software
   *   distributed under the License is distributed on an "AS IS" BASIS,
   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   *   See the License for the specific language governing permissions and
   *  limitations under the License.
   */
  /*
  package misc.checkin;
  
  import junit.framework.Test;
  import junit.framework.TestSuite;
  import junit.framework.TestCase;
  import junit.framework.Assert;
  import org.apache.xmlbeans.SchemaTypeLoader;
  import org.apache.xmlbeans.XmlBeans;
  import org.apache.xmlbeans.XmlObject;
  import org.apache.xmlbeans.XmlOptions;
  
  import javax.xml.namespace.QName;
  
  import tools.util.*;
  
  import java.io.File;
  
  public class ThreadingTest extends TestCase
  {
      public ThreadingTest(String name) { super(name); }
      public static Test suite() { return new TestSuite(ThreadingTest.class); }
  
      public static final int THREAD_COUNT = 4;
      public static final int ITERATION_COUNT = 1;
  
      public class CompilationThread extends Thread
      {
          private Throwable _throwable;
          private boolean _result;
  
          public Throwable getException()
          {
              return _throwable;
          }
  
          public boolean getResult()
          {
              return _result;
          }
  
          public void run()
          {
              try
              {
                  for (int i = 0; i < ITERATION_COUNT; i++)
                  {
                      SchemaTypeLoader loader = XmlBeans.loadXsd(new XmlObject[] {
                          XmlObject.Factory.parse(
                                   JarUtil.getResourceFromJarasFile("xsdcases.jar",
                                           "xbean/misc/xmldsig-core-schema.xsd")) });
                      File temp= JarUtil.getResourceFromJarasFile("xmlcases.jar",
                                       "xbean/misc/signature-example.xml");
                      XmlObject result = loader.parse(
                               temp, null, null);
                      Assert.assertEquals(loader.findDocumentType(new QName("http://www.w3.org/2000/09/xmldsig#", "Signature")), result.schemaType());
                  }
                  _result = true;
              }
              catch (Throwable t)
              {
                  _throwable = t;
                  t.printStackTrace();
              }
          }
      }
  
      public void testThreadedCompilation() throws Throwable
      {
          CompilationThread[] threads = new CompilationThread[THREAD_COUNT];
          for (int i = 0; i < threads.length; i++)
          {
              threads[i] = new CompilationThread();
          }
  
          for (int i = 0; i < threads.length; i++)
          {
              threads[i].start();
          }
  
          for (int i = 0; i < threads.length; i++)
          {
              threads[i].join();
          }
  
          for (int i = 0; i < threads.length; i++)
          {
              Assert.assertNull(threads[i].getException());
              Assert.assertTrue("Thread " + i + " didn't succeed", threads[i].getResult());
          }
      }
  }
  
  */
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org