AnalysisEngineDescription primitiveDesc = new AnalysisEngineDescription_impl();
primitiveDesc.setPrimitive(true);
primitiveDesc
.setAnnotatorImplementationName("org.apache.uima.analysis_engine.impl.TestAnnotator");
primitiveDesc.getMetaData().setName("Reconfigure Test 1");
ConfigurationParameter p1 = new ConfigurationParameter_impl();
p1.setName("StringParam");
p1.setDescription("parameter with String data type");
p1.setType(ConfigurationParameter.TYPE_STRING);
primitiveDesc.getMetaData().getConfigurationParameterDeclarations()
.setConfigurationParameters(new ConfigurationParameter[] { p1 });
primitiveDesc.getMetaData().getConfigurationParameterSettings().setParameterSettings(
new NameValuePair[] { new NameValuePair_impl("StringParam", "Test1") });
// instantiate MultiprocessingTextAnalysisEngine
MultiprocessingAnalysisEngine_impl tae = new MultiprocessingAnalysisEngine_impl();
tae.initialize(primitiveDesc, null);
// check value of string param (TestAnnotator saves it in a static field)
assertEquals("Test1", TestAnnotator.stringParamValue);
// reconfigure
tae.setConfigParameterValue("StringParam", "Test2");
tae.reconfigure();
// test again
assertEquals("Test2", TestAnnotator.stringParamValue);
// test aggregate TAE
AnalysisEngineDescription aggDesc = new AnalysisEngineDescription_impl();
aggDesc.setFrameworkImplementation(Constants.JAVA_FRAMEWORK_NAME);
aggDesc.setPrimitive(false);
aggDesc.getDelegateAnalysisEngineSpecifiersWithImports().put("Test", primitiveDesc);
aggDesc.getMetaData().setName("Reconfigure Test 2");
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);
p2.setOverrides(new String[] {"Test/StringParam"});
aggDesc.getMetaData().getConfigurationParameterDeclarations().setConfigurationParameters(
new ConfigurationParameter[] { p2 });
aggDesc.getMetaData().getConfigurationParameterSettings().setParameterSettings(
new NameValuePair[] { new NameValuePair_impl("StringParam", "Test3") });
// instantiate TextAnalysisEngine