beehive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From js...@apache.org
Subject svn commit: rev 37492 - in incubator/beehive/trunk/controls/test: . infra/mantis src/units/org/apache/beehive/controls/test/java/composition src/units/org/apache/beehive/controls/test/java/context src/units/org/apache/beehive/controls/test/java/contextevent src/units/org/apache/beehive/controls/test/java/event src/units/org/apache/beehive/controls/test/java/extension src/units/org/apache/beehive/controls/test/java/instantiate src/units/org/apache/beehive/controls/test/java/property src/units/org/apache/beehive/controls/test/jpf/context src/units/org/apache/beehive/controls/test/jpf/contextevent src/units/org/apache/beehive/controls/test/jpf/event src/units/org/apache/beehive/controls/test/jpf/extension src/units/org/apache/beehive/controls/test/jpf/instantiate src/units/org/apache/beehive/controls/test/jpf/property tools/mantis tools/mantis/config tools/mantis/lib tools/mantis/src/org/apache/beehive/mantis tools/mantis/src/org/apache/beehive/test tools/mantis/src/org/apache/beehive/test/tools tools/mantis/src/org/apache/beehive/test/tools/mantis tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch tools/mantis/src/org/apache/beehive/test/tools/mantis/test tools/mantis/src/org/apache/beehive/test/tools/mantis/utils tools/tch
Date Fri, 03 Sep 2004 17:04:36 GMT
Author: jsong
Date: Fri Sep  3 10:04:35 2004
New Revision: 37492

Added:
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/AbstractMantisProcessor.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisFactory.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/TchProcessor.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Desc.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Freq.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Misc.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Status.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/test/
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/test/CheckinTest.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/test/DetailedTest.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/utils/
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/utils/FileTypes.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/utils/MantisFileInfo.java
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/utils/StreamCapture.java
Removed:
   incubator/beehive/trunk/controls/test/infra/mantis/tchschema.jar
   incubator/beehive/trunk/controls/test/infra/mantis/xbean-1.0.2.jar
   incubator/beehive/trunk/controls/test/tools/mantis/lib/
   incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/mantis/
Modified:
   incubator/beehive/trunk/controls/test/build.xml
   incubator/beehive/trunk/controls/test/infra/mantis/mantis.jar
   incubator/beehive/trunk/controls/test/infra/mantis/mantis.properties
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/DeclarativeTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/ContextTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/GetServiceTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/contextevent/LifeCycleTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/EventHandlerTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ListenerTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/instantiate/TestInstantiate.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ImplAccessTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/PropTest.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/context/TestContext.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/TestLifecycleEvent.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/event/TestEvent.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/TestSubControl.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/instantiate/TestInstantiate.java
   incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/property/TestProperty.java
   incubator/beehive/trunk/controls/test/tools/mantis/build.xml
   incubator/beehive/trunk/controls/test/tools/mantis/config/mantis.properties
   incubator/beehive/trunk/controls/test/tools/mantis/mantis.xml
   incubator/beehive/trunk/controls/test/tools/tch/build.xml
Log:
Contributed by Jamie Zyskowski: move mantis into org.apache.beehive.test.tools package, make generated suite names the same as the package name, use the tch-managed schema.jar, use beehive's external xbean jars, update test src to use new package name in imports

Modified: incubator/beehive/trunk/controls/test/build.xml
==============================================================================
--- incubator/beehive/trunk/controls/test/build.xml	(original)
+++ incubator/beehive/trunk/controls/test/build.xml	Fri Sep  3 10:04:35 2004
@@ -97,8 +97,8 @@
         <echo message="----------------------------------------------------------------"/>
         <echo message="clean               - Delete the junit classes."/>
         <echo message="build               - build controls,test drivers and java tests."/>
-        <echo message="checkin.test        - run checkin tests, both java and jpf tests."/>
-        <echo message="detailed.test       - run detailed tests, both java and jpf tests."/>
+        <echo message="checkin.tests       - run checkin tests, both java and jpf tests."/>
+        <echo message="detailed.tests      - run detailed tests, both java and jpf tests."/>
         <echo message="----------------------------------------------------------------"/>
     </target>
 
@@ -324,9 +324,10 @@
 	<pathelement path="${junit.jar}"/>
 	<pathelement path="${servlet24.jar}"/>
 	<pathelement path="${milton.jar}"/>
-	<pathelement path="${tchschema.jar}"/>
+	<pathelement path="${tch.schema.jar}"/>
 	<pathelement path="${mantis.jar}"/>
-	<pathelement path="${mantis.xbean.jar}"/>
+	<pathelement path="${xbean.jar}"/>
+	<pathelement path="${jsr173.jar}"/>
 	<pathelement path="../build/jars/controls.jar"/>
 	<pathelement path="${build.beans}"/>
        	<pathelement path="${build.tests.driver}"/>
@@ -339,7 +340,7 @@
 		<delete dir="${mantis.bingen.dir}"/>
 		<delete dir="${mantis.log.dir}"/>
     <taskdef name="mantis"
-                classname="org.apache.beehive.mantis.MantisTask"
+                classname="org.apache.beehive.test.tools.mantis.MantisTask"
                 classpathref="mantis.classpath"/>
   
     <mantis srcdir="${junit.src.dir}"

Modified: incubator/beehive/trunk/controls/test/infra/mantis/mantis.jar
==============================================================================
Binary files. No diff available.

Modified: incubator/beehive/trunk/controls/test/infra/mantis/mantis.properties
==============================================================================
--- incubator/beehive/trunk/controls/test/infra/mantis/mantis.properties	(original)
+++ incubator/beehive/trunk/controls/test/infra/mantis/mantis.properties	Fri Sep  3 10:04:35 2004
@@ -1 +1 @@
-org.apache.beehive.mantis.annotations.tch=org.apache.beehive.mantis.TchProcessor
+org.apache.beehive.test.tools.mantis.annotations.tch=org.apache.beehive.test.tools.mantis.TchProcessor

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/DeclarativeTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/DeclarativeTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/DeclarativeTest.java	Fri Sep  3 10:04:35 2004
@@ -8,8 +8,8 @@
 import org.apache.beehive.controls.api.bean.ControlBean;
 import org.apache.beehive.controls.test.controls.composition.OuterControlBean;
 import org.apache.beehive.controls.test.controls.composition.InnerControlBean;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 /**
  * A TeseCase that tests control composition.

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/composition/ProgrammaticTest.java	Fri Sep  3 10:04:35 2004
@@ -8,8 +8,8 @@
 import org.apache.beehive.controls.api.bean.ControlBean;
 import org.apache.beehive.controls.test.controls.composition.OuterControlBean;
 import org.apache.beehive.controls.test.controls.composition.InnerControlBean;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 /**
  * A TeseCase that tests control composition.

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/ContextTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/ContextTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/ContextTest.java	Fri Sep  3 10:04:35 2004
@@ -7,7 +7,7 @@
 import org.apache.beehive.controls.test.controls.context.BaseContextBean;
 import org.apache.beehive.controls.test.driver.context.BaseContextBeanDriver;
 import org.apache.beehive.test.tools.milton.common.Report;
-import org.apache.beehive.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
 
 
 /**

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/GetServiceTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/GetServiceTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/context/GetServiceTest.java	Fri Sep  3 10:04:35 2004
@@ -9,8 +9,8 @@
 import org.apache.beehive.controls.api.bean.Control;
 import org.apache.beehive.controls.api.bean.ControlBean;
 import org.apache.beehive.controls.test.controls.context.ServiceGetterBean;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 /**

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/contextevent/LifeCycleTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/contextevent/LifeCycleTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/contextevent/LifeCycleTest.java	Fri Sep  3 10:04:35 2004
@@ -6,8 +6,8 @@
 import org.apache.beehive.controls.api.bean.Control;
 import org.apache.beehive.controls.api.bean.ControlBean;
 import org.apache.beehive.controls.test.controls.contextevent.RecorderBean;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 /**
  * A TestCase that tests control's context event by listening to and recording controls'

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/EventHandlerTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/EventHandlerTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/EventHandlerTest.java	Fri Sep  3 10:04:35 2004
@@ -8,8 +8,8 @@
 import org.apache.beehive.controls.api.bean.ControlBean;
 import org.apache.beehive.controls.api.events.EventHandler;
 import org.apache.beehive.controls.test.controls.event.HelloBean;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 /**
  * A TestCase that tests receiving events from a control by @EventHandler

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ListenerTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ListenerTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/event/ListenerTest.java	Fri Sep  3 10:04:35 2004
@@ -7,8 +7,8 @@
 import org.apache.beehive.controls.api.bean.ControlBean;
 import org.apache.beehive.controls.test.controls.event.Hello;
 import org.apache.beehive.controls.test.controls.event.HelloBean;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 /**
  * A Testcase that tests receiving events from a control with an inner class or

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/extension/SubControlTest.java	Fri Sep  3 10:04:35 2004
@@ -6,8 +6,8 @@
 import org.apache.beehive.controls.api.bean.Control;
 import org.apache.beehive.controls.api.bean.ControlBean;
 import org.apache.beehive.controls.test.controls.extension.SubControlBean;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/instantiate/TestInstantiate.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/instantiate/TestInstantiate.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/instantiate/TestInstantiate.java	Fri Sep  3 10:04:35 2004
@@ -8,8 +8,8 @@
 import org.apache.beehive.controls.test.controls.instantiate.HelloControlBean;
 import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
 import org.apache.beehive.controls.test.controls.property.SingleProperty;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientAccessTest.java	Fri Sep  3 10:04:35 2004
@@ -9,8 +9,8 @@
 import junit.framework.TestCase;
 import org.apache.beehive.test.tools.milton.common.Report;
 
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 /**
  * Test accessing control's propertySet by control bean's getter/setter

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ClientImplTest.java	Fri Sep  3 10:04:35 2004
@@ -8,8 +8,8 @@
 import org.apache.beehive.controls.test.controls.property.SinglePropertyBean;
 
 import org.apache.beehive.test.tools.milton.common.Report;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ImplAccessTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ImplAccessTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/ImplAccessTest.java	Fri Sep  3 10:04:35 2004
@@ -8,8 +8,8 @@
 import junit.framework.Assert;
 import junit.framework.TestCase;
 import org.apache.beehive.test.tools.milton.common.Report;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/PropTest.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/PropTest.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/java/property/PropTest.java	Fri Sep  3 10:04:35 2004
@@ -13,8 +13,8 @@
 import org.apache.beehive.controls.test.driver.property.DrivePropsBeans;
 
 import org.apache.beehive.test.tools.milton.common.Report;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/context/TestContext.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/context/TestContext.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/context/TestContext.java	Fri Sep  3 10:04:35 2004
@@ -1,8 +1,8 @@
 package org.apache.beehive.controls.test.jpf.context;
 
 import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/TestLifecycleEvent.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/TestLifecycleEvent.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/contextevent/TestLifecycleEvent.java	Fri Sep  3 10:04:35 2004
@@ -1,8 +1,8 @@
 package org.apache.beehive.controls.test.jpf.contextevent;
 
 import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/event/TestEvent.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/event/TestEvent.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/event/TestEvent.java	Fri Sep  3 10:04:35 2004
@@ -1,8 +1,8 @@
 package org.apache.beehive.controls.test.jpf.event;
 
 import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/TestSubControl.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/TestSubControl.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/extension/TestSubControl.java	Fri Sep  3 10:04:35 2004
@@ -1,8 +1,8 @@
 package org.apache.beehive.controls.test.jpf.extension;
 
 import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 /**

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/instantiate/TestInstantiate.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/instantiate/TestInstantiate.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/instantiate/TestInstantiate.java	Fri Sep  3 10:04:35 2004
@@ -1,8 +1,8 @@
 package org.apache.beehive.controls.test.jpf.instantiate;
 
 import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 

Modified: incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/property/TestProperty.java
==============================================================================
--- incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/property/TestProperty.java	(original)
+++ incubator/beehive/trunk/controls/test/src/units/org/apache/beehive/controls/test/jpf/property/TestProperty.java	Fri Sep  3 10:04:35 2004
@@ -1,8 +1,8 @@
 package org.apache.beehive.controls.test.jpf.property;
 
 import org.apache.beehive.test.tools.milton.junit.HtmlReportTestCase;
-import org.apache.beehive.mantis.annotations.tch.Freq;
-import org.apache.beehive.mantis.annotations.tch.Status;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Freq;
+import org.apache.beehive.test.tools.mantis.annotations.tch.Status;
 
 
 

Modified: incubator/beehive/trunk/controls/test/tools/mantis/build.xml
==============================================================================
--- incubator/beehive/trunk/controls/test/tools/mantis/build.xml	(original)
+++ incubator/beehive/trunk/controls/test/tools/mantis/build.xml	Fri Sep  3 10:04:35 2004
@@ -28,15 +28,13 @@
 	<property name="temp.dir" value="${mantis.root}/temp"/>
 	<property name="lib.dir" value="${mantis.root}/lib"/>
 	<property name="mantis.local.deploy.jar" value="${deploy.dir}/mantis.jar"/>
-	<property name="tchschema.jar" value="${lib.dir}/tchschema.jar"/>
-	<property name="mantis.xbean.jar" value="${lib.dir}/xbean-1.0.2.jar"/>
 
 	<!--************-->
 	<!-- CLASSPATHS -->
 	<!--************-->
 	<path id="classpath">
-		<pathelement path="${tchschema.jar}"/>
-		<pathelement path="${mantis.xbean.jar}"/>
+		<pathelement path="${tch.schema.jar}"/>
+		<pathelement path="${xbean.jar}"/>
 		<pathelement path="${ant.jar}"/>
 		<pathelement path="${junit.jar}"/>
 		<pathelement path="${tools.jar}"/>
@@ -45,6 +43,7 @@
 	<!--************************-->
 	<!-- TCH SCHEMA COMPILATION -->
 	<!--************************-->
+	<!-- Commented out because tch now privides it's own xmlbeans schema jar
 	<target name="tch.schema.build" >
 		<delete dir="${temp.dir}"/>
 		<mkdir dir="${temp.dir}"/>
@@ -58,7 +57,7 @@
 			<arg line="${tch.home}/schema/everything-suite.xsd"/>
 		</java>
 		<delete dir="${temp.dir}"/>
-	</target>
+	</target>-->
 
 	<!--***************-->
 	<!-- BUILD TARGETS -->				
@@ -85,6 +84,8 @@
 			compiler="modern"
 			executable="${os.JAVA_HOME}/bin/javac"
 			classpathref="classpath"
+			includes="**/beehive/test/tools/**"
+			excludes="**/beehive/mantis/**.*.java"
 			source="1.5">
 		</javac>
 	</target>
@@ -94,7 +95,7 @@
 		<mkdir dir="${deploy.dir}"/>
 		<jar destfile="${mantis.local.deploy.jar}"
 				 basedir="${build.dir}"
-				 excludes="**/test/**"/>
+				 excludes="**/mantis/test/**"/>
 	</target>
 
 	<target name="clean">

Modified: incubator/beehive/trunk/controls/test/tools/mantis/config/mantis.properties
==============================================================================
--- incubator/beehive/trunk/controls/test/tools/mantis/config/mantis.properties	(original)
+++ incubator/beehive/trunk/controls/test/tools/mantis/config/mantis.properties	Fri Sep  3 10:04:35 2004
@@ -1 +1 @@
-org.apache.beehive.mantis.annotations.tch=org.apache.beehive.mantis.TchProcessor
+org.apache.beehive.test.tools.mantis.annotations.tch=org.apache.beehive.test.tools.mantis.TchProcessor

Modified: incubator/beehive/trunk/controls/test/tools/mantis/mantis.xml
==============================================================================
--- incubator/beehive/trunk/controls/test/tools/mantis/mantis.xml	(original)
+++ incubator/beehive/trunk/controls/test/tools/mantis/mantis.xml	Fri Sep  3 10:04:35 2004
@@ -21,38 +21,37 @@
 	<property name="mantis.srcgen.dir" value="${mantis.root}/srcgen"/>
 	<property name="mantis.bingen.dir" value="${mantis.root}/bingen"/>
 	<property name="mantis.log.dir" value="${mantis.root}/log"/>
-	<property name="mantis.config" value="${mantis.root}/config/mantis.properties"/>
-	<property name="lib.dir" value="${mantis.root}/lib"/>
-	<property name="tchschema.jar" value="${lib.dir}/tchschema.jar"/>
-	<property name="mantis.xbean.jar" value="${lib.dir}/xbean-1.0.2.jar"/>
+	<property name="config" value="${mantis.root}/config/mantis.properties"/>
 
 	<!--************-->
 	<!-- CLASSPATHS -->
 	<!--************-->
 	<path id="mantis.run.classpath">
 		<pathelement path="${mantis.local.deploy.jar}"/>
-		<pathelement path="${tchschema.jar}"/>
-		<pathelement path="${mantis.xbean.jar}"/>
+		<pathelement path="${tch.schema.jar}"/>
+		<pathelement path="${xbean.jar}"/>
 		<pathelement path="${ant.jar}"/>
 		<pathelement path="${junit.jar}"/>
+		<pathelement path="${jsr173.jar}"/>
 	</path>
 
 	<path id="tch.run.classpath">
 		<pathelement path="${mantis.build.dir}"/>
 		<pathelement path="${junit.jar}"/>
 		<pathelement path="${tch.jar}"/>
-		<pathelement path="${tch.home}/schema.jar"/>
-		<pathelement path="${mantis.xbean.jar}"/>
+		<pathelement path="${tch.schema.jar}"/>
+		<pathelement path="${xbean.jar}"/>
 		<pathelement path="${ant.jar}"/>
 		<pathelement path="${ant.home}/lib/ant-launcher.jar"/>
 		<pathelement path="${jakarta.jar}"/>
 		<pathelement path="${xerces.jar}"/>
+		<pathelement path="${jsr173.jar}"/>
 	</path>
 
 	<!--********-->
 	<!-- MANTIS -->
 	<!--********-->
-	<taskdef name="mantis" classname="org.apache.beehive.mantis.MantisTask" classpathref="mantis.run.classpath"/>
+	<taskdef name="mantis" classname="org.apache.beehive.test.tools.mantis.MantisTask" classpathref="mantis.run.classpath"/>
 	<property name="mantis.run.classpath" refid="mantis.run.classpath"/>
 	<target name="run.mantis">
 		<delete dir="${mantis.srcgen.dir}"/>
@@ -63,7 +62,7 @@
 						bingen="${mantis.bingen.dir}"
 						classpath="${mantis.run.classpath}"
 						logdir="${mantis.log.dir}"
-						config="${mantis.config}"
+						config="${config}"
 						aptcommand="${os.JAVA_HOME}/bin/apt"
 		/>
 	</target>

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/AbstractMantisProcessor.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/AbstractMantisProcessor.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,74 @@
+package org.apache.beehive.test.tools.mantis;
+
+// mirror apis
+import com.sun.mirror.apt.AnnotationProcessor;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.apt.Filer;
+import com.sun.mirror.declaration.PackageDeclaration;
+import com.sun.mirror.declaration.AnnotationTypeDeclaration;
+import com.sun.mirror.declaration.AnnotationTypeElementDeclaration;
+import com.sun.mirror.declaration.AnnotationValue;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.declaration.ClassDeclaration;
+import com.sun.mirror.declaration.MethodDeclaration;
+import com.sun.mirror.declaration.AnnotationMirror;
+
+// java utils
+import java.io.PrintWriter;
+import java.io.IOException;
+import java.io.File;
+import java.util.Map;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.ArrayList;
+
+// mantis annotations
+//import org.apache.beehive.mantis.annotations.*;
+
+import org.apache.beehive.test.tools.mantis.utils.FileTypes;
+import org.apache.beehive.test.tools.mantis.utils.MantisFileInfo;
+
+// tch schema types
+//import org.apache.xmlbeans.XmlAnySimpleType;
+//import org.apache.xmlbeans.XmlAnySimpleType.Factory;
+//import noNamespace.ProjectDocument.*;
+//import noNamespace.*;
+
+public abstract class AbstractMantisProcessor implements AnnotationProcessor
+{
+  private HashSet<MantisFileInfo> _fileinfos;
+  protected Set<AnnotationTypeDeclaration> _atds;
+  protected AnnotationProcessorEnvironment _env;
+  protected String _srctree;
+  protected String _classtree;
+
+  abstract public void process();
+
+  public void init(Set<AnnotationTypeDeclaration> p_atds,
+                   AnnotationProcessorEnvironment p_env)
+  {
+    this._atds = p_atds;
+    this._env = p_env;
+    _fileinfos = new HashSet<MantisFileInfo>();
+
+    // initialize the file gen dir strings
+    Map<String,String> opts = _env.getOptions();
+    _srctree = opts.get("-s");
+    _classtree = opts.get("-d");
+  }
+
+  protected void registerFile(String url, String creatingClassname, FileTypes type)
+  {
+    MantisFileInfo finfo = new MantisFileInfo(url,
+                                              creatingClassname,
+                                              type);
+    _fileinfos.add(finfo);
+  } 
+
+  public HashSet<MantisFileInfo> getFileInfo()
+  {
+    return _fileinfos;
+  }
+}

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisFactory.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisFactory.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,211 @@
+package org.apache.beehive.test.tools.mantis;
+
+import com.sun.mirror.apt.*;
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+import com.sun.mirror.util.*;
+
+import java.io.FileReader;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.lang.StringBuffer;
+import java.lang.ClassNotFoundException;
+import java.lang.InstantiationException;
+import java.lang.IllegalAccessException;
+import java.util.Collection;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
+import static java.util.Collections.*;
+
+
+public class MantisFactory implements AnnotationProcessorFactory
+{
+  // map of annotation package to processor name
+  private HashMap<String,String> _processorMap;
+
+  // claim that all annotations are handled by this factory
+  // at runtime the mantis config is loaded in getProcessorFor()
+  private static final Collection<String> _supportedAnnotations
+    = unmodifiableCollection(Arrays.asList("*"));
+
+  // options passed to apt at runtime
+  private Map<String,String> _options;
+
+  // options that are supported
+  private final Collection<String> _supportedOptions;
+
+
+  public MantisFactory()
+  {
+    this._supportedOptions = initSupportedOptions();
+  }
+
+
+  public Collection<String> supportedAnnotationTypes(){return _supportedAnnotations;}
+
+  public Collection<String> supportedOptions(){return _supportedOptions;}
+
+  public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> p_atds,
+                                             AnnotationProcessorEnvironment p_env)
+  {    
+    // parse the command line args
+    // TODO: when apt gives proper key=value pairs, chage to fit.
+    // TODO: for now, everything is in the key
+    String configurl = null;
+    String processorName = null;
+    Set<String> keys = p_env.getOptions().keySet();
+    Iterator it = keys.iterator();
+    while(it.hasNext())
+    {
+      String curr = (String) it.next();
+      String[] val = curr.split("=");
+      if(val[0].equalsIgnoreCase("-Aprocessor"))
+        processorName = val[1];
+      else if(val[0].equalsIgnoreCase("-Aconfig"))
+        configurl = val[1];
+    }
+    it = null;
+
+    // initiialize the configuration
+    initProcessorMap(configurl);
+
+    // initialize the processor(s)
+    // if no command line override - return a composite 
+    // of all processors that map the the annotations present
+    HashSet<AnnotationProcessor> processors = new HashSet<AnnotationProcessor>();    
+    if(null == processorName)
+    {
+
+      // first loop through the annotation types and collect the
+      // set of unique annotation package names
+      it = p_atds.iterator();
+      HashSet<String> annotationPackages = new HashSet<String>();
+      while(it.hasNext())
+      {
+        AnnotationTypeDeclaration atd = (AnnotationTypeDeclaration)it.next();
+        annotationPackages.add(atd.getPackage().getQualifiedName());
+      }
+      it = null;
+
+      // loop through the unique annotation package names
+      // and initialize a uniqe set of processor names
+      // (processors may register for more than one annotation pkg)
+      HashSet<String> activeProcessors = new HashSet<String>();
+      for(String pkg : annotationPackages)
+      {
+        if(_processorMap.containsKey(pkg))
+        {
+          activeProcessors.add(_processorMap.get(pkg));
+        }
+        else
+          System.out.println("WARNING: no processor for annotation package "+pkg);
+      }
+
+      // loop through the unique processor names
+      // and instantiate them
+      for(String procname : activeProcessors)
+      {
+        // reflectivly new up the processor
+        processors.add(instantiateProcessor(procname,p_atds,p_env));
+      }
+    }
+    else
+    {
+      // processor override provided - just new up this one
+      processors.add(instantiateProcessor(processorName,p_atds,p_env));
+    }
+
+    System.out.println("config="+configurl);
+		if(processors.contains(null))
+			System.out.println("ERROR: unable to instantiate and initialize processor(s)");
+		else
+    	System.out.println("num processor(s) initialized="+processors.size());
+    
+    // create a composite of processors to return
+    AnnotationProcessors util = new AnnotationProcessors();
+    return util.getCompositeAnnotationProcessor(processors);
+  }
+
+  private Collection<String> initSupportedOptions()
+  {
+    HashSet<String> supportedOpts = new HashSet<String>();
+    supportedOpts.add("-Aconfig");
+    supportedOpts.add("-Aprocessor");
+    return supportedOpts;
+  }
+
+  private void initProcessorMap(String configurl)
+  {
+
+    try
+    {
+      FileReader reader = new FileReader(configurl);
+      int c;
+      StringBuffer buff = new StringBuffer();
+      while( (c=reader.read()) != -1)
+      {
+        buff.append((char)c);
+      }
+      String[] values = buff.toString().split(System.getProperty("line.separator"));
+
+      _processorMap = new HashMap<String,String>();
+      for(int i=0; i<values.length; i++)
+      {
+        // if the line is commented out - skip it
+        if(values[i].startsWith("#"))
+           continue;
+        String[] val = values[i].split("=");
+        if(_processorMap.containsKey(val[0]))
+           System.out.println("WARNING: duplicate mappings for annotation package: "+val[0]);
+        _processorMap.put(val[0],val[1]);
+      }
+    }
+    catch(FileNotFoundException fnfe)
+    {
+      fnfe.printStackTrace();
+    }
+    catch(IOException ioe)
+    {
+      ioe.printStackTrace();
+    }
+  }
+
+  private AnnotationProcessor instantiateProcessor(String p_procname,
+                                                   Set<AnnotationTypeDeclaration> p_atds,
+                                                   AnnotationProcessorEnvironment p_env)
+  {
+    // instantiate the specified processors
+    try
+    {
+			System.out.println("INFO: ready to instantiate processor class: "+p_procname);
+			// FIX: in win32 a ClassNotFoundException would be thrown w/out a call to trim()
+      Class definition = Class.forName(p_procname.trim());
+      AbstractMantisProcessor proc = (AbstractMantisProcessor) definition.newInstance();
+			//System.out.println("INFO: successfully instantiated processor class: "+p_procname);
+			//System.out.println("INFO: ready to initialize processor class: "+p_procname);
+      proc.init(p_atds,p_env);
+			System.out.println("INFO: successfully instantiated and initialized processor class: "+p_procname);
+      return (AnnotationProcessor) proc;
+    }
+    catch(ClassNotFoundException cnfe)
+    {
+      cnfe.printStackTrace();
+      return null;
+    }
+    catch(InstantiationException ie)
+    {
+      ie.printStackTrace();
+      return null;
+    }
+    catch(IllegalAccessException iae)
+    {
+      iae.printStackTrace();
+      return null;
+    }
+  }
+ 
+}

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/MantisTask.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,173 @@
+package org.apache.beehive.test.tools.mantis;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.InputStream;
+import java.io.IOException;
+
+import org.apache.tools.ant.taskdefs.MatchingTask;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+
+import org.apache.beehive.test.tools.mantis.utils.StreamCapture;
+
+public class MantisTask extends MatchingTask
+{
+  private final String P = System.getProperty("file.separator");
+
+  // required attributes
+  private String _srcdir = null;
+  private String _srcgen = null;
+  private String _bingen = null;
+  private String _classpath = null;
+  private String _config = null;
+  private String _aptcommand = null;
+  // optional attributes
+  private boolean _compile = false;
+  private String _processor = null;
+  private int _timeout = 5000;
+  // use _srcgen if not provided
+  private String _logdir = null;
+
+  // setters for attributes
+  public void setSrcdir(String p_srcdir)
+  {
+    _srcdir = p_srcdir;
+    fileset.setDir(new File(_srcdir));
+  }
+
+  public void setSrcgen(String p_srcgen)
+  {
+    _srcgen = p_srcgen;
+  }
+
+  public void setBingen(String p_bingen)
+  {
+    _bingen = p_bingen;
+  }
+
+  public void setClasspath(String p_classpath)
+  {
+    _classpath = p_classpath;
+  }
+
+  public void setConfig(String p_config)
+  {
+    _config = p_config;
+  }
+
+  public void setAptcommand(String p_aptcommand)
+  {
+    _aptcommand = p_aptcommand;
+  }
+
+  public void setCompile(boolean p_compile)
+  {
+    _compile = p_compile;
+  }
+
+  public void setProcessor(String p_processor)
+  {
+    _processor = p_processor;
+  }
+
+  public void setLogdir(String p_logdir)
+  {
+    _logdir = p_logdir;
+  }
+
+  public void setTimeout(int p_timeout)
+  {
+    _timeout = p_timeout;
+  }
+
+  public void execute() throws BuildException
+  {
+    // create the file of all files to process
+    // this will allow processing on win32 given it's
+    // limitation on command-line length
+    File fSrcgen = new File(_srcgen);
+    fSrcgen.mkdirs();
+    DirectoryScanner scanner = getDirectoryScanner(new File(_srcdir));
+    String[] files = scanner.getIncludedFiles();
+    String filename = _srcgen+P+"files.txt";
+    try
+    {
+      FileWriter writer = new FileWriter(new File(filename));
+      for(int i=0; i<files.length; i++)
+      {
+        writer.write(_srcdir+P+files[i]);
+        if(i != files.length)
+          writer.write("\n");
+      }
+      writer.flush();
+      writer.close();
+    }
+    catch(IOException ioe)
+    {
+      ioe.printStackTrace();
+      System.out.println("ERROR: IOException caught trying to create file listing file");
+      return;
+    }
+
+    // create the command line to call
+    StringBuffer cmd = new StringBuffer();
+    cmd.append(_aptcommand+" ");
+    if(!_compile)
+      cmd.append(" -nocompile ");
+    cmd.append("-classpath "+_classpath+" ");
+    cmd.append("-s "+_srcgen+" ");
+    if(null != _bingen)
+      cmd.append("-d "+_bingen+" ");
+    // TODO: add task parameter to specify the factory for dev/debug purposes
+    cmd.append("-factory org.apache.beehive.test.tools.mantis.MantisFactory ");
+    cmd.append("-Aconfig="+_config+" ");
+    if(null != _processor)
+      cmd.append("-Aprocessor="+_processor+" ");
+    cmd.append("@"+filename+" ");
+
+    System.out.println("running command:\n"+cmd.toString());
+
+    // capture mantis stderr/stdout to log file
+    // while executing the command line apt call
+    try
+    {
+      Process p = Runtime.getRuntime().exec(cmd.toString());
+      logStreams(p);
+      System.out.println("RETURN: "+p.exitValue());
+    }
+    catch(IOException ioe)
+    {
+      ioe.printStackTrace();
+      System.out.println("ERROR: IOException during apt execution");
+    }
+    catch(InterruptedException ie)
+    {
+      ie.printStackTrace();
+      System.out.println("ERROR: InterruptedException during apt execution");
+    }
+  }
+
+  private void logStreams(Process p_proc) throws IOException,InterruptedException
+  {
+    // ensure log dir exists
+    if(null == _logdir)
+      _logdir = _srcgen;
+    else
+    {
+      File fLogdir = new File(_logdir);
+      fLogdir.mkdirs();
+    }
+
+    // capture stderr and stdout to log files
+    StreamCapture stderr = new StreamCapture(p_proc.getErrorStream(),"file", _logdir+P+"mantis.err");
+    StreamCapture stdout = new StreamCapture(p_proc.getInputStream(),"file", _logdir+P+"mantis.out");
+    stderr.start();
+    stdout.start();
+
+    // wait up to 5 seconds for proc to finish
+    stderr.join(_timeout);
+    stdout.join(_timeout);
+  }
+
+}

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/TchProcessor.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/TchProcessor.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,281 @@
+package org.apache.beehive.test.tools.mantis;
+
+// mirror apis
+import com.sun.mirror.apt.AnnotationProcessor;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.apt.Filer;
+import com.sun.mirror.declaration.PackageDeclaration;
+import com.sun.mirror.declaration.AnnotationTypeDeclaration;
+import com.sun.mirror.declaration.AnnotationTypeElementDeclaration;
+import com.sun.mirror.declaration.AnnotationValue;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.declaration.ClassDeclaration;
+import com.sun.mirror.declaration.MethodDeclaration;
+import com.sun.mirror.declaration.AnnotationMirror;
+
+// java utils
+import java.io.PrintWriter;
+import java.io.IOException;
+import java.io.File;
+import java.util.Map;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.ArrayList;
+
+// mantis annotations
+import org.apache.beehive.test.tools.mantis.annotations.tch.*;
+import org.apache.beehive.test.tools.mantis.utils.FileTypes;
+import org.apache.beehive.test.tools.mantis.utils.MantisFileInfo;
+
+// tch schema types
+import org.apache.xmlbeans.XmlAnySimpleType;
+import org.apache.xmlbeans.XmlAnySimpleType.Factory;
+import noNamespace.ProjectDocument.*;
+import noNamespace.*;
+
+public class TchProcessor extends AbstractMantisProcessor
+{
+  protected HashSet<PackageDeclaration> _pkgdecls;
+  private Filer _filer;
+
+  public void init(Set<AnnotationTypeDeclaration> p_atds,
+                   AnnotationProcessorEnvironment p_env)
+  {
+    super.init(p_atds,p_env);
+    this._pkgdecls = new HashSet();
+    this._filer = _env.getFiler();
+
+    // init the package list
+    Collection<TypeDeclaration> tdecls = 
+      _env.getSpecifiedTypeDeclarations();
+    for(TypeDeclaration tdecl : tdecls)
+    {
+      _pkgdecls.add(tdecl.getPackage());
+    }
+  }
+
+  public void process()
+  {
+    // creates an xml file for each package
+    for(PackageDeclaration pkg : _pkgdecls)
+    {
+      processPackage(pkg);
+    }
+
+    // create the root xml file
+    createRootTCH();
+
+    // print out some info about the files created during this process
+    System.out.println("created "+getFileInfo().size()+" files:");
+    for(MantisFileInfo mfi : getFileInfo())
+    {
+      System.out.println(mfi.getUrl());
+      System.out.println(mfi.getCreatingClassname());
+      if(mfi.getFileType() == FileTypes.AUX)
+        System.out.println("AUX");
+      else if(mfi.getFileType() == FileTypes.SRC)
+        System.out.println("SRC");
+      else if(mfi.getFileType() == FileTypes.BIN)
+        System.out.println("BIN");
+      System.out.println();
+    }
+
+  }
+
+  // process a package
+  private void processPackage(PackageDeclaration p_pkgdecl)
+  {
+    // get the suite name based on package name
+    // the . char is illegal for a test name in tch
+    String s_suiteName = p_pkgdecl.getQualifiedName().replace('.','-');
+
+    // create a new project document (one per package)
+    ProjectDocument pdoc = ProjectDocument.Factory.newInstance();
+    Project project = pdoc.addNewProject();
+    project.setName("tch");
+    project.setDefault(s_suiteName);
+
+    // create and init the test suite
+    TargetType target = project.addNewTarget();
+    target.setName(s_suiteName);
+    TestSuiteType suite = target.addNewTestSuite();
+
+    suite.setTestunit(s_suiteName);
+
+    // add the suite-level metadata
+    TestMetadataType sMeta = suite.addNewTestMetadata();
+    sMeta.setDescription("mantis-generated test suite file");
+    
+
+    // loop through the classes in this package allowing them to 
+    // add test cases to the test suite
+    Collection<ClassDeclaration> classdecls = p_pkgdecl.getClasses();
+    for(ClassDeclaration classdecl : classdecls )
+    {
+      processClass(classdecl, suite);
+    }
+
+    // create the tch xml file for this package
+    PrintWriter pw = null;
+    try
+    {
+      String filename = p_pkgdecl.getQualifiedName().replace('.','-')+".xml";
+      pw = _filer.createTextFile(Filer.Location.SOURCE_TREE,
+                                 "",
+                                 new File(filename),
+                                 null);
+      pw.print(pdoc.toString());
+      registerFile("file://"+_srctree+"/"+filename,
+                   this.getClass().getName(),
+                   FileTypes.AUX);
+    }
+    catch(IOException ioe)
+    {
+      ioe.printStackTrace();
+    }
+    finally
+    {
+      if(null != pw)
+      {
+        pw.flush();
+        pw.close();
+      }
+    }
+
+  }
+
+  private void processClass(ClassDeclaration p_cdecl, TestSuiteType p_suite)
+  {
+    // get the class-level annotation values
+    Freq cfreq = (Freq) p_cdecl.getAnnotation(Freq.class);
+    Status cstatus = (Status) p_cdecl.getAnnotation(Status.class);
+    Desc cdesc = (Desc) p_cdecl.getAnnotation(Desc.class);
+    Misc cmisc = (Misc) p_cdecl.getAnnotation(Misc.class);
+
+    // loop through the methods
+    Collection<? extends MethodDeclaration> methods = p_cdecl.getMethods();
+    Iterator mit = methods.iterator();
+    while(mit.hasNext())
+    {
+      MethodDeclaration methDecl = (MethodDeclaration) mit.next();
+      processMethod(methDecl, p_suite, cfreq, cstatus, cdesc, cmisc);
+    }
+
+  }
+
+  private void processMethod(MethodDeclaration p_methdecl, 
+                             TestSuiteType suite,
+                             Freq p_cfreq,
+                             Status p_cstatus,
+                             Desc p_cdesc,
+                             Misc p_cmisc)
+  {
+    // only process methods that start with 'test' (junit)
+    // TODO: may need to add more logic for different tch runners
+    if(! p_methdecl.getSimpleName().startsWith("test"))
+      return;
+
+    // add the test to the suite
+    TestType test = suite.addNewTest();
+    test.setName(p_methdecl.getDeclaringType().getSimpleName()+"-"+p_methdecl.getSimpleName());
+    JavatestType junit = test.addNewJunit();
+    junit.setTestclass(p_methdecl.getDeclaringType().getQualifiedName());
+    junit.setMethodnames(p_methdecl.getSimpleName());
+    
+    // get the annotaions on the methods
+    Freq mfreq = (Freq) p_methdecl.getAnnotation(Freq.class);
+    Status mstatus = (Status) p_methdecl.getAnnotation(Status.class);
+    Desc mdesc = (Desc) p_methdecl.getAnnotation(Desc.class);
+    Misc mmisc = (Misc) p_methdecl.getAnnotation(Misc.class);
+
+    // if not present on the method use the class-level value
+    if(null == mfreq) mfreq = p_cfreq;
+    if(null == mstatus) mstatus = p_cstatus;
+    if(null == mdesc) mdesc = p_cdesc;
+    if(null == mmisc) mmisc = p_cmisc;
+
+    // add metadata to the test
+    // leave out if null
+    TestMetadataType sMeta = test.addNewTestMetadata();
+    if(null != mfreq)
+    {
+      sMeta.setFreq(createStringArrayList(mfreq.value()));
+    }
+
+    if(null != mstatus)
+    {
+      sMeta.setStatus(createStringArrayList(mstatus.value()));
+    }
+
+    if(null != mdesc)
+      sMeta.setDescription(mdesc.value());
+
+    if(null != mmisc)
+      sMeta.setMisc(mmisc.value());
+  }
+
+  private void createRootTCH()
+  {
+    // create the root xmlbean
+    ProjectDocument pdoc = ProjectDocument.Factory.newInstance();
+    Project project = pdoc.addNewProject();
+    project.setName("tch");
+    project.setDefault("suite");
+
+    // create and init the test suite
+    TargetType target = project.addNewTarget();
+    target.setName("suite");
+    TestSuiteType suite = target.addNewTestSuite();
+    // the . char is illegal for a test name in tch
+    suite.setTestunit("root");
+
+    // add a call to each package's test suite
+    for(PackageDeclaration pkgdecl : _pkgdecls)
+    {
+      XmlAnySimpleType testfile = XmlAnySimpleType.Factory.newInstance();
+      testfile.setStringValue(pkgdecl.getQualifiedName().replace('.','-')+".xml");
+      TestSuiteCallType call = suite.addNewTestSuiteCall();
+      call.setTestfile(testfile);
+    }
+
+    // create the file on disk
+    PrintWriter pw = null;
+    try
+    {
+      String filename = "root.xml";
+      pw = _filer.createTextFile(Filer.Location.SOURCE_TREE,
+                                 "",
+                                 new File(filename),
+                                 null);
+      pw.print(pdoc.toString());
+      registerFile("file://"+_srctree+"/"+filename,
+                   this.getClass().getName(),
+                   FileTypes.AUX);
+    }
+    catch(IOException ioe)
+    {
+      ioe.printStackTrace();
+    }
+    finally
+    {
+      if(null != pw)
+      {
+        pw.flush();
+        pw.close();
+      }
+    }
+  }
+
+  private ArrayList<String> createStringArrayList(String p_input)
+  {
+    String[] values = p_input.split(" ");
+    ArrayList<String> result = new ArrayList<String>();
+    for(int i=0; i<values.length; i++)
+    {
+      result.add(values[i]);
+    }
+    return result;
+  }
+}

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Desc.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Desc.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,6 @@
+package org.apache.beehive.test.tools.mantis.annotations.tch;
+
+public @interface Desc
+{
+  String value();
+}

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Freq.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Freq.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,6 @@
+package org.apache.beehive.test.tools.mantis.annotations.tch;
+
+public @interface Freq
+{
+	String value() default "detailed"; 
+}

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Misc.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Misc.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,6 @@
+package org.apache.beehive.test.tools.mantis.annotations.tch;
+
+public @interface Misc
+{
+  String value();
+}

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Status.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/annotations/tch/Status.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,6 @@
+package org.apache.beehive.test.tools.mantis.annotations.tch;
+
+public @interface Status
+{
+  String value() default "active";
+}

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/test/CheckinTest.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/test/CheckinTest.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,35 @@
+package org.apache.beehive.test.tools.mantis.test;
+
+import junit.framework.TestCase;
+import org.apache.beehive.test.tools.mantis.annotations.tch.*;
+
+
+@Freq("checkin")
+@Status("active")
+@Desc("a class desc")
+@Misc("a class misc")
+public class CheckinTest extends TestCase
+{
+	public CheckinTest(String name) throws Exception
+	{
+		super(name);
+	}
+
+  @Freq("detailed")
+  @Status("inactive")
+  @Desc("a method desc")
+  @Misc("a method misc")
+	public void testPass() throws Exception
+	{
+	}
+
+ 	public void testFail() throws Exception
+	{
+    assertTrue(false);
+	}
+
+  public void notATest() throws Exception
+  {
+  }
+
+}

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/test/DetailedTest.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/test/DetailedTest.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,31 @@
+package org.apache.beehive.test.tools.mantis.test;
+
+import junit.framework.TestCase;
+import org.apache.beehive.test.tools.mantis.annotations.tch.*;
+
+
+public class DetailedTest extends TestCase
+{
+	public DetailedTest(String name) throws Exception
+	{
+		super(name);
+	}
+
+  @Freq("detailed")
+  @Status("active")
+  @Desc("a method desc")
+  @Misc("a method misc")
+	public void testPass() throws Exception
+	{
+	}
+
+ 	public void testFail() throws Exception
+	{
+		assertTrue(false);
+	}
+
+  public void notATest() throws Exception
+  {
+  }
+
+}

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/utils/FileTypes.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/utils/FileTypes.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,3 @@
+package org.apache.beehive.test.tools.mantis.utils;
+
+public enum FileTypes {SRC,BIN,AUX};

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/utils/MantisFileInfo.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/utils/MantisFileInfo.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,22 @@
+package org.apache.beehive.test.tools.mantis.utils;
+
+public class MantisFileInfo
+{
+  private final String _url;
+  private final String _creatingClassname;
+  private final FileTypes _type;
+
+  public MantisFileInfo(String url, 
+                        String classname, 
+                        FileTypes type)
+  {
+    this._url = url;
+    this._creatingClassname = classname;
+    this._type = type;
+  }
+
+  public String getUrl(){return _url;}
+  public String getCreatingClassname(){return _creatingClassname;}
+  public FileTypes getFileType(){return _type;}
+
+}

Added: incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/utils/StreamCapture.java
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/controls/test/tools/mantis/src/org/apache/beehive/test/tools/mantis/utils/StreamCapture.java	Fri Sep  3 10:04:35 2004
@@ -0,0 +1,100 @@
+package org.apache.beehive.test.tools.mantis.utils;
+
+import java.io.*;
+import java.lang.StringBuffer;
+
+/**
+ * A utility for reading from an InputStream
+ */
+public class StreamCapture extends Thread {
+    private InputStream is;
+    private String type;
+    private String filename;
+    private String bufferContents = "";   
+
+    /**
+     * 
+     * @param is InputStream to read from
+     * @param type An identifier for this stream capture (valid values: stderr, stdout)
+     */
+    public StreamCapture(InputStream is, String type)
+    {
+        this.is = is;
+        this.type = type;
+    }
+
+    /**
+     * 
+     * @param is InputStream to read from
+     * @param type An identifier for this stream capture (valid values: stderr, stdout, file)
+     * @param file If given, the data is saved to this file vs. an in-memory string.
+     */
+    public StreamCapture(InputStream is, String type, String file)
+    {
+        this.is = is;
+        this.type = type;
+        this.filename = file;
+    }
+
+
+    /**
+     * @return The buffer contents as a string
+     */
+    public String getString()
+    {
+        return bufferContents;
+    }
+
+
+    /**
+     * Read the InputStream supplied and put into 
+     * a string which is accessed via getString() or 
+     * a file is type==file and a filename is given.
+     */
+    public void run()
+    {
+        // if type == "file" save the contents to a file
+        if(type.equalsIgnoreCase("file"))
+        {
+          try
+          {
+            InputStreamReader isr = new InputStreamReader(is);
+            BufferedReader br = new BufferedReader(isr);
+            String line = null;
+            FileWriter fw = new FileWriter(filename);
+            BufferedWriter bw = new BufferedWriter(fw);
+            while( (line = br.readLine()) != null )
+            {
+              bw.write(line);
+              bw.newLine();
+              bw.flush();
+            }
+            bw.flush();
+            bw.close();            
+          }
+          catch (IOException ioe)
+          {
+              ioe.printStackTrace();
+          }          
+        }
+        else
+        {        
+          try
+          {
+              InputStreamReader isr = new InputStreamReader(is);
+              BufferedReader br = new BufferedReader(isr);
+              StringBuffer sb = new StringBuffer();         
+              String line = null;
+              while ((line = br.readLine()) != null)
+              {
+                  sb.append(line);
+              }
+              bufferContents = sb.toString();
+          }
+          catch (IOException ioe)
+          {
+              ioe.printStackTrace();
+          }
+        }  
+    }
+}

Modified: incubator/beehive/trunk/controls/test/tools/tch/build.xml
==============================================================================
--- incubator/beehive/trunk/controls/test/tools/tch/build.xml	(original)
+++ incubator/beehive/trunk/controls/test/tools/tch/build.xml	Fri Sep  3 10:04:35 2004
@@ -50,6 +50,7 @@
     >
         <classpath>
             <pathelement path="${os.CLASSPATH}"/>
+            <pathelement path="${xbean.jar}"/>
             <pathelement location="${schema.jar.file}"/>
         </classpath>
     </javac>

Mime
View raw message