AnalysisEngineDescription aggDesc = new AnalysisEngineDescription_impl();
aggDesc.setFrameworkImplementation(Constants.JAVA_FRAMEWORK_NAME);
aggDesc.setPrimitive(false);
aggDesc.getMetaData().setName("Test Aggregate TAE");
aggDesc.getDelegateAnalysisEngineSpecifiersWithImports().put("Test", primitiveDesc);
FixedFlow_impl flow = new FixedFlow_impl();
flow.setFixedFlow(new String[] { "Test" });
aggDesc.getAnalysisEngineMetaData().setFlowConstraints(flow);
ConfigurationParameter p2 = new ConfigurationParameter_impl();
p2.setName("StringParam");
p2.setDescription("parameter with String data type");
p2.setType(ConfigurationParameter.TYPE_STRING);
aggDesc.getMetaData().getConfigurationParameterDeclarations().setConfigurationParameters(
new ConfigurationParameter[] { p2 });
aggDesc.getMetaData().getConfigurationParameterSettings().setParameterSettings(
new NameValuePair[] { new NameValuePair_impl("StringParam", "Test3") });
// instantiate TextAnalysisEngine
AggregateAnalysisEngine_impl aggAe = new AggregateAnalysisEngine_impl();
aggAe.initialize(aggDesc, null);
assertEquals("Test3", TestAnnotator.stringParamValue);
// reconfigure
aggAe.setConfigParameterValue("StringParam", "Test4");
aggAe.reconfigure();
// test again
assertEquals("Test4", TestAnnotator.stringParamValue);
// reconfigure WITHOUT setting that parameter
aggAe.reconfigure();
// test again
assertEquals("Test4", TestAnnotator.stringParamValue);
// test aggregate TAE that does NOT override parameter
primitiveDesc.getMetaData().getConfigurationParameterSettings().setParameterSettings(
new NameValuePair[] { new NameValuePair_impl("StringParam", "Test1") });
AnalysisEngineDescription aggDesc2 = new AnalysisEngineDescription_impl();
aggDesc2.setFrameworkImplementation(Constants.JAVA_FRAMEWORK_NAME);
aggDesc2.setPrimitive(false);
aggDesc2.getMetaData().setName("Test Aggregate TAE");
aggDesc2.getDelegateAnalysisEngineSpecifiersWithImports().put("Test", primitiveDesc);
FixedFlow_impl flow2 = new FixedFlow_impl();
flow2.setFixedFlow(new String[] { "Test" });
aggDesc2.getAnalysisEngineMetaData().setFlowConstraints(flow2);
ConfigurationParameter p3 = new ConfigurationParameter_impl();
p3.setName("IntParam");
p3.setDescription("parameter with Integer data type");
p3.setType(ConfigurationParameter.TYPE_INTEGER);