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 2007/06/25 13:54:03 UTC
svn commit: r550460 - in /incubator/uima/uimaj/trunk/uimaj-core/src/test:
java/org/apache/uima/analysis_engine/impl/sequencer/ resources/SequencerTest/
Author: mbaessler
Date: Mon Jun 25 04:54:01 2007
New Revision: 550460
URL: http://svn.apache.org/viewvc?view=rev&rev=550460
Log:
UIMA-443
added additional test cases for the result specification (test different language settings)
JIRA ticket https://issues.apache.org/jira/browse/UIMA-443
Modified:
incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/sequencer/SequencerCapabilityLanguageTest.java
incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageAggregateES.xml
incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsAr.txt
incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEn.txt
incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEnResultSpec.txt
incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEnUS.txt
incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt
incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsZhCN.txt
incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsZhCNResultSpec.txt
incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/WhitespaceTokenizer.xml
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/sequencer/SequencerCapabilityLanguageTest.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/sequencer/SequencerCapabilityLanguageTest.java?view=diff&rev=550460&r1=550459&r2=550460
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/sequencer/SequencerCapabilityLanguageTest.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/sequencer/SequencerCapabilityLanguageTest.java Mon Jun 25 04:54:01 2007
@@ -57,19 +57,17 @@
this.testBaseDir = JUnitExtension.getFile("SequencerTest");
}
- public void testSequencerCapabilityLanguageEsEn() throws Exception {
+ public void runTest(String desc, String language, String refFile, boolean doResultSpec)
+ throws Exception {
AnalysisEngine ae = null;
try {
// create TempFile for test
-
File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
outputReferenceFile.delete(); // delete file if exist
outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
// Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
+ XMLInputSource in = new XMLInputSource(JUnitExtension.getFile(desc));
// Parse the specifier.
ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
// Create the Text Analysis Engine.
@@ -81,13 +79,22 @@
// System.out.println("Processing text: \"" + text + "\"");
// Set the document text on the CAS.
cas.setDocumentText(text);
- cas.setDocumentLanguage("en");
+ cas.setDocumentLanguage(language);
// Process the sample document.
- ae.process(cas);
+ if (doResultSpec) {
+ ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
+ .createResultSpecification();
+ resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
+ ae.process(cas, resultSpec);
+ } else {
+ ae.process(cas);
+ }
// check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsEn.txt")));
- outputReferenceFile.delete();
+ boolean compare = FileCompare.compare(outputReferenceFile, JUnitExtension.getFile(refFile));
+ Assert.assertTrue(compare);
+ if (compare) {
+ outputReferenceFile.delete();
+ }
} catch (Exception ex) {
JUnitExtension.handleException(ex);
} finally {
@@ -98,963 +105,127 @@
}
}
+ public void testSequencerCapabilityLanguageEsEn() throws Exception {
+
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "en",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsEn.txt", false);
+
+ }
+
public void testSequencerCapabilityLanguageEsEnResultSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("en");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsEnResultSpec.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "en",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsEnResultSpec.txt", true);
+
}
public void testSequencerCapabilityLanguageEsEnUS() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("en-US");
- // Process the sample document.
- ae.process(cas);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsEn.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "en-US",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsEnUS.txt", false);
}
public void testSequencerCapabilityLanguageEsEnUSResultSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("en-US");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsEn.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "en-US",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsEnResultSpec.txt", true);
}
public void testSequencerCapabilityLanguageEsAr() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("ar");
- // Process the sample document.
- ae.process(cas);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsAr.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "ar",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsAr.txt", false);
}
public void testSequencerCapabilityLanguageEsArResultSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("ar");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsAr.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "ar",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsAr.txt", true);
}
public void testSequencerCapabilityLanguageEsUnkown() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("unknown");
- // Process the sample document.
- ae.process(cas);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "unknown",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt", false);
}
public void testSequencerCapabilityLanguageEsUnkownResultSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("unknown");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "unknown",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt", true);
}
public void testSequencerCapabilityLanguageEsZhCN() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("zh-CN");
- // Process the sample document.
- ae.process(cas);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsZhCN.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "zh-CN",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsZhCN.txt", false);
}
public void testSequencerCapabilityLanguageEsZhCNResultSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("zh-CN");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsZhCNResultSpec.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "zh-CN",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsZhCNResultSpec.txt", true);
+ }
public void testSequencerCapabilityLanguageEsXunSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("x-unspecified");
- // Process the sample document.
- ae.process(cas);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "x-unspecified",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt", false);
}
public void testSequencerCapabilityLanguageEsXunSpecResultSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("x-unspecified");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "x-unspecified",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt", true);
}
public void testSequencerCapabilityLanguageEn() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregate.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("en");
- // Process the sample document.
- ae.process(cas);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEn.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregate.xml", "en",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEn.txt", false);
}
public void testSequencerCapabilityLanguageEnResultSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregate.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("en");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEnResultSpec.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregate.xml", "en",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEnResultSpec.txt", true);
}
public void testSequencerCapabilityLanguageEnResultSpecCapital() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregate.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("EN");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEnResultSpec.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregate.xml", "EN",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEnResultSpec.txt", true);
}
public void testSequencerCapabilityLanguageJa() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregate.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("ja");
- // Process the sample document.
- ae.process(cas);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedJa.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregate.xml", "ja",
+ "SequencerTest/SequencerCapabilityLanguageExpectedJa.txt", false);
}
public void testSequencerCapabilityLanguageJaResultSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregate.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("ja");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedJaResultSpec.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregate.xml", "ja",
+ "SequencerTest/SequencerCapabilityLanguageExpectedJaResultSpec.txt", true);
}
public void testSequencerCapabilityLanguageXunSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregate.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("x-unspecified");
- // Process the sample document.
- ae.process(cas);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedXunSpec.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregate.xml", "x-unspecified",
+ "SequencerTest/SequencerCapabilityLanguageExpectedXunSpec.txt", false);
}
public void testSequencerCapabilityLanguageXunSpecResultSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregate.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("x-unspecified");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedXunSpec.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregate.xml", "x-unspecified",
+ "SequencerTest/SequencerCapabilityLanguageExpectedXunSpec.txt", true);
}
public void testSequencerCapabilityLanguageEsFooBar() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("foo-BAR");
- // Process the sample document.
- ae.process(cas);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "foo-BAR",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt", false);
}
public void testSequencerCapabilityLanguageEsFooBarResultSpec() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("foo-BAR");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "foo-BAR",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt", true);
}
public void testSequencerCapabilityLanguageEsZhCNSmall() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("zh-cn");
- // Process the sample document.
- ae.process(cas);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsZhCN.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "zh-cn",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsZhCN.txt", false);
}
public void testSequencerCapabilityLanguageEsZhCNResultSpecSmall() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateES.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("zh-cn");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedEsZhCNResultSpec.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateES.xml", "zh-cn",
+ "SequencerTest/SequencerCapabilityLanguageExpectedEsZhCNResultSpec.txt", true);
}
public void testSequencerCapabilityLanguageResultSpecSetByFlowController() throws Exception {
- AnalysisEngine ae = null;
- try {
- // create TempFile for test
- File outputReferenceFile = new File(this.testBaseDir, "SequencerTest.txt");
- outputReferenceFile.delete(); // delete file if exist
- outputReferenceFile.createNewFile(); // create new file
- outputReferenceFile.deleteOnExit(); // delete file after closing VM
-
- // Create an XML input source from the specifier file.
- XMLInputSource in = new XMLInputSource(JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageAggregateResultSpec.xml"));
- // Parse the specifier.
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(in);
- // Create the Text Analysis Engine.
- ae = UIMAFramework.produceAnalysisEngine(specifier, null, null);
- // Create a new CAS.
- CAS cas = ae.newCAS();
- // Our sample text.
- String text = "Hello world!";
- // System.out.println("Processing text: \"" + text + "\"");
- // Set the document text on the CAS.
- cas.setDocumentText(text);
- cas.setDocumentLanguage("en");
- // Process the sample document.
- ResultSpecification resultSpec = UIMAFramework.getResourceSpecifierFactory()
- .createResultSpecification();
- resultSpec.addCapabilities(ae.getAnalysisEngineMetaData().getCapabilities());
- ae.process(cas, resultSpec);
- // check fileoutput
- Assert.assertTrue(FileCompare.compare(outputReferenceFile, JUnitExtension
- .getFile("SequencerTest/SequencerCapabilityLanguageExpectedResultSpecSetByFlowController.txt")));
- outputReferenceFile.delete();
- } catch (Exception ex) {
- JUnitExtension.handleException(ex);
- } finally {
- // Destroy the CAS, releasing resources.
- if (ae != null) {
- ae.destroy();
- }
- }
+ runTest("SequencerTest/SequencerCapabilityLanguageAggregateResultSpec.xml", "en",
+ "SequencerTest/SequencerCapabilityLanguageExpectedResultSpecSetByFlowController.txt", false);
}
-
}
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageAggregateES.xml
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageAggregateES.xml?view=diff&rev=550460&r1=550459&r2=550460
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageAggregateES.xml (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageAggregateES.xml Mon Jun 25 04:54:01 2007
@@ -57,7 +57,8 @@
<outputs>
<type>uima.tt.TokenAnnotation</type>
<type>uima.tt.SentenceAnnotation</type>
- <type>uima.tt.ParagraphAnnotation</type>
+ <type>uima.tt.ParagraphAnnotation</type>
+ <type>uima.tt.DummyAnnotation</type>
</outputs>
<languagesSupported>
<language>x-unspecified</language>
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsAr.txt
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsAr.txt?view=diff&rev=550460&r1=550459&r2=550460
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsAr.txt (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsAr.txt Mon Jun 25 04:54:01 2007
@@ -1,5 +1,6 @@
ResultSpec for annotator Whitespace tokenizer:
+uima.tt.DummyAnnotation
uima.tt.ParagraphAnnotation
uima.tt.SentenceAnnotation
-uima.tt.TokenAnnotation
\ No newline at end of file
+uima.tt.TokenAnnotation
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEn.txt
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEn.txt?view=diff&rev=550460&r1=550459&r2=550460
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEn.txt (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEn.txt Mon Jun 25 04:54:01 2007
@@ -5,3 +5,6 @@
uima.tt.ParagraphAnnotation
uima.tt.SentenceAnnotation
uima.tt.TokenAnnotation
+
+ResultSpec for annotator Whitespace tokenizer:
+uima.tt.DummyAnnotation
\ No newline at end of file
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEnResultSpec.txt
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEnResultSpec.txt?view=diff&rev=550460&r1=550459&r2=550460
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEnResultSpec.txt (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEnResultSpec.txt Mon Jun 25 04:54:01 2007
@@ -5,3 +5,6 @@
uima.tt.ParagraphAnnotation
uima.tt.SentenceAnnotation
uima.tt.TokenAnnotation
+
+ResultSpec for annotator Whitespace tokenizer:
+uima.tt.DummyAnnotation
\ No newline at end of file
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEnUS.txt
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEnUS.txt?view=diff&rev=550460&r1=550459&r2=550460
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEnUS.txt (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsEnUS.txt Mon Jun 25 04:54:01 2007
@@ -5,3 +5,6 @@
uima.tt.ParagraphAnnotation
uima.tt.SentenceAnnotation
uima.tt.TokenAnnotation
+
+ResultSpec for annotator Whitespace tokenizer:
+uima.tt.DummyAnnotation
\ No newline at end of file
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt?view=diff&rev=550460&r1=550459&r2=550460
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsUnknown.txt Mon Jun 25 04:54:01 2007
@@ -1,5 +1,6 @@
ResultSpec for annotator Whitespace tokenizer:
+uima.tt.DummyAnnotation
uima.tt.ParagraphAnnotation
uima.tt.SentenceAnnotation
uima.tt.TokenAnnotation
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsZhCN.txt
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsZhCN.txt?view=diff&rev=550460&r1=550459&r2=550460
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsZhCN.txt (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsZhCN.txt Mon Jun 25 04:54:01 2007
@@ -4,4 +4,7 @@
uima.tt.Lemma
uima.tt.ParagraphAnnotation
uima.tt.SentenceAnnotation
-uima.tt.TokenAnnotation
\ No newline at end of file
+uima.tt.TokenAnnotation
+
+ResultSpec for annotator Whitespace tokenizer:
+uima.tt.DummyAnnotation
\ No newline at end of file
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsZhCNResultSpec.txt
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsZhCNResultSpec.txt?view=diff&rev=550460&r1=550459&r2=550460
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsZhCNResultSpec.txt (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/SequencerCapabilityLanguageExpectedEsZhCNResultSpec.txt Mon Jun 25 04:54:01 2007
@@ -5,3 +5,6 @@
uima.tt.ParagraphAnnotation
uima.tt.SentenceAnnotation
uima.tt.TokenAnnotation
+
+ResultSpec for annotator Whitespace tokenizer:
+uima.tt.DummyAnnotation
\ No newline at end of file
Modified: incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/WhitespaceTokenizer.xml
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/WhitespaceTokenizer.xml?view=diff&rev=550460&r1=550459&r2=550460
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/WhitespaceTokenizer.xml (original)
+++ incubator/uima/uimaj/trunk/uimaj-core/src/test/resources/SequencerTest/WhitespaceTokenizer.xml Mon Jun 25 04:54:01 2007
@@ -1,77 +1,87 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- -->
-
-<taeDescription
- xmlns="http://uima.apache.org/resourceSpecifier">
- <frameworkImplementation>org.apache.uima.java</frameworkImplementation>
- <primitive>true</primitive>
- <annotatorImplementationName>org.apache.uima.analysis_engine.impl.sequencer.SequencerTestAnnotator</annotatorImplementationName>
-
- <analysisEngineMetaData>
- <name>SequencerTestAnnotator</name>
- <description>The simplest possible annotator.</description>
- <version>1.0</version>
- <vendor>The Apache Software Foundation Corporation</vendor>
-
- <configurationParameters>
- <configurationParameter>
- <name>AnnotatorName</name>
- <description>name of the annotator</description>
- <type>String</type>
- <multiValued>false</multiValued>
- <mandatory>false</mandatory>
- </configurationParameter>
- </configurationParameters>
-
- <configurationParameterSettings>
- <nameValuePair>
- <name>AnnotatorName</name>
- <value>
- <string>Whitespace tokenizer</string>
- </value>
- </nameValuePair>
-
- </configurationParameterSettings>
-
- <typeSystemDescription>
- </typeSystemDescription>
-
- <fsIndexes/>
-
- <capabilities>
- <capability>
- <inputs/>
-
- <outputs>
- <type>uima.tt.TokenAnnotation</type>
- <type>uima.tt.SentenceAnnotation</type>
- <type>uima.tt.ParagraphAnnotation</type>
- </outputs>
-
- <languagesSupported>
- <language>x-unspecified</language>
- </languagesSupported>
- </capability>
- </capabilities>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+
+<taeDescription xmlns="http://uima.apache.org/resourceSpecifier">
+ <frameworkImplementation>
+ org.apache.uima.java
+ </frameworkImplementation>
+ <primitive>true</primitive>
+ <annotatorImplementationName>
+ org.apache.uima.analysis_engine.impl.sequencer.SequencerTestAnnotator
+ </annotatorImplementationName>
+
+ <analysisEngineMetaData>
+ <name>SequencerTestAnnotator</name>
+ <description>The simplest possible annotator.</description>
+ <version>1.0</version>
+ <vendor>The Apache Software Foundation Corporation</vendor>
+
+ <configurationParameters>
+ <configurationParameter>
+ <name>AnnotatorName</name>
+ <description>name of the annotator</description>
+ <type>String</type>
+ <multiValued>false</multiValued>
+ <mandatory>false</mandatory>
+ </configurationParameter>
+ </configurationParameters>
+
+ <configurationParameterSettings>
+ <nameValuePair>
+ <name>AnnotatorName</name>
+ <value>
+ <string>Whitespace tokenizer</string>
+ </value>
+ </nameValuePair>
+
+ </configurationParameterSettings>
+
+ <typeSystemDescription>
+ <typeDescription>
+ <name>uima.tt.DummyAnnotation</name>
+ <description></description>
+ <supertypeName>uima.tcas.Annotation</supertypeName>
+ </typeDescription>
+
+ </typeSystemDescription>
+
+ <fsIndexes />
+
+ <capabilities>
+ <capability>
+ <inputs />
+
+ <outputs>
+ <type>uima.tt.TokenAnnotation</type>
+ <type>uima.tt.SentenceAnnotation</type>
+ <type>uima.tt.ParagraphAnnotation</type>
+ <type>uima.tt.DummyAnnotation</type>
+ </outputs>
+
+ <languagesSupported>
+ <language>x-unspecified</language>
+ </languagesSupported>
+ </capability>
+ </capabilities>
- </analysisEngineMetaData>
+ </analysisEngineMetaData>
</taeDescription>