resourceLookupKey,
new ResourceLookup(new DirLocator(tempDir1.getPath()), classpathLocator),
resourceReloadKey,
true));
final ProcessingResult result = ctrl1.process(
Collections.<String, Object> emptyMap(), TestComponent.class);
final ILexicalData data = result.getAttribute("english");
assertTrue(data.isCommonWord(new MutableCharArray("uniquea")));
assertFalse(data.isCommonWord(new MutableCharArray("uniqueb")));
}
// Create pooling controller, use tempDir2
final Controller ctrl2 = ControllerFactory.createPooling();
{
ctrl2.init(ImmutableMap.<String, Object> of(resourceLookupKey,
new ResourceLookup(new DirLocator(tempDir2.getPath()), classpathLocator)));
final ProcessingResult result = ctrl2.process(
Collections.<String, Object> emptyMap(), TestComponent.class);
final ILexicalData data = result.getAttribute("english");
assertFalse(data.isCommonWord(new MutableCharArray("uniquea")));
assertTrue(data.isCommonWord(new MutableCharArray("uniqueb")));
}
// Now, reuse the first controller, nothing should change.
{
final ProcessingResult result = ctrl1.process(
Collections.<String, Object> emptyMap(), TestComponent.class);
final ILexicalData data = result.getAttribute("english");
assertTrue(data.isCommonWord(new MutableCharArray("uniquea")));
assertFalse(data.isCommonWord(new MutableCharArray("uniqueb")));
}
}