use of com.opensymphony.xwork2.UnknownHandler in project struts by apache.
the class UnknownHandlerManagerTest method testEmptyStack.
public void testEmptyStack() throws ConfigurationException {
final String filename = "com/opensymphony/xwork2/config/providers/xwork-unknownhandler-stack-empty.xml";
ConfigurationProvider provider = buildConfigurationProvider(filename);
loadConfigurationProviders(provider);
configurationManager.reload();
UnknownHandlerManager unknownHandlerManager = new DefaultUnknownHandlerManager();
container.inject(unknownHandlerManager);
List<UnknownHandler> unknownHandlers = unknownHandlerManager.getUnknownHandlers();
assertNotNull(unknownHandlers);
assertEquals(2, unknownHandlers.size());
UnknownHandler uh1 = unknownHandlers.get(0);
UnknownHandler uh2 = unknownHandlers.get(1);
assertTrue(uh1 instanceof SomeUnknownHandler);
assertTrue(uh2 instanceof SomeUnknownHandler);
}
use of com.opensymphony.xwork2.UnknownHandler in project struts by apache.
the class XmlConfigurationProviderUnknownHandlerStackTest method testStackWithElements.
public void testStackWithElements() throws ConfigurationException {
final String filename = "com/opensymphony/xwork2/config/providers/xwork-unknownhandler-stack.xml";
ConfigurationProvider provider = buildConfigurationProvider(filename);
loadConfigurationProviders(provider);
configurationManager.reload();
List<UnknownHandlerConfig> unknownHandlerStack = configuration.getUnknownHandlerStack();
assertNotNull(unknownHandlerStack);
assertEquals(2, unknownHandlerStack.size());
assertEquals("uh1", unknownHandlerStack.get(0).getName());
assertEquals("uh2", unknownHandlerStack.get(1).getName());
UnknownHandlerManager unknownHandlerManager = new DefaultUnknownHandlerManager();
container.inject(unknownHandlerManager);
assertTrue(unknownHandlerManager.hasUnknownHandlers());
}
Aggregations