Skip to content

Commit

Permalink
Issue #390: Merge uimaFIT modules into UIMAJ repository
Browse files Browse the repository at this point in the history
- Deprecate uimaj-component-test-util
  • Loading branch information
reckart committed Sep 23, 2024
1 parent e84cbb6 commit d7072ef
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
4 changes: 2 additions & 2 deletions uimaj-component-test-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
</parent>

<artifactId>uimaj-component-test-util</artifactId>
<packaging>jar</packaging>
<name>Apache UIMA Base: ${project.artifactId}: for JUnit</name>

<name>Apache UIMA Base: ${project.artifactId}: for JUnit (deprecated)</name>
<description>Supporting utilities used in various JUnit tests</description>
<url>${uimaWebsiteUrl}</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down Expand Up @@ -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),
Expand All @@ -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);
}

}

Expand Down Expand Up @@ -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),
Expand All @@ -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);
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit d7072ef

Please sign in to comment.