beehive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mm...@apache.org
Subject svn commit: rev 43494 - incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/processor/apt
Date Wed, 08 Sep 2004 03:38:55 GMT
Author: mmerz
Date: Tue Sep  7 20:38:54 2004
New Revision: 43494

Modified:
   incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/processor/apt/WsmAnnotationProcessorTest.java
Log:


Modified: incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/processor/apt/WsmAnnotationProcessorTest.java
==============================================================================
--- incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/processor/apt/WsmAnnotationProcessorTest.java
(original)
+++ incubator/beehive/trunk/wsm/drt/tests/org/apache/beehive/wsm/jsr181/processor/apt/WsmAnnotationProcessorTest.java
Tue Sep  7 20:38:54 2004
@@ -37,11 +37,6 @@
 
     private static final String CLASSNAME = "Foo";
     private static final String SRCFILENAME = "Foo.java";
-    private static final String BEEHIVE_HOME = System.getenv( "BEEHIVE_HOME" );
-    private static final String TESTDIR = BEEHIVE_HOME + "/wsm/drt/tests/";
-    private static final String CLASSTESTDIR = BEEHIVE_HOME + "/wsm/drt/build/classes/tests/";
-    private static final String WSMJAR = BEEHIVE_HOME + "/wsm/build/jars/wsm.jar";
-    private static final String TOOLSJAR = "D:\\tmp\\tools.jar";
     
     private Main apt;
 
@@ -57,22 +52,31 @@
     
     public void testAnnotationProcessor() throws Exception
     {
+        // get project root from environment
+        String BEEHIVE_HOME;
+        if (null == (BEEHIVE_HOME = System.getenv("BEEHIVE_HOME")))
+        {
+            throw new Exception("BEEHIVE_HOME not set properly");
+        }
+
+        // initialize "command line args"
         String[] _args = {
-            "-classpath", TOOLSJAR + ";" + WSMJAR,
             "-factory", "org.apache.beehive.wsm.jsr181.processor.apt.WsmAnnotationProcessorFactory",
-            new java.io.File(TESTDIR, SRCFILENAME).getCanonicalPath()
+            new java.io.File(
+                new java.io.File(BEEHIVE_HOME, "/wsm/drt/tests/"),
+                SRCFILENAME).getCanonicalPath()
         };
 
         // compile source file
         int status = apt.compile(_args);
         if (0 != status)
         {
-            throw new Exception("** Error compiling: " + SRCFILENAME);
+            throw new Exception("error compiling: " + SRCFILENAME);
         }
 
-        // get object model
+        // check if we have an object model
         AnnotationModel objectModel =
             WsmAnnotationProcessor.getObjectModel(CLASSNAME);
-        assertNotNull(objectModel);
+        assertNotNull("object model could not be read", objectModel);
     }
 }

Mime
View raw message