diff --git a/uimaj-component-test-util/pom.xml b/uimaj-component-test-util/pom.xml index 5af7e46e1..f9abd90b8 100644 --- a/uimaj-component-test-util/pom.xml +++ b/uimaj-component-test-util/pom.xml @@ -28,8 +28,8 @@ uimaj-component-test-util - jar - Apache UIMA Base: ${project.artifactId}: for JUnit + + Apache UIMA Base: ${project.artifactId}: for JUnit (deprecated) Supporting utilities used in various JUnit tests ${uimaWebsiteUrl} diff --git a/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotationWriter.java b/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotationWriter.java index 97a67f282..d2f371cd9 100644 --- a/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotationWriter.java +++ b/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotationWriter.java @@ -46,8 +46,11 @@ /** * The AnnotationWriter class writes specified annotations to an output file. The encoding of the * output file is UTF-8 + * + * @deprecated To be removed without replacement. + * @forRemoval 4.0.0 */ - +@Deprecated public class AnnotationWriter extends CasConsumer_ImplBase implements CasConsumer { /** The out file. */ @@ -89,10 +92,11 @@ public void initialize() throws ResourceInitializationException { // If specified output directory does not exist, try to create it this.outFile = new File(oPath); if (this.outFile.getParentFile() != null && !this.outFile.getParentFile().exists()) { - if (!this.outFile.getParentFile().mkdirs()) + if (!this.outFile.getParentFile().mkdirs()) { throw new ResourceInitializationException( ResourceInitializationException.RESOURCE_DATA_NOT_VALID, new Object[] { oPath, "outputFile" }); + } } try { this.fileWriter = new OutputStreamWriter(new FileOutputStream(this.outFile, false), @@ -105,8 +109,9 @@ public void initialize() throws ResourceInitializationException { // extract annotation types this.tofs = (String[]) getUimaContext().getConfigParameterValue("AnnotationTypes"); // sort array - if (this.tofs != null) + if (this.tofs != null) { Arrays.sort(this.tofs); + } } @@ -328,15 +333,17 @@ public void reconfigure() throws ResourceConfigurationException { if (!oFile.equals(this.outFile)) { this.outFile = oFile; try { - if (this.fileWriter != null) + if (this.fileWriter != null) { this.fileWriter.close(); + } // If specified output directory does not exist, try to create it if (oFile.getParentFile() != null && !oFile.getParentFile().exists()) { - if (!oFile.getParentFile().mkdirs()) + if (!oFile.getParentFile().mkdirs()) { throw new ResourceConfigurationException( ResourceInitializationException.RESOURCE_DATA_NOT_VALID, new Object[] { oPath, "outputFile" }); + } } // write result specification to the output file this.fileWriter = new OutputStreamWriter(new FileOutputStream(oFile, false), @@ -349,8 +356,9 @@ public void reconfigure() throws ResourceConfigurationException { // extract annotation types this.tofs = (String[]) getUimaContext().getConfigParameterValue("AnnotationTypes"); // sort array - if (this.tofs != null) + if (this.tofs != null) { Arrays.sort(this.tofs); + } } diff --git a/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorPerformanceTester.java b/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorPerformanceTester.java index f79c7fc0d..9136a8544 100644 --- a/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorPerformanceTester.java +++ b/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorPerformanceTester.java @@ -40,7 +40,10 @@ * AnnotatorPerfTester is a helper class to execute annotator performance tests. The performance * test results are returned as {@link PerformanceTestResultImpl} object. * + * @deprecated To be removed without replacement. + * @forRemoval 4.0.0 */ +@Deprecated public class AnnotatorPerformanceTester { /** diff --git a/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorTester.java b/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorTester.java index 4dd448aa9..a06dcad62 100644 --- a/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorTester.java +++ b/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/AnnotatorTester.java @@ -45,7 +45,11 @@ /** * AnnotatorTester is the helper class to test annotators. + * + * @deprecated To be removed without replacement. + * @forRemoval 4.0.0 */ +@Deprecated public class AnnotatorTester { /** The desc file. */ diff --git a/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResult.java b/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResult.java index 511b0e871..67ea1a8f0 100644 --- a/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResult.java +++ b/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResult.java @@ -26,7 +26,10 @@ /** * PerformanceTestResult interfance contains all the methods to access the performance test results. * + * @deprecated To be removed without replacement. + * @forRemoval 4.0.0 */ +@Deprecated public interface PerformanceTestResult { /** diff --git a/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResultImpl.java b/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResultImpl.java index d741da5da..eb3a18bf9 100644 --- a/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResultImpl.java +++ b/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResultImpl.java @@ -30,7 +30,10 @@ * PerformanceTestResultImpl implements the PerformanceTestResult interface and provides the results * of a performance test run. * + * @deprecated To be removed without replacement. + * @forRemoval 4.0.0 */ +@Deprecated public class PerformanceTestResultImpl implements PerformanceTestResult { /** The newline. */