You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by mb...@apache.org on 2006/12/19 18:32:30 UTC

svn commit: r488733 - in /incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm: ./ utils/

Author: mbaessler
Date: Tue Dec 19 09:32:29 2006
New Revision: 488733

URL: http://svn.apache.org/viewvc?view=rev&rev=488733
Log:
JIRA ticket UIMA-45 (https://issues.apache.org/jira/browse/UIMA-45)

rewrite JUnitExtension.getFile() method to load files using the classloader.

When changing this method I also deleted the TestPropertyReader class which is now never used.

With these two changes above, there where lots of tests that must also be changed and adapted
to the new methods.

Modified:
    incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeDescriptorSerialization_Test.java
    incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmAE_ErrorTests.java
    incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCasConsumer_ErrorTests.java
    incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCollectionReader_ErrorTests.java
    incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmInitTest.java
    incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmProcessingTest.java
    incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmStopTest.java
    incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/DescriptorMakeUtil.java

Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeDescriptorSerialization_Test.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeDescriptorSerialization_Test.java?view=diff&rev=488733&r1=488732&r2=488733
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeDescriptorSerialization_Test.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpeDescriptorSerialization_Test.java Tue Dec 19 09:32:29 2006
@@ -23,7 +23,6 @@
 import java.io.File;
 import java.io.FileOutputStream;
 
-import junit.framework.Assert;
 import junit.framework.TestCase;
 
 import org.apache.uima.UIMAFramework;
@@ -39,8 +38,7 @@
 import org.apache.uima.collection.metadata.CpeDescription;
 import org.apache.uima.collection.metadata.CpeIntegratedCasProcessor;
 import org.apache.uima.collection.metadata.CpeLocalCasProcessor;
-import org.apache.uima.test.junit_extension.FileCompare;
-import org.apache.uima.test.junit_extension.TestPropertyReader;
+import org.apache.uima.test.junit_extension.JUnitExtension;
 import org.apache.uima.util.XMLInputSource;
 
 /**
@@ -51,7 +49,7 @@
  */
 public class CpeDescriptorSerialization_Test extends TestCase {
 
-  private static String junitTestBasePath;
+  private File testBaseDir;
 
   private CpeDescription cpeDesc = null;
 
@@ -60,7 +58,7 @@
    */
   protected void setUp() throws Exception {
     // get test base path setting
-    junitTestBasePath = TestPropertyReader.getJUnitTestBasePath();
+    this.testBaseDir = JUnitExtension.getFile("CpmTests/CpeAPITest");
   }
 
   /**
@@ -72,12 +70,12 @@
   public void testReadDescriptor() throws Exception {
 
     // input file
-    String cpeDescFileName = junitTestBasePath + "CpmTests/CpeAPITest/refConf.xml";
-    XMLInputSource in = new XMLInputSource(cpeDescFileName);
+    File cpeDescFile = JUnitExtension.getFile("CpmTests/CpeAPITest/refConf.xml");
+    XMLInputSource in = new XMLInputSource(cpeDescFile);
     cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(in);
 
     // output file
-    File outputFile = new File(junitTestBasePath, "CpmTests/CpeAPITest/outConf.xml");
+    File outputFile = new File(this.testBaseDir, "outConf.xml");
 
     // serialize input file to output file
     ByteArrayOutputStream outStream = new ByteArrayOutputStream();
@@ -87,7 +85,7 @@
     fOut.close();
 
     // compare input and output
-    equal(cpeDescFileName, cpeDesc);
+    equal(cpeDescFile, cpeDesc);
 
     outputFile.delete();
   }
@@ -101,12 +99,12 @@
   public void testReadDescriptor2() throws Exception {
 
     // input file
-    String cpeDescFileName = junitTestBasePath + "CpmTests/CpeAPITest/refConf2.xml";
-    XMLInputSource in = new XMLInputSource(cpeDescFileName);
+    File cpeDescFile = JUnitExtension.getFile("CpmTests/CpeAPITest/refConf2.xml");
+    XMLInputSource in = new XMLInputSource(cpeDescFile);
     cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(in);
 
     // output file
-    File outputFile = new File(junitTestBasePath, "CpmTests/CpeAPITest/outConf2.xml");
+    File outputFile = new File(this.testBaseDir, "outConf2.xml");
 
     // serialize input file to output file
     ByteArrayOutputStream outStream = new ByteArrayOutputStream();
@@ -115,7 +113,7 @@
     fOut.write(outStream.toByteArray());
     fOut.close();
 
-    equal(cpeDescFileName, cpeDesc);
+    equal(cpeDescFile, cpeDesc);
 
     outputFile.delete();
   }
@@ -130,13 +128,12 @@
   public void testAddRemoteCasProcessor() throws Exception {
 
     // parse cpe descriptor file
-    File cpeDescFile = new File(junitTestBasePath, "CpmTests/CpeAPITest/refConf3.xml");
+    File cpeDescFile = JUnitExtension.getFile("CpmTests/CpeAPITest/refConf3.xml");
     XMLInputSource in = new XMLInputSource(cpeDescFile);
     cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(in);
 
     // init files
-    File outputFile = new File(junitTestBasePath, "CpmTests/CpeAPITest/remoteTestOut.xml");
-    String refFile = junitTestBasePath + "CpmTests/CpeAPITest/testRemoteDesc.xml";
+    File refFile = JUnitExtension.getFile("CpmTests/CpeAPITest/testRemoteDesc.xml");
 
     // generate a new casProcessor
     CpeCasProcessor casProcessor = CpeDescriptorFactory
@@ -167,13 +164,12 @@
   public void testAddLocalCasProcessor() throws Exception {
 
     // parse cpe descriptor file
-    File cpeDescFile = new File(junitTestBasePath, "CpmTests/CpeAPITest/refConf3.xml");
+    File cpeDescFile = JUnitExtension.getFile("CpmTests/CpeAPITest/refConf3.xml");
     XMLInputSource in = new XMLInputSource(cpeDescFile);
     cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(in);
 
     // output file
-    File outputFile = new File(junitTestBasePath, "CpmTests/CpeAPITest/localTestOut.xml");
-    String refFile = junitTestBasePath + "CpmTests/CpeAPITest/testLocalDesc.xml";
+    File refFile = JUnitExtension.getFile("CpmTests/CpeAPITest/testLocalDesc.xml");
 
     // Create Detag CasProcessor
     CpeLocalCasProcessor localProcessor = CpeDescriptorFactory.produceLocalCasProcessor(
@@ -202,12 +198,12 @@
   public void testAddIntegratedCasProcessor() throws Exception {
 
     // parse cpe descriptor file
-    File cpeDescFile = new File(junitTestBasePath, "CpmTests/CpeAPITest/refConf3.xml");
+    File cpeDescFile = JUnitExtension.getFile("CpmTests/CpeAPITest/refConf3.xml");
     XMLInputSource in = new XMLInputSource(cpeDescFile);
     cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(in);
 
     // output file
-    String refFile = junitTestBasePath + "CpmTests/CpeAPITest/testIntegratedDesc.xml";
+    File refFile = JUnitExtension.getFile("CpmTests/CpeAPITest/testIntegratedDesc.xml");
 
     // add a new iCpe
     CpeIntegratedCasProcessor integratedProcessor = CpeDescriptorFactory
@@ -228,10 +224,10 @@
 
   }
 
-  public void equal(String aReferenceDescriptorFilePath, CpeDescription aGeneratedDescriptor) {
+  public void equal(File aReferenceDescriptorFile, CpeDescription aGeneratedDescriptor) {
     try {
-      File cpeRefDescFile = new File(aReferenceDescriptorFilePath);
-      XMLInputSource in = new XMLInputSource(cpeRefDescFile);
+      
+      XMLInputSource in = new XMLInputSource(aReferenceDescriptorFile);
       CpeDescription referenceDesc = UIMAFramework.getXMLParser().parseCpeDescription(in);
 
       // First Check Collection Reader

Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmAE_ErrorTests.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmAE_ErrorTests.java?view=diff&rev=488733&r1=488732&r2=488733
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmAE_ErrorTests.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmAE_ErrorTests.java Tue Dec 19 09:32:29 2006
@@ -22,6 +22,7 @@
 import junit.framework.TestCase;
 
 import org.apache.uima.UIMAFramework;
+import org.apache.uima.analysis_engine.annotator.JTextAnnotator;
 import org.apache.uima.collection.CollectionProcessingEngine;
 import org.apache.uima.collection.impl.cpm.utils.DescriptorMakeUtil;
 import org.apache.uima.collection.impl.cpm.utils.FunctionErrorStore;
@@ -29,8 +30,8 @@
 import org.apache.uima.collection.impl.metadata.cpe.CpeDescriptorFactory;
 import org.apache.uima.collection.metadata.CpeDescription;
 import org.apache.uima.collection.metadata.CpeIntegratedCasProcessor;
+import org.apache.uima.test.junit_extension.JUnitExtension;
 import org.apache.uima.test.junit_extension.ManageOutputDevice;
-import org.apache.uima.test.junit_extension.TestPropertyReader;
 
 /**
  * The TestCase aims to test the behaviour of the cpm faced with different error scenarios<br>
@@ -72,21 +73,11 @@
 
   private static final String FS = System.getProperties().getProperty("file.separator");
 
-  private String junitTestBasePath;
-
   public CpmAE_ErrorTests() {
     System.gc();
   }
 
   /**
-   * @see junit.framework.TestCase#setUp()
-   */
-  protected void setUp() throws Exception {
-    // get test base path setting
-    junitTestBasePath = TestPropertyReader.getJUnitTestBasePath();
-  }
-
-  /**
    * <b>testcase:</b> the process method throws multiple AnnotatorProcessException.<br>
    * <b>expected behaviour:</b><br>
    * the cpm should regular finish after processing all documents. No error and no abort should
@@ -836,9 +827,12 @@
     CollectionProcessingEngine cpe = null;
 
     try {
-      String colReaderBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestCollectionReader.xml";
-      String taeBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestAnnotator.xml";
-      String casConsumerBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestCasConsumer.xml";
+      String colReaderBase = JUnitExtension.getFile(
+              "CpmTests" + FS + "ErrorTestCollectionReader.xml").getAbsolutePath();
+      String taeBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestAnnotator.xml")
+              .getAbsolutePath();
+      String casConsumerBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCasConsumer.xml")
+              .getAbsolutePath();
 
       // first, prepare all descriptors as needed
       String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);
@@ -910,9 +904,12 @@
     CpeDescription cpeDesc = null;
     CpeIntegratedCasProcessor integratedProcessor = null;
     try {
-      String colReaderBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestCollectionReader.xml";
-      String taeBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestAnnotator.xml";
-      String casConsumerBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestCasConsumer.xml";
+      String colReaderBase = JUnitExtension.getFile(
+              "CpmTests" + FS + "ErrorTestCollectionReader.xml").getAbsolutePath();
+      String taeBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestAnnotator.xml")
+              .getAbsolutePath();
+      String casConsumerBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCasConsumer.xml")
+              .getAbsolutePath();
 
       // first, prepare all descriptors as needed
       String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);
@@ -963,7 +960,7 @@
     public void aborted() {
       super.aborted();
       System.out.println("abort was called.");
-      cpe.stop();
+      this.cpe.stop();
     }
   }
 }

Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCasConsumer_ErrorTests.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCasConsumer_ErrorTests.java?view=diff&rev=488733&r1=488732&r2=488733
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCasConsumer_ErrorTests.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCasConsumer_ErrorTests.java Tue Dec 19 09:32:29 2006
@@ -33,8 +33,8 @@
 import org.apache.uima.collection.impl.metadata.cpe.CpeDescriptorFactory;
 import org.apache.uima.collection.metadata.CpeDescription;
 import org.apache.uima.collection.metadata.CpeIntegratedCasProcessor;
+import org.apache.uima.test.junit_extension.JUnitExtension;
 import org.apache.uima.test.junit_extension.ManageOutputDevice;
-import org.apache.uima.test.junit_extension.TestPropertyReader;
 
 /**
  * Test CasConsumer Error Handling<br>
@@ -69,16 +69,6 @@
 
   private static final String FS = System.getProperties().getProperty("file.separator");
 
-  private String junitTestBasePath;
-
-  /**
-   * @see junit.framework.TestCase#setUp()
-   */
-  protected void setUp() throws Exception {
-    // get test base path setting
-    junitTestBasePath = TestPropertyReader.getJUnitTestBasePath();
-  }
-
   /**
    * <b>testcase:</b> the initialize method throws a ResourceInitializationException.<br>
    * <b>expected behaviour:</b><br>
@@ -375,9 +365,9 @@
     CollectionProcessingEngine cpe = null;
 
     try {
-      String colReaderBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestCollectionReader.xml";
-      String taeBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestAnnotator.xml";
-      String casConsumerBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestCasConsumer.xml";
+      String colReaderBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCollectionReader.xml").getAbsolutePath();
+      String taeBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestAnnotator.xml").getAbsolutePath();
+      String casConsumerBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCasConsumer.xml").getAbsolutePath();
 
       // first, prepare all descriptors as needed
       String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);
@@ -459,8 +449,8 @@
         while (iter.hasNext()) {
           // if there is an error ... call the cpm to kill and check for a null CAS
           if (iter.next() instanceof java.lang.Error) {
-            cpe.kill();
-            errorThrown = true;
+            this.cpe.kill();
+            this.errorThrown = true;
             assertEquals("The cas is not null, as expected.", null, aCas);
           }
         }
@@ -468,7 +458,7 @@
     }
 
     public boolean hasError() {
-      return errorThrown;
+      return this.errorThrown;
     }
   }
 }

Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCollectionReader_ErrorTests.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCollectionReader_ErrorTests.java?view=diff&rev=488733&r1=488732&r2=488733
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCollectionReader_ErrorTests.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmCollectionReader_ErrorTests.java Tue Dec 19 09:32:29 2006
@@ -35,8 +35,8 @@
 import org.apache.uima.collection.metadata.CpeDescription;
 import org.apache.uima.collection.metadata.CpeIntegratedCasProcessor;
 import org.apache.uima.resource.ResourceInitializationException;
+import org.apache.uima.test.junit_extension.JUnitExtension;
 import org.apache.uima.test.junit_extension.ManageOutputDevice;
-import org.apache.uima.test.junit_extension.TestPropertyReader;
 
 /**
  * Test CollectionReader Error Handling<br>
@@ -67,16 +67,6 @@
 
   private static final String FS = System.getProperties().getProperty("file.separator");
 
-  private String junitTestBasePath;
-
-  /**
-   * @see junit.framework.TestCase#setUp()
-   */
-  protected void setUp() throws Exception {
-    // get test base path setting
-    junitTestBasePath = TestPropertyReader.getJUnitTestBasePath();
-  }
-
   /**
    * <b>testcase:</b> the getNext method throws an OutOfMemoryError.<br>
    * <b>expected behaviour:</b><br>
@@ -672,9 +662,9 @@
     CollectionProcessingEngine cpe = null;
 
     try {
-      String colReaderBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestCollectionReader.xml";
-      String taeBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestAnnotator.xml";
-      String casConsumerBase = junitTestBasePath + "CpmTests" + FS + "ErrorTestCasConsumer.xml";
+      String colReaderBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCollectionReader.xml").getAbsolutePath();
+      String taeBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestAnnotator.xml").getAbsolutePath();
+      String casConsumerBase = JUnitExtension.getFile("CpmTests" + FS + "ErrorTestCasConsumer.xml").getAbsolutePath();
 
       // first, prepare all descriptors as needed
       String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, true,
@@ -724,7 +714,7 @@
     public void aborted() {
       super.aborted();
       // System.out.println("abort was called.");
-      cpe.stop();
+      this.cpe.stop();
     }
 
     /**
@@ -741,8 +731,8 @@
         while (iter.hasNext()) {
           // if there is an error ... call the cpm to kill and check for a null CAS
           if (iter.next() instanceof java.lang.Error) {
-            cpe.kill();
-            errorThrown = true;
+            this.cpe.kill();
+            this.errorThrown = true;
             assertEquals("The cas is not null, as expected.", null, aCas);
           }
         }
@@ -750,7 +740,7 @@
     }
 
     public boolean hasError() {
-      return errorThrown;
+      return this.errorThrown;
     }
   }
 }

Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmInitTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmInitTest.java?view=diff&rev=488733&r1=488732&r2=488733
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmInitTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmInitTest.java Tue Dec 19 09:32:29 2006
@@ -29,21 +29,11 @@
 import org.apache.uima.collection.impl.metadata.cpe.CpeDescriptorFactory;
 import org.apache.uima.collection.metadata.CpeDescription;
 import org.apache.uima.collection.metadata.CpeIntegratedCasProcessor;
-import org.apache.uima.test.junit_extension.TestPropertyReader;
+import org.apache.uima.test.junit_extension.JUnitExtension;
 
 public class CpmInitTest extends TestCase {
   private static final String separator = System.getProperties().getProperty("file.separator");
 
-  private static String junitTestBasePath;
-
-  /**
-   * @see junit.framework.TestCase#setUp()
-   */
-  protected void setUp() throws Exception {
-    // get test base path setting
-    junitTestBasePath = TestPropertyReader.getJUnitTestBasePath();
-  }
-
   /**
    * @see junit.framework.TestCase#tearDown()
    */
@@ -162,11 +152,11 @@
     CollectionProcessingEngine cpe = null;
 
     try {
-      String colReaderBase = junitTestBasePath + "CpmTests" + separator
-              + "ErrorTestCollectionReader.xml";
-      String taeBase = junitTestBasePath + "CpmTests" + separator + "ErrorTestAnnotator.xml";
-      String casConsumerBase = junitTestBasePath + "CpmTests" + separator
-              + "ErrorTestCasConsumer.xml";
+      String colReaderBase = JUnitExtension.getFile("CpmTests" + separator
+              + "ErrorTestCollectionReader.xml").getAbsolutePath();
+      String taeBase = JUnitExtension.getFile("CpmTests" + separator + "ErrorTestAnnotator.xml").getAbsolutePath();
+      String casConsumerBase = JUnitExtension.getFile("CpmTests" + separator
+              + "ErrorTestCasConsumer.xml").getAbsolutePath();
 
       // created needed descriptors
       String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);
@@ -193,8 +183,8 @@
       if (useSlowAnnotator) {
         CpeIntegratedCasProcessor slowProcessor = CpeDescriptorFactory
                 .produceCasProcessor("SlowAnnotator");
-        slowProcessor.setDescriptor(junitTestBasePath + "CpmTests" + separator
-                + "SlowAnnotator.xml");
+        slowProcessor.setDescriptor(JUnitExtension.getFile("CpmTests" + separator
+                + "SlowAnnotator.xml").getAbsolutePath());
         cpeDesc.addCasProcessor(slowProcessor);
       }
 

Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmProcessingTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmProcessingTest.java?view=diff&rev=488733&r1=488732&r2=488733
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmProcessingTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmProcessingTest.java Tue Dec 19 09:32:29 2006
@@ -30,7 +30,7 @@
 import org.apache.uima.collection.impl.metadata.cpe.CpeDescriptorFactory;
 import org.apache.uima.collection.metadata.CpeDescription;
 import org.apache.uima.collection.metadata.CpeIntegratedCasProcessor;
-import org.apache.uima.test.junit_extension.TestPropertyReader;
+import org.apache.uima.test.junit_extension.JUnitExtension;
 
 /**
  * This test aimes to check if the cpm implements the ProcessingUnitThreadCount in the correct
@@ -41,14 +41,10 @@
 public class CpmProcessingTest extends TestCase {
   private static final String separator = System.getProperties().getProperty("file.separator");
 
-  private static String junitTestBasePath;
-
   /**
    * @see junit.framework.TestCase#setUp()
    */
   protected void setUp() throws Exception {
-    // get test base path setting
-    junitTestBasePath = TestPropertyReader.getJUnitTestBasePath();
     // disable schema validation -- this test uses descriptors
     // that don't validate, for some reason
     UIMAFramework.getXMLParser().enableSchemaValidation(false);
@@ -226,11 +222,11 @@
     CollectionProcessingEngine cpe = null;
 
     try {
-      String colReaderBase = junitTestBasePath + "CpmTests" + separator
-              + "ErrorTestCollectionReader.xml";
-      String taeBase = junitTestBasePath + "CpmTests" + separator + "ErrorTestAnnotator.xml";
-      String casConsumerBase = junitTestBasePath + "CpmTests" + separator
-              + "ErrorTestCasConsumer.xml";
+      String colReaderBase = JUnitExtension.getFile("CpmTests" + separator
+              + "ErrorTestCollectionReader.xml").getAbsolutePath();
+      String taeBase = JUnitExtension.getFile("CpmTests" + separator + "ErrorTestAnnotator.xml").getAbsolutePath();
+      String casConsumerBase = JUnitExtension.getFile("CpmTests" + separator
+              + "ErrorTestCasConsumer.xml").getAbsolutePath();
 
       // created needed descriptors
       String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);

Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmStopTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmStopTest.java?view=diff&rev=488733&r1=488732&r2=488733
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmStopTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/CpmStopTest.java Tue Dec 19 09:32:29 2006
@@ -29,21 +29,11 @@
 import org.apache.uima.collection.impl.metadata.cpe.CpeDescriptorFactory;
 import org.apache.uima.collection.metadata.CpeDescription;
 import org.apache.uima.collection.metadata.CpeIntegratedCasProcessor;
-import org.apache.uima.test.junit_extension.TestPropertyReader;
+import org.apache.uima.test.junit_extension.JUnitExtension;
 
 public class CpmStopTest extends TestCase {
   private static final String separator = System.getProperties().getProperty("file.separator");
 
-  private static String junitTestBasePath;
-
-  /**
-   * @see junit.framework.TestCase#setUp()
-   */
-  protected void setUp() throws Exception {
-    // get test base path setting
-    junitTestBasePath = TestPropertyReader.getJUnitTestBasePath();
-  }
-
   /**
    * @see junit.framework.TestCase#tearDown()
    */
@@ -168,11 +158,11 @@
     CpeDescription cpeDesc = null;
     CollectionProcessingEngine cpe = null;
 
-    String colReaderBase = junitTestBasePath + "CpmTests" + separator
-            + "ErrorTestCollectionReader.xml";
-    String taeBase = junitTestBasePath + "CpmTests" + separator + "ErrorTestAnnotator.xml";
-    String casConsumerBase = junitTestBasePath + "CpmTests" + separator
-            + "ErrorTestCasConsumer.xml";
+    String colReaderBase = JUnitExtension.getFile("CpmTests" + separator
+            + "ErrorTestCollectionReader.xml").getAbsolutePath();
+    String taeBase = JUnitExtension.getFile("CpmTests" + separator + "ErrorTestAnnotator.xml").getAbsolutePath();
+    String casConsumerBase = JUnitExtension.getFile("CpmTests" + separator
+            + "ErrorTestCasConsumer.xml").getAbsolutePath();
 
     // created needed descriptors
     String colReaderDesc = DescriptorMakeUtil.makeCollectionReader(colReaderBase, documentCount);
@@ -195,7 +185,7 @@
     if (useSlowAnnotator) {
       CpeIntegratedCasProcessor slowProcessor = CpeDescriptorFactory
               .produceCasProcessor("SlowAnnotator");
-      slowProcessor.setDescriptor(junitTestBasePath + "CpmTests" + separator + "SlowAnnotator.xml");
+      slowProcessor.setDescriptor(JUnitExtension.getFile("CpmTests" + separator + "SlowAnnotator.xml").getAbsolutePath());
       cpeDesc.addCasProcessor(slowProcessor);
     }
 

Modified: incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/DescriptorMakeUtil.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/DescriptorMakeUtil.java?view=diff&rev=488733&r1=488732&r2=488733
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/DescriptorMakeUtil.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-cpe/src/test/java/org/apache/uima/collection/impl/cpm/utils/DescriptorMakeUtil.java Tue Dec 19 09:32:29 2006
@@ -28,7 +28,7 @@
 import org.apache.uima.collection.CasConsumerDescription;
 import org.apache.uima.collection.CollectionReaderDescription;
 import org.apache.uima.resource.ResourceCreationSpecifier;
-import org.apache.uima.test.junit_extension.TestPropertyReader;
+import org.apache.uima.test.junit_extension.JUnitExtension;
 import org.apache.uima.util.XMLInputSource;
 
 /**
@@ -37,8 +37,6 @@
 public class DescriptorMakeUtil {
   private static final String FS = System.getProperties().getProperty("file.separator");
 
-  private static final String junitTestBasePath = TestPropertyReader.getJUnitTestBasePath();
-
   public static String makeAnalysisEngine(String descFileName) throws Exception {
 
     return makeAnalysisEngine(descFileName, false, null, 0, null);
@@ -58,7 +56,7 @@
       aed.getMetaData().getConfigurationParameterSettings().setParameterValue(functionName,
               "Exception", exceptionName);
     }
-    File baseDir = new File(junitTestBasePath, "CpmTests" + FS + "CpeDesc");
+    File baseDir = JUnitExtension.getFile("CpmTests" + FS + "CpeDesc");
 
     if (!baseDir.exists()) {
       baseDir.mkdir();
@@ -92,7 +90,7 @@
       ccd.getCasConsumerMetaData().getConfigurationParameterSettings().setParameterValue(
               "ErrorException", exceptionName);
     }
-    File baseDir = new File(junitTestBasePath, "CpmTests" + FS + "CpeDesc");
+    File baseDir = JUnitExtension.getFile("CpmTests" + FS + "CpeDesc");
 
     if (!baseDir.exists()) {
       baseDir.mkdir();
@@ -130,7 +128,7 @@
       crd.getCollectionReaderMetaData().getConfigurationParameterSettings().setParameterValue(
               "ErrorException", exceptionName);
     }
-    File baseDir = new File(junitTestBasePath, "CpmTests" + FS + "CpeDesc");
+    File baseDir = JUnitExtension.getFile("CpmTests" + FS + "CpeDesc");
 
     if (!baseDir.exists()) {
       baseDir.mkdir();