// Check if can get an arbitrary external parameter from the override settings
String contextName = ((UimaContext_ImplBase) aContext).getQualifiedContextName();
if ("/ExternalOverrides/".equals(contextName)) {
String actual = null;
try {
Settings settings = ((UimaContext_ImplBase)aContext).getExternalOverrides();
actual = settings.lookUp("test.externalFloatArray");
} catch (ResourceConfigurationException e) {
Assert.fail(e.getMessage());
}
String expected = "[]";
Assert.assertEquals(expected, actual);
// Test a stand-alone settings object
Settings testSettings = new Settings_impl();
String lines = "foo = ${bar} \n bar : [ok \n OK] \n bad = ${missing}";
InputStream is;
try {
is = new ByteArrayInputStream(lines.getBytes("UTF-8"));
testSettings.load(is);
is.close();
String val = testSettings.lookUp("foo");
Assert.assertEquals("[ok,OK]", val);
try {
val = testSettings.lookUp("bad");
Assert.fail("\"bad\" should create an error");
} catch (ResourceConfigurationException e) {
System.err.println("Expected exception: " + e.toString());
}
} catch (Exception e) {