use of com.opensymphony.xwork2.config.ConfigurationProvider in project struts by apache.
the class WildCardResultTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
// ensure we're using the default configuration, not simple config
XmlConfigurationProvider configurationProvider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
container.inject(configurationProvider);
loadConfigurationProviders(configurationProvider);
}
use of com.opensymphony.xwork2.config.ConfigurationProvider in project struts by apache.
the class ConfigurationManagerTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
configurationManager.destroyConfiguration();
configProviderMock = new Mock(ConfigurationProvider.class);
configProviderMock.matchAndReturn("equals", C.ANY_ARGS, false);
ConfigurationProvider mockProvider = (ConfigurationProvider) configProviderMock.proxy();
configurationManager.addContainerProvider(new StrutsDefaultConfigurationProvider());
configurationManager.addContainerProvider(mockProvider);
// the first time it always inits
configProviderMock.expect("init", C.isA(Configuration.class));
configProviderMock.expect("register", C.ANY_ARGS);
configProviderMock.expect("loadPackages", C.ANY_ARGS);
configProviderMock.matchAndReturn("toString", "mock");
configuration = configurationManager.getConfiguration();
}
use of com.opensymphony.xwork2.config.ConfigurationProvider in project struts by apache.
the class DefaultActionInvocationTester method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
// ensure we're using the default configuration, not simple config
XmlConfigurationProvider configurationProvider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
container.inject(configurationProvider);
loadConfigurationProviders(configurationProvider);
}
use of com.opensymphony.xwork2.config.ConfigurationProvider in project struts by apache.
the class DefaultClasstTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
// ensure we're using the default configuration, not simple config
XmlConfigurationProvider configurationProvider = new StrutsXmlConfigurationProvider("xwork-sample.xml");
container.inject(configurationProvider);
loadConfigurationProviders(configurationProvider);
}
use of com.opensymphony.xwork2.config.ConfigurationProvider in project struts by apache.
the class XmlConfigurationProviderActionsTest method testDefaultActionClass.
public void testDefaultActionClass() throws Exception {
final String filename = "com/opensymphony/xwork2/config/providers/xwork-test-actions.xml";
final String testDefaultClassName = "com.opensymphony.xwork2.ActionSupport";
ConfigurationProvider provider = buildConfigurationProvider(filename);
// setup expectations
params.put("foo", "17");
params.put("bar", "23");
ActionConfig barWithoutClassNameConfig = new ActionConfig.Builder("", "BarWithoutClassName", "").addParams(params).build();
// execute the configuration
provider.init(configuration);
PackageConfig pkg = configuration.getPackageConfig("default");
Map actionConfigs = pkg.getActionConfigs();
// assertions
assertEquals(7, actionConfigs.size());
assertEquals(barWithoutClassNameConfig, actionConfigs.get("BarWithoutClassName"));
}
Aggregations