Search in sources :

Example 11 with MockConfigurationProvider

use of com.opensymphony.xwork2.config.providers.MockConfigurationProvider in project struts by apache.

the class DateRangeValidatorTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    loadConfigurationProviders(new MockConfigurationProvider());
}
Also used : MockConfigurationProvider(com.opensymphony.xwork2.config.providers.MockConfigurationProvider)

Example 12 with MockConfigurationProvider

use of com.opensymphony.xwork2.config.providers.MockConfigurationProvider in project struts by apache.

the class ExpressionValidatorTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    loadConfigurationProviders(new MockConfigurationProvider());
    ActionConfig config = new ActionConfig.Builder("", "name", "").build();
    ActionInvocation invocation = EasyMock.createNiceMock(ActionInvocation.class);
    ActionProxy proxy = EasyMock.createNiceMock(ActionProxy.class);
    EasyMock.expect(invocation.getProxy()).andReturn(proxy).anyTimes();
    EasyMock.expect(invocation.getAction()).andReturn(null).anyTimes();
    EasyMock.expect(invocation.invoke()).andReturn(Action.SUCCESS).anyTimes();
    EasyMock.expect(proxy.getMethod()).andReturn("execute").anyTimes();
    EasyMock.expect(proxy.getConfig()).andReturn(config).anyTimes();
    EasyMock.replay(invocation);
    EasyMock.replay(proxy);
    ActionContext.getContext().withActionInvocation(invocation);
    tpf = container.getInstance(TextProviderFactory.class);
}
Also used : ActionConfig(com.opensymphony.xwork2.config.entities.ActionConfig) MockConfigurationProvider(com.opensymphony.xwork2.config.providers.MockConfigurationProvider)

Example 13 with MockConfigurationProvider

use of com.opensymphony.xwork2.config.providers.MockConfigurationProvider in project struts by apache.

the class IntRangeValidatorTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-test-beans.xml");
    container.inject(provider);
    loadConfigurationProviders(provider, new MockConfigurationProvider());
}
Also used : StrutsXmlConfigurationProvider(org.apache.struts2.config.StrutsXmlConfigurationProvider) XmlConfigurationProvider(com.opensymphony.xwork2.config.providers.XmlConfigurationProvider) StrutsXmlConfigurationProvider(org.apache.struts2.config.StrutsXmlConfigurationProvider) MockConfigurationProvider(com.opensymphony.xwork2.config.providers.MockConfigurationProvider)

Example 14 with MockConfigurationProvider

use of com.opensymphony.xwork2.config.providers.MockConfigurationProvider in project struts by apache.

the class ShortRangeValidatorTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-test-beans.xml");
    container.inject(provider);
    loadConfigurationProviders(provider, new MockConfigurationProvider());
}
Also used : StrutsXmlConfigurationProvider(org.apache.struts2.config.StrutsXmlConfigurationProvider) XmlConfigurationProvider(com.opensymphony.xwork2.config.providers.XmlConfigurationProvider) StrutsXmlConfigurationProvider(org.apache.struts2.config.StrutsXmlConfigurationProvider) MockConfigurationProvider(com.opensymphony.xwork2.config.providers.MockConfigurationProvider)

Example 15 with MockConfigurationProvider

use of com.opensymphony.xwork2.config.providers.MockConfigurationProvider in project struts by apache.

the class ValidateAction method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    XmlConfigurationProvider provider = new StrutsXmlConfigurationProvider("xwork-test-beans.xml");
    container.inject(provider);
    loadConfigurationProviders(provider, new MockConfigurationProvider());
    ActionConfig config = configuration.getRuntimeConfiguration().getActionConfig("", MockConfigurationProvider.PARAM_INTERCEPTOR_ACTION_NAME);
    container.inject(config.getInterceptors().get(0).getInterceptor());
}
Also used : ActionConfig(com.opensymphony.xwork2.config.entities.ActionConfig) StrutsXmlConfigurationProvider(org.apache.struts2.config.StrutsXmlConfigurationProvider) StrutsXmlConfigurationProvider(org.apache.struts2.config.StrutsXmlConfigurationProvider) XmlConfigurationProvider(com.opensymphony.xwork2.config.providers.XmlConfigurationProvider) MockConfigurationProvider(com.opensymphony.xwork2.config.providers.MockConfigurationProvider)

Aggregations

MockConfigurationProvider (com.opensymphony.xwork2.config.providers.MockConfigurationProvider)13 XmlConfigurationProvider (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider)11 StrutsXmlConfigurationProvider (org.apache.struts2.config.StrutsXmlConfigurationProvider)11 ActionConfig (com.opensymphony.xwork2.config.entities.ActionConfig)5 ActionProxy (com.opensymphony.xwork2.ActionProxy)3 TextProviderFactory (com.opensymphony.xwork2.TextProviderFactory)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 ActionInvocation (com.opensymphony.xwork2.ActionInvocation)1 ObjectFactory (com.opensymphony.xwork2.ObjectFactory)1 SimpleAction (com.opensymphony.xwork2.SimpleAction)1 ValueStack (com.opensymphony.xwork2.util.ValueStack)1 ValueStackFactory (com.opensymphony.xwork2.util.ValueStackFactory)1 DoubleRangeFieldValidator (com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator)1