Author: jsong
Date: Thu Oct  7 17:25:46 2004
New Revision: 54036

Added:
   incubator/beehive/trunk/controls/test/src/README.txt
   incubator/beehive/trunk/controls/test/src/aux/
   incubator/beehive/trunk/controls/test/src/aux/org/
   incubator/beehive/trunk/controls/test/src/aux/org/apache/
   incubator/beehive/trunk/controls/test/src/aux/org/apache/beehive/
   incubator/beehive/trunk/controls/test/src/aux/org/apache/beehive/controls/
   
incubator/beehive/trunk/controls/test/src/aux/org/apache/beehive/controls/test/
   
incubator/beehive/trunk/controls/test/src/aux/org/apache/beehive/controls/test/controls/
   
incubator/beehive/trunk/controls/test/src/aux/org/apache/beehive/controls/test/controls/checker/
   
incubator/beehive/trunk/controls/test/src/aux/org/apache/beehive/controls/test/controls/checker/HelloChecked.java
      - copied unchanged from rev 54018, 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/checker/HelloChecked.java
   
incubator/beehive/trunk/controls/test/src/aux/org/apache/beehive/controls/test/controls/checker/HelloChecker.java
      - copied unchanged from rev 54018, 
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/checker/HelloChecker.java
Removed:
   
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/checker/HelloChecked.java
   
incubator/beehive/trunk/controls/test/src/controls/org/apache/beehive/controls/test/controls/checker/HelloChecker.java
Modified:
   incubator/beehive/trunk/controls/test/build.xml
Log:
Refactoring how controls tests are organized to make building and migration 
more straight forward.

Contributed by Zach Smith ([EMAIL PROTECTED])



Modified: incubator/beehive/trunk/controls/test/build.xml
==============================================================================
--- incubator/beehive/trunk/controls/test/build.xml     (original)
+++ incubator/beehive/trunk/controls/test/build.xml     Thu Oct  7 17:25:46 2004
@@ -24,11 +24,13 @@
     <property name="controls.test.units" 
location="${controls.test.src}/units"/>
     <property name="controls.test.drivers" 
location="${controls.test.src}/drivers"/>
     <property name="controls.test.controls" 
location="${controls.test.src}/controls"/>
+    <property name="controls.test.auxilaries" 
location="${controls.test.src}/aux"/>
     <property name="build.dir" location="${basedir}/build"/>
     <property name="build.classes" location="${build.dir}/classes"/>
     <property name="build.beans" location="${build.dir}/classes/beans"/>
     <property name="build.tests" location="${build.dir}/classes/tests"/>
     <property name="build.drivers" location="${build.dir}/classes/drivers"/>
+    <property name="build.auxilaries" location="${build.dir}/classes/aux"/>
     <property name="build.beansrc" location="${build.dir}/beansrc"/>
     <property name="build.jars" location="${build.dir}/jars"/>
     <property name="controlstestbeans.jar" 
location="${build.dir}/controlstestbeans.jar"/>
@@ -127,43 +129,44 @@
     <!-- ==================================================================== 
-->
 
     <target name="build" depends="dirs">
-        <ant target="build-beans" />
+        <ant target="build-test-auxilaries"/>
+        <ant target="build-test-beans" />
         <ant target="build-test-drivers" />
-        <ant target="build-java-tests" />
+        <ant target="build-test-units" />
+        <ant target="mantis" />
     </target>
 
     <target name="dirs">
         <mkdir dir="${build.classes}" />
         <mkdir dir="${build.beans}" />
         <mkdir dir="${build.drivers}" />
+        <mkdir dir="${build.auxilaries}" />
         <mkdir dir="${build.tests}" />
         <mkdir dir="${build.beansrc}" />
         <mkdir dir="${build.jars}" />
         <mkdir dir="${test.logs}" />
     </target>
 
-    <target name="build-beans" depends="dirs">
-        <!-- Build checkers first so they can be dynamically loaded
-        during build of control extensions.  Checkers may dep on public 
interfaces,
-        which we need to make sure get pulled in by apt -->
-        <apt srcdir="${controls.test.controls}" destdir="${build.beans}" 
gendir="${build.beansrc}"
-             classpathref="test.classpath" >
-            <include name="**/checker/*.java"/>
-        </apt>
+    <target name="build-test-beans" depends="dirs,build-test-auxilaries">
 
         <!-- Build the InnerControl controls used by composition tests.  This 
is only
              necessary because the bean types are needed to compile a public 
interface -->
+        <echo message="** Phase One **"/>
         <apt srcdir="${controls.test.controls}" destdir="${build.beans}" 
gendir="${build.beansrc}"
              classpathref="test.classpath" compileByExtension="true"
              srcExtensions="*.java,*.jcx,*.jcs" >
             <include name="**/composition/InnerControl*"/>
         </apt>
 
+        <echo message="** Phase Two **"/>
         <apt srcdir="${controls.test.controls}" destdir="${build.beans}" 
gendir="${build.beansrc}"
-             classpathref="test.classpath" compileByExtension="true"
+             compileByExtension="true"
+             classpathref="test.classpath"
              srcExtensions="*.java,*.jcx,*.jcs" >
         </apt>
+
         <!-- Do control assembly. -->
+        <echo message="** Assembly **"/>
         <assemble moduleDir="${build.beans}"
                   srcOutputDir="${build.beansrc}"
                   
contextFactoryClassname="org.apache.beehive.controls.runtime.assembly.EJBAssemblyContext$Factory">
@@ -178,8 +181,27 @@
         <control-jar destfile="${controlstestbeans.jar}"  
basedir="${build.beans}" />
     </target>
 
+    <!-- Aux files are those needed for tests but which must be built before 
beans/drivers
+         like Checkers.  Files in 'aux' should only have dependecies on the 
existing classpath and 
+         have NO DEPENDENCIES on artifacts from this build process! -->
+    <target name="build-test-auxilaries" unless="_build.test.auxilaries.ran" 
depends="dirs">
+        <echo message="Building Test Auxilary Files into ${build.beans}"/>
+
+        <apt srcdir="${controls.test.auxilaries}"
+            destdir="${build.beans}"
+            gendir="${build.beansrc}"
+            classpathref="test.classpath"
+            debug="on"  
+            verbose="false"
+            failonerror="true"
+            compileByExtension="true"
+            srcExtensions="*.java"/>
+
+        <property name="_build.test.auxilaries.ran" value="true"/>
 
-    <target name="build-test-drivers" depends="build-beans" 
unless="_build.test.drivers.ran">
+    </target>
+                                                         
+    <target name="build-test-drivers" depends="build-test-beans" 
unless="_build.test.drivers.ran">
        <echo>build helper class for testing controls</echo>
         <!-- Build the test source directory -->
         <javac srcdir="${controls.test.drivers}"
@@ -199,7 +221,7 @@
     </target>
 
 
-    <target name="build-java-tests" depends="build-test-drivers" 
unless="_build.java.tests.ran">
+    <target name="build-test-units" depends="build-test-drivers" 
unless="_build.java.tests.ran">
         <!-- Build the test source directory -->
         <apt srcdir="${controls.test.units}"
             destdir="${build.tests}"
@@ -293,7 +315,7 @@
        <antcall target="run"/>
     </target>
 
-    <target name="run" depends="mantis">
+    <target name="run">
 
         <gethostname/> <!-- set ${hostname} -->
 

Added: incubator/beehive/trunk/controls/test/src/README.txt
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/src/README.txt        Thu Oct  7 
17:25:46 2004
@@ -0,0 +1,26 @@
+This file describes what the various directories within control/test/src
+are for and what to put where.
+
+Controls test are made up of four parts.
+
+* controls
+  
+   This are examples of controls used for excercising different features 
+   of the controls framework.
+   
+* drivers
+
+   Drivers are POJOs which contain the test code which execises the controls
+   and report results.
+
+* units
+ 
+   These are the JUnit files which either instantiate and utilize a driver
+   directly or which access a JPF or JWS whith instantiates the driver and
+   runs the test.
+
+* aux
+
+   Auxilary files are things like Checkers.  Checkers must be compiled *before*
+   the clients that will need them are built.  Files in 'aux' should not
+   contain any dependencies on files which are outside of the aux src tree.

Reply via email to