Search in sources :

Example 1 with DummyTextProvider

use of com.opensymphony.xwork2.mock.DummyTextProvider in project struts by apache.

the class ObjectFactoryTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    this.loadButAdd(TextProvider.class, new DummyTextProvider());
}
Also used : DummyTextProvider(com.opensymphony.xwork2.mock.DummyTextProvider)

Example 2 with DummyTextProvider

use of com.opensymphony.xwork2.mock.DummyTextProvider in project struts by apache.

the class ObjectFactoryTest method testCreatingActionsWithInjectableParametersInConstructor.

public void testCreatingActionsWithInjectableParametersInConstructor() throws Exception {
    // given
    ObjectFactory of = container.getInstance(ObjectFactory.class);
    // when
    InjectableAction action = (InjectableAction) of.buildBean(InjectableAction.class, new HashMap<String, Object>());
    // then
    assertNotNull(action.getTextProvider());
    assertTrue(action.getTextProvider() instanceof DummyTextProvider);
}
Also used : DummyTextProvider(com.opensymphony.xwork2.mock.DummyTextProvider) HashMap(java.util.HashMap) InjectableAction(com.opensymphony.xwork2.mock.InjectableAction)

Aggregations

DummyTextProvider (com.opensymphony.xwork2.mock.DummyTextProvider)2 InjectableAction (com.opensymphony.xwork2.mock.InjectableAction)1 HashMap (java.util.HashMap)1