Merge branch 'master-v2' into sync-master-v2-to-master
* master-v2:
[maven-release-plugin] prepare for next development iteration
[maven-release-plugin] prepare release uimafit-2.5.0
[NO JIRA] Fixed another HTML tag in the JavaDoc on which Java 14 may choke (depending on vendor)
[UIMA-6224] uimaFIT does not build on Java 14
[UIMA-6223] Groovy plugin causes warning during build
[UIMA-6223] Groovy plugin causes warning during build
[UIMA-6222] XML-related unit test fails on Java 9+
[NO JIRA] Reduce console output during build by commenting out println statements in test code and trying to suppress stack traces of expected exceptions
[UIMA-6223] Groovy plugin causes warning during build
[UIMA-6223] Groovy plugin causes warning during build
[NO JIRA] Update Eclipse metadata files
[UIMA-6222] XML-related unit test fails on Java 9+
[maven-release-plugin] prepare for next development iteration
[maven-release-plugin] prepare release uimafit-2.5.0
[NO JIRA] Move the japicmp section from plugins management to plugins otherwise it seems the proper location of the post-analysis script is not picked up
[NO JIRA] Updated README file for release.
[NO JIRA] Updated README file for release.
[NO JIRA] Updated README file for release.
[UIMA-6181]b Fix complaints about maven-plugin-plugin in Eclipse
% Conflicts:
% README
% pom.xml
% uimafit-benchmark/pom.xml
% uimafit-core/pom.xml
% uimafit-cpe/pom.xml
% uimafit-docbook/pom.xml
% uimafit-examples/pom.xml
% uimafit-legacy-support/pom.xml
% uimafit-legacy-support/src/main/java/org/apache/uima/fit/legacy/converter/AnnotationLiteral.java
% uimafit-legacy-support/src/test/java/org/apache/uima/fit/component/ViewCreatorAnnotatorTest.java
% uimafit-legacy-support/src/test/java/org/apache/uima/fit/factory/ExternalResourceFactoryTest.java
% uimafit-legacy-support/src/test/java/org/apache/uima/fit/factory/testRes/TestExternalResource.java
% uimafit-legacy-support/src/test/java/org/apache/uima/fit/factory/testRes/TestSharedResourceObject.java
% uimafit-legacy-support/src/test/java/org/apache/uima/fit/util/CasUtilTest.java
% uimafit-legacy-support/src/test/java/org/apache/uima/fit/util/JCasUtilTest.java
% uimafit-maven-plugin/pom.xml
% uimafit-parent/pom.xml
% uimafit-spring/pom.xml
diff --git a/uimafit-core/.settings/org.eclipse.jdt.core.prefs b/uimafit-core/.settings/org.eclipse.jdt.core.prefs
index 1e40e06..be382b6 100644
--- a/uimafit-core/.settings/org.eclipse.jdt.core.prefs
+++ b/uimafit-core/.settings/org.eclipse.jdt.core.prefs
@@ -7,6 +7,7 @@
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
+org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
diff --git a/uimafit-core/src/main/java/org/apache/uima/fit/factory/package-info.java b/uimafit-core/src/main/java/org/apache/uima/fit/factory/package-info.java
index 93d1521..2eb3845 100644
--- a/uimafit-core/src/main/java/org/apache/uima/fit/factory/package-info.java
+++ b/uimafit-core/src/main/java/org/apache/uima/fit/factory/package-info.java
@@ -19,7 +19,7 @@
/**
* Factories to create different kinds of UIMA resource specifiers.
*
- * <h3><a name="InstancesVsDescriptors">Why are descriptors better than component instances?</a></h3>
+ * <h2><a id="InstancesVsDescriptors">Why are descriptors better than component instances?</a></h2>
*
* It is recommended to avoid instantiating components with uimaFIT outside of a running pipeline,
* unless necessary and unless you are aware of the consequences.
diff --git a/uimafit-core/src/main/java/org/apache/uima/fit/util/package-info.java b/uimafit-core/src/main/java/org/apache/uima/fit/util/package-info.java
index fc71f8c..f35697e 100644
--- a/uimafit-core/src/main/java/org/apache/uima/fit/util/package-info.java
+++ b/uimafit-core/src/main/java/org/apache/uima/fit/util/package-info.java
@@ -19,14 +19,14 @@
/**
* Utility classes like {@link org.apache.uima.fit.util.CasUtil} and {@link org.apache.uima.fit.util.JCasUtil}.
*
- * <h3><a name="SortOrder">Sort order</a></h3>
+ * <H2><a id="SortOrder">Sort order</a></H2>
*
* The various <em>select</em> methods in {@link org.apache.uima.fit.util.CasUtil} and
* {@link org.apache.uima.fit.util.JCasUtil} rely on the UIMA feature structure indexes. Their
* behaviour differs depending on the type of feature structure being selected and where they are
* selected from:
*
- * <h4>Selecting from a {@link org.apache.uima.cas.CAS}/{@link org.apache.uima.jcas.JCas}</h4>
+ * <H2>Selecting from a {@link org.apache.uima.cas.CAS}/{@link org.apache.uima.jcas.JCas}</H2>
* <ol>
* <li><b>Annotations</b> - if the type being selected is {@link org.apache.uima.jcas.tcas.Annotation}
* or a sub-type thereof, the built-in annotation index is used. This index has the keys
@@ -40,7 +40,7 @@
* to access these feature structures.</li>
* </ol>
*
- * <h4>Selecting from a {@link org.apache.uima.cas.ArrayFS ArrayFS/FSArray}/{@link org.apache.uima.jcas.cas.FSList}</h4>
+ * <H2>Selecting from a {@link org.apache.uima.cas.ArrayFS ArrayFS/FSArray}/{@link org.apache.uima.jcas.cas.FSList}</H2>
*
* When selecting from a feature structure list or array, the order is determined by the order of
* the annotations inside the list/array.
diff --git a/uimafit-core/src/test/java/org/apache/uima/fit/component/CasMultiplierTest.java b/uimafit-core/src/test/java/org/apache/uima/fit/component/CasMultiplierTest.java
index 2e45eb6..bbd6be8 100644
--- a/uimafit-core/src/test/java/org/apache/uima/fit/component/CasMultiplierTest.java
+++ b/uimafit-core/src/test/java/org/apache/uima/fit/component/CasMultiplierTest.java
@@ -95,7 +95,7 @@
generated++;
aCAS.setDocumentText(Integer.toString(generated));
aCAS.setDocumentLanguage(Integer.toString(generated));
- System.out.printf("%nGenerated: %s%n", aCAS.getDocumentText());
+// System.out.printf("%nGenerated: %s%n", aCAS.getDocumentText());
}
@Override
@@ -134,7 +134,7 @@
output.setDocumentText(Integer.toString(value+1));
value = -1;
- System.out.printf(" Out : %s%n", output.getDocumentText());
+// System.out.printf(" Out : %s%n", output.getDocumentText());
return output;
}
@@ -146,7 +146,7 @@
value = Integer.valueOf(aCAS.getDocumentText());
- System.out.printf(" In : %s%n", aCAS.getDocumentText());
+// System.out.printf(" In : %s%n", aCAS.getDocumentText());
}
}
@@ -171,11 +171,11 @@
@Override
public void process(CAS aCAS) throws AnalysisEngineProcessException {
int n = Integer.parseInt(aCAS.getDocumentLanguage());
- System.out.printf(" In : %s%n", aCAS.getDocumentLanguage());
+// System.out.printf(" In : %s%n", aCAS.getDocumentLanguage());
n++;
aCAS.setDocumentLanguage(Integer.toString(n));
- System.out.printf(" Out : %s%n", aCAS.getDocumentLanguage());
+// System.out.printf(" Out : %s%n", aCAS.getDocumentLanguage());
}
}
@@ -193,10 +193,10 @@
@Override
public void process(CAS aCAS) throws AnalysisEngineProcessException {
- System.out.printf("Text result : %s%n", aCAS.getDocumentText());
+// System.out.printf("Text result : %s%n", aCAS.getDocumentText());
textResult = Integer.valueOf(aCAS.getDocumentText());
- System.out.printf("Feature result : %s%n", aCAS.getDocumentLanguage());
+// System.out.printf("Feature result : %s%n", aCAS.getDocumentLanguage());
try {
featureResult = Integer.valueOf(aCAS.getDocumentLanguage());
}
diff --git a/uimafit-core/src/test/java/org/apache/uima/fit/component/ViewCreatorAnnotatorTest.java b/uimafit-core/src/test/java/org/apache/uima/fit/component/ViewCreatorAnnotatorTest.java
index 027ab71..78e171d 100644
--- a/uimafit-core/src/test/java/org/apache/uima/fit/component/ViewCreatorAnnotatorTest.java
+++ b/uimafit-core/src/test/java/org/apache/uima/fit/component/ViewCreatorAnnotatorTest.java
@@ -18,6 +18,8 @@
*/
package org.apache.uima.fit.component;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.catchThrowable;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -26,6 +28,7 @@
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.CASException;
+import org.apache.uima.cas.CASRuntimeException;
import org.apache.uima.fit.ComponentTestBase;
import org.apache.uima.fit.descriptor.SofaCapability;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
@@ -60,9 +63,9 @@
* This test basically demonstrates that the default view does not need to be initialized because
* it is done automatically.
*/
+ @SuppressWarnings("javadoc")
@Test
- public void testDefaultView() throws ResourceInitializationException,
- AnalysisEngineProcessException {
+ public void testDefaultView() throws Exception {
AnalysisEngine engine = AnalysisEngineFactory.createEngine(SofaAwareAnnotator.class,
typeSystemDescription);
engine.process(jCas);
@@ -80,33 +83,68 @@
* some other view without initializing that other view first. This is the behavior that
* SofaInitializerAnnotator addresses.
*/
- @Test(expected = AnalysisEngineProcessException.class)
- public void testOtherViewAware() throws ResourceInitializationException,
- AnalysisEngineProcessException {
+ @SuppressWarnings("javadoc")
+ @Test
+ public void testOtherViewAware() throws Exception {
AnalysisEngineDescription description = AnalysisEngineFactory.createEngineDescription(
SofaAwareAnnotator.class, typeSystemDescription);
AnalysisEngine engine = AnalysisEngineFactory.createEngine(description, "myView");
- HideOutput hider = new HideOutput();
- engine.process(jCas);
- hider.restoreOutput();
+
+ Throwable thrown = catchThrowable(() -> {
+ // Avoid exception being logged to the console
+ HideOutput hider = null;
+ try {
+ hider = new HideOutput();
+ engine.process(jCas);
+ }
+ finally {
+ if (hider != null) {
+ hider.restoreOutput();
+ }
+ }
+ });
+
+ assertThat(thrown)
+ .as("Exception thrown when view does not exist")
+ .hasRootCauseInstanceOf(CASRuntimeException.class)
+ .hasStackTraceContaining("No sofaFS with name myView found");
}
- @Test(expected = AnalysisEngineProcessException.class)
+ @Test
public void testOtherViewUnaware() throws ResourceInitializationException,
AnalysisEngineProcessException {
AnalysisEngineDescription description = AnalysisEngineFactory.createEngineDescription(
SofaUnawareAnnotator.class, typeSystemDescription);
AnalysisEngine engine = AnalysisEngineFactory.createEngine(description, "myView");
- engine.process(jCas);
+
+ Throwable thrown = catchThrowable(() -> {
+ // Avoid exception being logged to the console
+ HideOutput hider = null;
+ try {
+ hider = new HideOutput();
+ engine.process(jCas);
+ }
+ finally {
+ if (hider != null) {
+ hider.restoreOutput();
+ }
+ }
+ });
+
+ assertThat(thrown)
+ .as("Exception thrown when view does not exist")
+ .hasRootCauseInstanceOf(CASRuntimeException.class)
+ .hasStackTraceContaining("No sofaFS with name myView found");
+
}
/**
* This test demonstrates that running the viewCreator is doing the right thing (i.e. initializing
* the view "myView")
*/
+ @SuppressWarnings("javadoc")
@Test
- public void testSofaInitializer() throws ResourceInitializationException,
- AnalysisEngineProcessException, CASException {
+ public void testSofaInitializer() throws Exception {
AnalysisEngineDescription description = AnalysisEngineFactory.createEngineDescription(
SofaAwareAnnotator.class, typeSystemDescription);
AnalysisEngine engine = AnalysisEngineFactory.createEngine(description, "myView");
diff --git a/uimafit-core/src/test/java/org/apache/uima/fit/component/ViewTextCopierAnnotatorTest.java b/uimafit-core/src/test/java/org/apache/uima/fit/component/ViewTextCopierAnnotatorTest.java
index 1a5f2b0..e487565 100644
--- a/uimafit-core/src/test/java/org/apache/uima/fit/component/ViewTextCopierAnnotatorTest.java
+++ b/uimafit-core/src/test/java/org/apache/uima/fit/component/ViewTextCopierAnnotatorTest.java
@@ -18,6 +18,8 @@
*/
package org.apache.uima.fit.component;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.catchThrowable;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
@@ -26,8 +28,10 @@
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.CASException;
+import org.apache.uima.cas.CASRuntimeException;
import org.apache.uima.fit.ComponentTestBase;
import org.apache.uima.fit.factory.AnalysisEngineFactory;
+import org.apache.uima.fit.testing.util.HideOutput;
import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.ResourceInitializationException;
import org.junit.Test;
@@ -76,7 +80,7 @@
assertNull(jCas.getDocumentText());
}
- @Test(expected = AnalysisEngineProcessException.class)
+ @Test
public void testExceptions() throws ResourceInitializationException,
AnalysisEngineProcessException {
@@ -87,6 +91,24 @@
ViewTextCopierAnnotator.class, typeSystemDescription,
ViewTextCopierAnnotator.PARAM_SOURCE_VIEW_NAME, sourceViewName,
ViewTextCopierAnnotator.PARAM_DESTINATION_VIEW_NAME, destinationViewName);
- viewCreator.process(jCas);
+
+ Throwable thrown = catchThrowable(() -> {
+ // Avoid exception being logged to the console
+ HideOutput hider = null;
+ try {
+ hider = new HideOutput();
+ viewCreator.process(jCas);
+ }
+ finally {
+ if (hider != null) {
+ hider.restoreOutput();
+ }
+ }
+ });
+
+ assertThat(thrown)
+ .as("Exception thrown when source view does not exist")
+ .hasRootCauseInstanceOf(CASRuntimeException.class)
+ .hasStackTraceContaining("No sofaFS with name SourceView found");
}
}
diff --git a/uimafit-core/src/test/java/org/apache/uima/fit/factory/AnalysisEngineFactoryExternalResourceTest.java b/uimafit-core/src/test/java/org/apache/uima/fit/factory/AnalysisEngineFactoryExternalResourceTest.java
index 5d446be..2adc920 100644
--- a/uimafit-core/src/test/java/org/apache/uima/fit/factory/AnalysisEngineFactoryExternalResourceTest.java
+++ b/uimafit-core/src/test/java/org/apache/uima/fit/factory/AnalysisEngineFactoryExternalResourceTest.java
@@ -41,10 +41,7 @@
import org.apache.uima.fit.descriptor.ExternalResource;
import org.apache.uima.fit.factory.testRes.TestExternalResource;
import org.apache.uima.fit.factory.testRes.TestSharedResourceObject;
-import org.apache.uima.resource.CustomResourceSpecifier;
import org.apache.uima.resource.ExternalResourceDescription;
-import org.apache.uima.resource.ResourceCreationSpecifier;
-import org.apache.uima.resource.metadata.ExternalResourceBinding;
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
import org.junit.Before;
@@ -88,8 +85,8 @@
TestAnalysisEngineWithResource.class, TestAnalysisEngineWithResource.PARAM_RESOURCE,
resDesc));
- dumpResourceConfiguration(aeDesc1);
- dumpResourceConfiguration(aeDesc2);
+// dumpResourceConfiguration(aeDesc1);
+// dumpResourceConfiguration(aeDesc2);
AnalysisEngine ae1 = createEngine(aeDesc1);
AnalysisEngine ae2 = createEngine(aeDesc2);
@@ -137,14 +134,14 @@
TestAnalysisEngineWithResource.class, TestAnalysisEngineWithResource.PARAM_RESOURCE,
resDesc));
- dumpResourceConfiguration(aeDesc1);
+// dumpResourceConfiguration(aeDesc1);
AnalysisEngineDescription aeDesc2 = saveLoad(createEngineDescription(
TestAnalysisEngineWithResource.class, TestAnalysisEngineWithResource.PARAM_RESOURCE,
resDesc));
- dumpResourceConfiguration(aeDesc1);
- dumpResourceConfiguration(aeDesc2);
+// dumpResourceConfiguration(aeDesc1);
+// dumpResourceConfiguration(aeDesc2);
AnalysisEngine ae1 = createEngine(aeDesc1);
AnalysisEngine ae2 = createEngine(aeDesc2);
@@ -175,7 +172,7 @@
TestExternalResource.PARAM_VALUE, TestExternalResource.EXPECTED_VALUE,
TestExternalResource2.PARAM_RESOURCE, resDesc)));
- dumpResourceConfiguration(aeDesc);
+// dumpResourceConfiguration(aeDesc);
AnalysisEngine ae = createEngine(aeDesc);
ae.process(ae.newCAS());
@@ -195,7 +192,7 @@
TestAnalysisEngineWithResource.class, TestAnalysisEngineWithResource.PARAM_RESOURCE,
resDesc));
- dumpResourceConfiguration(aeDesc);
+// dumpResourceConfiguration(aeDesc);
AnalysisEngine ae = createEngine(aeDesc);
ae.process(ae.newCAS());
@@ -219,8 +216,8 @@
TestAnalysisEngineWithResource.class, TestAnalysisEngineWithResource.PARAM_RESOURCE,
resDesc));
- dumpResourceConfiguration(aeDesc1);
- dumpResourceConfiguration(aeDesc2);
+// dumpResourceConfiguration(aeDesc1);
+// dumpResourceConfiguration(aeDesc2);
AnalysisEngine ae1 = createEngine(aeDesc1);
AnalysisEngine ae2 = createEngine(aeDesc2);
@@ -263,8 +260,8 @@
TestAnalysisEngineWithSharedResourceObject.class,
TestAnalysisEngineWithSharedResourceObject.PARAM_RESOURCE, resDesc));
- dumpResourceConfiguration(aeDesc1);
- dumpResourceConfiguration(aeDesc2);
+// dumpResourceConfiguration(aeDesc1);
+// dumpResourceConfiguration(aeDesc2);
AnalysisEngine ae1 = createEngine(aeDesc1);
AnalysisEngine ae2 = createEngine(aeDesc2);
@@ -336,7 +333,7 @@
TestAnalysisEngineWithSharedResourceObject.class,
TestAnalysisEngineWithSharedResourceObject.PARAM_RESOURCE, resDesc));
- dumpResourceConfiguration(aeDesc);
+// dumpResourceConfiguration(aeDesc);
AnalysisEngine ae = createEngine(aeDesc);
ae.process(ae.newCAS());
@@ -350,7 +347,7 @@
@Override
public void afterResourcesInitialized() {
- System.out.println(getClass().getSimpleName() + ".afterResourcesInitialized()");
+// System.out.println(getClass().getSimpleName() + ".afterResourcesInitialized()");
// Ensure the External Resource is bound
assertNotNull(resource);
if (this != resource) {
@@ -372,7 +369,7 @@
@Override
public void afterResourcesInitialized() {
- System.out.println(getClass().getSimpleName() + ".afterResourcesInitialized()");
+// System.out.println(getClass().getSimpleName() + ".afterResourcesInitialized()");
// Ensure the External Resource is bound
assertNotNull(resource);
if (this != resource) {
@@ -396,7 +393,7 @@
@Override
public void process(CAS aCAS) throws AnalysisEngineProcessException {
- System.out.println(getClass().getSimpleName() + ".process()");
+// System.out.println(getClass().getSimpleName() + ".process()");
assertNotNull(resource);
resource.assertConfiguredOk();
}
@@ -411,7 +408,7 @@
@Override
public void process(CAS aCAS) throws AnalysisEngineProcessException {
- System.out.println(getClass().getSimpleName() + ".process()");
+// System.out.println(getClass().getSimpleName() + ".process()");
assertNotNull(resource);
resource.assertConfiguredOk();
}
@@ -425,24 +422,24 @@
new XMLInputSource(new ByteArrayInputStream(bos.toByteArray()), null));
}
- private void dumpResourceConfiguration(ResourceCreationSpecifier aSpec) {
- System.out.println("-- begin resource configuration");
- for (ExternalResourceBinding b : aSpec.getResourceManagerConfiguration()
- .getExternalResourceBindings()) {
- System.out.printf("Binding : %s -> %s %n", b.getKey(), b.getResourceName());
- }
-
- for (ExternalResourceDescription r : aSpec.getResourceManagerConfiguration()
- .getExternalResources()) {
- if (r.getImplementationName() != null) {
- System.out.printf("Resource: %s -> %s %n", r.getName(), r.getImplementationName());
- } else {
- System.out.printf("Resource: %s -> %s %n", r.getName(),
- ((CustomResourceSpecifier) r.getResourceSpecifier()).getResourceClassName());
- }
- }
- System.out.println("-- end resource configuration");
- }
+// private void dumpResourceConfiguration(ResourceCreationSpecifier aSpec) {
+// System.out.println("-- begin resource configuration");
+// for (ExternalResourceBinding b : aSpec.getResourceManagerConfiguration()
+// .getExternalResourceBindings()) {
+// System.out.printf("Binding : %s -> %s %n", b.getKey(), b.getResourceName());
+// }
+//
+// for (ExternalResourceDescription r : aSpec.getResourceManagerConfiguration()
+// .getExternalResources()) {
+// if (r.getImplementationName() != null) {
+// System.out.printf("Resource: %s -> %s %n", r.getName(), r.getImplementationName());
+// } else {
+// System.out.printf("Resource: %s -> %s %n", r.getName(),
+// ((CustomResourceSpecifier) r.getResourceSpecifier()).getResourceClassName());
+// }
+// }
+// System.out.println("-- end resource configuration");
+// }
@Rule
public TestName name = new TestName();
diff --git a/uimafit-core/src/test/java/org/apache/uima/fit/factory/AnalysisEngineFactoryTest.java b/uimafit-core/src/test/java/org/apache/uima/fit/factory/AnalysisEngineFactoryTest.java
index e5ee069..32208d2 100644
--- a/uimafit-core/src/test/java/org/apache/uima/fit/factory/AnalysisEngineFactoryTest.java
+++ b/uimafit-core/src/test/java/org/apache/uima/fit/factory/AnalysisEngineFactoryTest.java
@@ -85,6 +85,7 @@
import org.apache.uima.resource.metadata.TypeSystemDescription;
import org.apache.uima.util.XMLInputSource;
import org.custommonkey.xmlunit.XMLAssert;
+import org.custommonkey.xmlunit.XMLUnit;
import org.junit.Test;
public class AnalysisEngineFactoryTest extends ComponentTestBase {
@@ -564,6 +565,7 @@
String actual = FileUtils.readFileToString(target, "UTF-8");
String expected = FileUtils.readFileToString(reference, "UTF-8");
+ XMLUnit.setIgnoreWhitespace(true);
XMLAssert.assertXMLEqual(expected, actual);
// assertEquals(expected, actual);
}
@@ -581,7 +583,6 @@
AnalysisEngine ae = createEngine(createEngineDescription(specifier));
-
// Create a CAS with a sample document text and process the CAS
CAS cas = ae.newCAS();
cas.setDocumentText("Sample text to process with a date 05/29/07 and a time 9:45 AM");
diff --git a/uimafit-core/src/test/java/org/apache/uima/fit/factory/testRes/TestExternalResource.java b/uimafit-core/src/test/java/org/apache/uima/fit/factory/testRes/TestExternalResource.java
index cc08b0a..7e5a596 100644
--- a/uimafit-core/src/test/java/org/apache/uima/fit/factory/testRes/TestExternalResource.java
+++ b/uimafit-core/src/test/java/org/apache/uima/fit/factory/testRes/TestExternalResource.java
@@ -34,7 +34,7 @@
private String value;
public void assertConfiguredOk() {
- System.out.println(getClass().getSimpleName() + ".assertConfiguredOk()");
+// System.out.println(getClass().getSimpleName() + ".assertConfiguredOk()");
// Ensure normal parameters get passed to External Resource
assertEquals(EXPECTED_VALUE, value);
}
diff --git a/uimafit-core/src/test/java/org/apache/uima/fit/factory/testRes/TestSharedResourceObject.java b/uimafit-core/src/test/java/org/apache/uima/fit/factory/testRes/TestSharedResourceObject.java
index be52ac6..300f31c 100644
--- a/uimafit-core/src/test/java/org/apache/uima/fit/factory/testRes/TestSharedResourceObject.java
+++ b/uimafit-core/src/test/java/org/apache/uima/fit/factory/testRes/TestSharedResourceObject.java
@@ -37,11 +37,12 @@
private String value;
public void assertConfiguredOk() {
- System.out.println(getClass().getSimpleName() + ".assertConfiguredOk()");
+// System.out.println(getClass().getSimpleName() + ".assertConfiguredOk()");
// Ensure normal parameters get passed to External Resource
assertEquals(EXPECTED_VALUE, value);
}
+ @Override
public void load(DataResource aData) throws ResourceInitializationException {
ConfigurationParameterInitializer.initialize(this, aData);
}
diff --git a/uimafit-core/src/test/java/org/apache/uima/fit/util/CasUtilTest.java b/uimafit-core/src/test/java/org/apache/uima/fit/util/CasUtilTest.java
index 67d0ae7..769502e 100644
--- a/uimafit-core/src/test/java/org/apache/uima/fit/util/CasUtilTest.java
+++ b/uimafit-core/src/test/java/org/apache/uima/fit/util/CasUtilTest.java
@@ -147,11 +147,11 @@
}
// Print what is expected
- for (FeatureStructure fs : allFS) {
- System.out.println("Type: " + fs.getType().getName() + "]");
- }
- System.out
- .println("Tokens: [" + toText(select(cas, getType(cas, Token.class.getName()))) + "]");
+// for (FeatureStructure fs : allFS) {
+// System.out.println("Type: " + fs.getType().getName() + "]");
+// }
+// System.out
+// .println("Tokens: [" + toText(select(cas, getType(cas, Token.class.getName()))) + "]");
// Document Annotation, one sentence and 4 tokens.
assertEquals(6, allFS.size());
diff --git a/uimafit-core/src/test/java/org/apache/uima/fit/util/JCasUtilTest.java b/uimafit-core/src/test/java/org/apache/uima/fit/util/JCasUtilTest.java
index f8c70da..c5b964c 100644
--- a/uimafit-core/src/test/java/org/apache/uima/fit/util/JCasUtilTest.java
+++ b/uimafit-core/src/test/java/org/apache/uima/fit/util/JCasUtilTest.java
@@ -133,8 +133,8 @@
JCas jcas = cas.getJCas();
Collection<Sentence> sentences = select(jcas, Sentence.class);
- long timeNaive = 0;
- long timeOptimized = 0;
+// long timeNaive = 0;
+// long timeOptimized = 0;
// Prepare the index
long timeIndexed = System.currentTimeMillis();
@@ -151,12 +151,12 @@
long ti = System.currentTimeMillis();
// The naive approach is assumed to be correct
List<Token> expected = selectCovered(jcas, Token.class, t.getBegin(), t.getEnd());
- timeNaive += System.currentTimeMillis() - ti;
+// timeNaive += System.currentTimeMillis() - ti;
// Record time for optimized selectCovered
ti = System.currentTimeMillis();
List<Token> actual1 = selectCovered(jcas, Token.class, t);
- timeOptimized += System.currentTimeMillis() - ti;
+// timeOptimized += System.currentTimeMillis() - ti;
// Record index lookup time
ti = System.currentTimeMillis();
@@ -168,14 +168,15 @@
// System.out.printf("%n--- OK ---------------%n%n");
}
- System.out.printf(
- "%3d Optimized: speed up factor %3.2f [naive:%4d optimized:%4d (diff:%4d)]%n", i,
- (double) timeNaive / (double) timeOptimized, timeNaive, timeOptimized,
- timeNaive - timeOptimized);
- System.out.printf(
- "%3d Indexed: speed up factor %3.2f [naive:%4d indexed :%4d (diff:%4d)]%n%n", i,
- (double) timeNaive / (double) timeIndexed, timeNaive, timeIndexed,
- timeNaive - timeIndexed);
+
+// System.out.printf(
+// "%3d Optimized: speed up factor %3.2f [naive:%4d optimized:%4d (diff:%4d)]%n", i,
+// (double) timeNaive / (double) timeOptimized, timeNaive, timeOptimized,
+// timeNaive - timeOptimized);
+// System.out.printf(
+// "%3d Indexed: speed up factor %3.2f [naive:%4d indexed :%4d (diff:%4d)]%n%n", i,
+// (double) timeNaive / (double) timeIndexed, timeNaive, timeIndexed,
+// timeNaive - timeIndexed);
}
}
@@ -208,8 +209,8 @@
JCas jcas = cas.getJCas();
List<Token> tokens = new ArrayList<Token>(select(jcas, Token.class));
- long timeNaive = 0;
- long timeOptimized = 0;
+// long timeNaive = 0;
+// long timeOptimized = 0;
for (int j = 0; j < ITERATIONS; j++) {
Token t1 = tokens.get(rnd.nextInt(tokens.size()));
Token t2 = tokens.get(rnd.nextInt(tokens.size()));
@@ -217,32 +218,32 @@
int left = Math.min(t1.getEnd(), t2.getEnd());
int right = Math.max(t1.getBegin(), t2.getBegin());
- long ti;
+// long ti;
List<Sentence> reference;
if ((t1.getBegin() < t2.getBegin() && t2.getBegin() < t1.getEnd())
|| (t1.getBegin() < t2.getEnd() && t2.getEnd() < t1.getEnd())
|| (t2.getBegin() < t1.getBegin() && t1.getBegin() < t2.getEnd())
|| (t2.getBegin() < t1.getEnd() && t1.getEnd() < t2.getEnd())) {
// If the boundary annotations overlap, the result must be empty
- ti = System.currentTimeMillis();
+// ti = System.currentTimeMillis();
reference = new ArrayList<Sentence>();
- timeNaive += System.currentTimeMillis() - ti;
+// timeNaive += System.currentTimeMillis() - ti;
} else {
- ti = System.currentTimeMillis();
+// ti = System.currentTimeMillis();
reference = selectCovered(jcas, Sentence.class, left, right);
- timeNaive += System.currentTimeMillis() - ti;
+// timeNaive += System.currentTimeMillis() - ti;
}
- ti = System.currentTimeMillis();
+// ti = System.currentTimeMillis();
List<Sentence> actual = selectBetween(Sentence.class, t1, t2);
- timeOptimized += System.currentTimeMillis() - ti;
+// timeOptimized += System.currentTimeMillis() - ti;
assertEquals("Naive: Searching between " + t1 + " and " + t2, reference, actual);
}
- System.out.format("Speed up factor %.2f [naive:%d optimized:%d diff:%d]\n",
- (double) timeNaive / (double) timeOptimized, timeNaive, timeOptimized, timeNaive
- - timeOptimized);
+// System.out.format("Speed up factor %.2f [naive:%d optimized:%d diff:%d]\n",
+// (double) timeNaive / (double) timeOptimized, timeNaive, timeOptimized, timeNaive
+// - timeOptimized);
}
}
@@ -354,10 +355,10 @@
}
// Print what is expected
- for (FeatureStructure fs : allFS) {
- System.out.println("Type: " + fs.getType().getName() + "]");
- }
- System.out.println("Tokens: [" + toText(select(jCas, Token.class)) + "]");
+// for (FeatureStructure fs : allFS) {
+// System.out.println("Type: " + fs.getType().getName() + "]");
+// }
+// System.out.println("Tokens: [" + toText(select(jCas, Token.class)) + "]");
// Document Annotation, one sentence and 4 tokens.
assertEquals(6, allFS.size());
@@ -391,10 +392,10 @@
}
// Print what is expected
- for (FeatureStructure fs : allFS) {
- System.out.println("Type: " + fs.getType().getName() + "]");
- }
- System.out.println("Tokens: [" + toText(select(jCas, Token.class)) + "]");
+// for (FeatureStructure fs : allFS) {
+// System.out.println("Type: " + fs.getType().getName() + "]");
+// }
+// System.out.println("Tokens: [" + toText(select(jCas, Token.class)) + "]");
// Document Annotation, one sentence and 4 tokens.
assertEquals(6, allFS.size());
diff --git a/uimafit-cpe/.settings/org.eclipse.jdt.core.prefs b/uimafit-cpe/.settings/org.eclipse.jdt.core.prefs
index 1e40e06..be382b6 100644
--- a/uimafit-cpe/.settings/org.eclipse.jdt.core.prefs
+++ b/uimafit-cpe/.settings/org.eclipse.jdt.core.prefs
@@ -7,6 +7,7 @@
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
+org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
diff --git a/uimafit-cpe/src/test/java/org/apache/uima/fit/cpe/CasMultiplierTest.java b/uimafit-cpe/src/test/java/org/apache/uima/fit/cpe/CasMultiplierTest.java
index 2adcbd6..8f380f7 100644
--- a/uimafit-cpe/src/test/java/org/apache/uima/fit/cpe/CasMultiplierTest.java
+++ b/uimafit-cpe/src/test/java/org/apache/uima/fit/cpe/CasMultiplierTest.java
@@ -49,6 +49,7 @@
* Simulates a CPE with CAS multipliers that always read one CAS and always produce one CAS.
* It actually appears to work despite CPE not supporting CAS multipliers.
*/
+ @SuppressWarnings("javadoc")
@Test
public void testRunPipeline() throws Exception {
CollectionReaderDescription reader = createReaderDescription(Reader.class);
@@ -79,8 +80,8 @@
public void getNext(CAS aCAS) throws IOException, CollectionException {
generated++;
aCAS.setDocumentText(Integer.toString(generated));
- System.out.printf("%n[%s] Generated: %s%n", Thread.currentThread().getName(),
- aCAS.getDocumentText());
+// System.out.printf("%n[%s] Generated: %s%n", Thread.currentThread().getName(),
+// aCAS.getDocumentText());
}
@Override
@@ -119,8 +120,8 @@
output.setDocumentText(Integer.toString(value+1));
value = -1;
- System.out.printf("[%s] Out : %s%n", Thread.currentThread().getName(),
- output.getDocumentText());
+// System.out.printf("[%s] Out : %s%n", Thread.currentThread().getName(),
+// output.getDocumentText());
return output;
}
@@ -132,8 +133,8 @@
value = Integer.valueOf(aCAS.getDocumentText());
- System.out.printf("[%s] In : %s%n", Thread.currentThread().getName(),
- aCAS.getDocumentText());
+// System.out.printf("[%s] In : %s%n", Thread.currentThread().getName(),
+// aCAS.getDocumentText());
}
}
@@ -149,7 +150,7 @@
@Override
public void process(CAS aCAS) throws AnalysisEngineProcessException {
- System.out.printf("Result : %s%n", aCAS.getDocumentText());
+// System.out.printf("Result : %s%n", aCAS.getDocumentText());
result.add(Integer.valueOf(aCAS.getDocumentText()));
}
}
diff --git a/uimafit-cpe/src/test/java/org/apache/uima/fit/cpe/ExternalResourceFactoryTest.java b/uimafit-cpe/src/test/java/org/apache/uima/fit/cpe/ExternalResourceFactoryTest.java
index bfcc0f5..cb08362 100644
--- a/uimafit-cpe/src/test/java/org/apache/uima/fit/cpe/ExternalResourceFactoryTest.java
+++ b/uimafit-cpe/src/test/java/org/apache/uima/fit/cpe/ExternalResourceFactoryTest.java
@@ -74,6 +74,7 @@
/**
* Test resource list.
*/
+ @SuppressWarnings("javadoc")
@Test
public void testMultiValue() throws Exception {
ExternalResourceDescription extDesc1 = createResourceDescription(ResourceWithAssert.class);
@@ -88,6 +89,7 @@
/**
* Test sharing a resource list between two AEs on the same aggregate.
*/
+ @SuppressWarnings("javadoc")
@Test
public void testMultiValue2() throws Exception {
MultiValuedResourceAE.resources.clear();
@@ -111,6 +113,7 @@
/**
* Test sharing a resource list across aggregates.
*/
+ @SuppressWarnings("javadoc")
@Test
public void testMultiValue3() throws Exception {
MultiValuedResourceAE.resources.clear();
@@ -134,6 +137,7 @@
/**
* Test nested resource lists.
*/
+ @SuppressWarnings("javadoc")
@Test
public void testMultiValue4() throws Exception {
ExternalResourceDescription extDesc1 = createResourceDescription(ResourceWithAssert.class);
@@ -178,8 +182,8 @@
resources.add(resourceArray[0]);
resources.add(resourceArray[1]);
- System.out.printf("Element object 0: %d%n", resourceArray[0].hashCode());
- System.out.printf("Element object 1: %d%n", resourceArray[1].hashCode());
+// System.out.printf("Element object 0: %d%n", resourceArray[0].hashCode());
+// System.out.printf("Element object 1: %d%n", resourceArray[1].hashCode());
for (ResourceWithAssert res : resourceArray) {
res.doAsserts();
@@ -208,8 +212,8 @@
resources.add(resourceList.get(0));
resources.add(resourceList.get(1));
- System.out.printf("Element object 0: %d%n", resourceList.get(0).hashCode());
- System.out.printf("Element object 1: %d%n", resourceList.get(1).hashCode());
+// System.out.printf("Element object 0: %d%n", resourceList.get(0).hashCode());
+// System.out.printf("Element object 1: %d%n", resourceList.get(1).hashCode());
for (ResourceWithAssert res : resourceList) {
res.doAsserts();
@@ -237,7 +241,7 @@
assertEquals(prevHashCode, res.hashCode());
}
- System.out.println(getClass().getSimpleName() + ": " + res);
+// System.out.println(getClass().getSimpleName() + ": " + res);
}
public static void reset() {
diff --git a/uimafit-examples/.settings/org.eclipse.jdt.core.prefs b/uimafit-examples/.settings/org.eclipse.jdt.core.prefs
index 225e1bc..01bd79c 100644
--- a/uimafit-examples/.settings/org.eclipse.jdt.core.prefs
+++ b/uimafit-examples/.settings/org.eclipse.jdt.core.prefs
@@ -4,6 +4,7 @@
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
+org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
diff --git a/uimafit-maven-plugin/.settings/org.eclipse.jdt.core.prefs b/uimafit-maven-plugin/.settings/org.eclipse.jdt.core.prefs
index 225e1bc..01bd79c 100644
--- a/uimafit-maven-plugin/.settings/org.eclipse.jdt.core.prefs
+++ b/uimafit-maven-plugin/.settings/org.eclipse.jdt.core.prefs
@@ -4,6 +4,7 @@
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
+org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
diff --git a/uimafit-parent/pom.xml b/uimafit-parent/pom.xml
index 2f03db4..ff73e06 100644
--- a/uimafit-parent/pom.xml
+++ b/uimafit-parent/pom.xml
@@ -204,8 +204,8 @@
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
- <artifactId>gmaven-plugin</artifactId>
- <version>1.5</version>
+ <artifactId>groovy-maven-plugin</artifactId>
+ <version>2.1.1</version>
<executions>
<execution>
<!-- Load postNoticeText from NOTICE file -->
@@ -219,11 +219,23 @@
def noticeFile = new File(project.basedir.path + "/NOTICE");
if (noticeFile.exists()) {
project.properties.postNoticeText = noticeFile.text;
+ println "Loaded NOTICE file content into property [postNoticeText]"
+ }
+ else {
+ println "No NOTICE file was found - content not loaded into property [postNoticeText]"
}
</source>
</configuration>
</execution>
</executions>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>3.0.3</version>
+ <type>pom</type>
+ </dependency>
+ </dependencies>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
@@ -321,7 +333,7 @@
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.gmaven</groupId>
- <artifactId>gmaven-plugin</artifactId>
+ <artifactId>groovy-maven-plugin</artifactId>
<versionRange>[1.4,)</versionRange>
<goals>
<goal>execute</goal>
@@ -371,6 +383,26 @@
</lifecycleMappingMetadata>
</configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>3.0.0-M3</version>
+ <executions>
+ <execution>
+ <id>enforce-prerequisites</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>[1.8.0,)</version>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</pluginManagement>
</build>
@@ -389,9 +421,12 @@
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
+ <version>0.14.3</version>
<configuration>
- <parameter>
+ <parameter combine.children="append">
<onlyModified>true</onlyModified>
+ <breakBuildBasedOnSemanticVersioning>true</breakBuildBasedOnSemanticVersioning>
+ <reportOnlyFilename>true</reportOnlyFilename>
<!-- filter out classes with impl in their package or class name -->
<postAnalysisScript>${japicmp.postAnalysisScript}</postAnalysisScript>
</parameter>
diff --git a/uimafit-spring/.settings/org.eclipse.jdt.core.prefs b/uimafit-spring/.settings/org.eclipse.jdt.core.prefs
index 225e1bc..01bd79c 100644
--- a/uimafit-spring/.settings/org.eclipse.jdt.core.prefs
+++ b/uimafit-spring/.settings/org.eclipse.jdt.core.prefs
@@ -4,6 +4,7 @@
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
+org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false