WW-5078 Uses more informative name for XWorkConfigurationProvider

This commit is contained in:
Lukasz Lenart
2020-11-29 16:00:51 +01:00
parent b4bc5dcf75
commit 8a0cdb4da1
9 changed files with 20 additions and 20 deletions
@@ -19,7 +19,7 @@
package com.opensymphony.xwork2.config;
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
import com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.StrutsConstants;
@@ -85,8 +85,8 @@ public class ConfigurationManager {
/**
* <p>
* Get the current list of ConfigurationProviders. If no custom ConfigurationProviders have been added, this method
* will return a list containing only the default ConfigurationProvider, XMLConfigurationProvider. If a custom
* ConfigurationProvider has been added, then the XmlConfigurationProvider must be added by hand.
* will return a list containing only a default ConfigurationProvider, {@link StrutsDefaultConfigurationProvider}.
* If a custom ConfigurationProvider has been added, then the StrutsDefaultConfigurationProvider must be added by hand.
* </p>
*
* <p>
@@ -100,7 +100,7 @@ public class ConfigurationManager {
providerLock.lock();
try {
if (containerProviders.size() == 0) {
containerProviders.add(new XWorkConfigurationProvider());
containerProviders.add(new StrutsDefaultConfigurationProvider());
}
return containerProviders;
@@ -21,7 +21,7 @@ package com.opensymphony.xwork2.config.impl;
import com.opensymphony.xwork2.config.*;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.entities.UnknownHandlerConfig;
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
import com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.inject.Scope;
@@ -50,7 +50,7 @@ public class MockConfiguration implements Configuration {
//this cannot be done in the constructor, as it causes an infinite loop
builder.factory(Configuration.class, MockConfiguration.class, Scope.SINGLETON);
LocatableProperties props = new LocatableProperties();
new XWorkConfigurationProvider().register(builder, props);
new StrutsDefaultConfigurationProvider().register(builder, props);
builder.constant(StrutsConstants.STRUTS_DEVMODE, "false");
builder.constant(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, "true");
builder.constant(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE, "true");
@@ -123,7 +123,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
public class XWorkConfigurationProvider implements ConfigurationProvider {
public class StrutsDefaultConfigurationProvider implements ConfigurationProvider {
public void destroy() {
}
@@ -20,7 +20,7 @@ package com.opensymphony.xwork2.util;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.config.*;
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
import com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.ContainerBuilder;
@@ -33,7 +33,7 @@ public class XWorkTestCaseHelper {
public static ConfigurationManager setUp() throws Exception {
ConfigurationManager configurationManager = new ConfigurationManager(Container.DEFAULT_NAME);
configurationManager.addContainerProvider(new XWorkConfigurationProvider());
configurationManager.addContainerProvider(new StrutsDefaultConfigurationProvider());
Configuration config = configurationManager.getConfiguration();
Container container = config.getContainer();
@@ -62,7 +62,7 @@ public class XWorkTestCaseHelper {
}
});
configurationManager.addContainerProvider(new XWorkConfigurationProvider());
configurationManager.addContainerProvider(new StrutsDefaultConfigurationProvider());
for (ConfigurationProvider prov : providers) {
if (prov instanceof XmlConfigurationProvider) {
((XmlConfigurationProvider)prov).setThrowExceptionOnDuplicateBeans(false);
@@ -22,7 +22,7 @@ import com.mockobjects.dynamic.C;
import com.mockobjects.dynamic.Mock;
import com.opensymphony.xwork2.FileManagerFactory;
import com.opensymphony.xwork2.XWorkTestCase;
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
import com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
import com.opensymphony.xwork2.conversion.TypeConverterHolder;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.ContainerBuilder;
@@ -168,7 +168,7 @@ public class ConfigurationManagerTest extends XWorkTestCase {
configProviderMock.matchAndReturn("equals", C.ANY_ARGS, false);
ConfigurationProvider mockProvider = (ConfigurationProvider) configProviderMock.proxy();
configurationManager.addContainerProvider(new XWorkConfigurationProvider());
configurationManager.addContainerProvider(new StrutsDefaultConfigurationProvider());
configurationManager.addContainerProvider(mockProvider);
//the first time it always inits
@@ -39,7 +39,7 @@ public class XmlConfigurationProviderGlobalResultInheritenceTest extends Configu
ConfigurationProvider provider = buildConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-global-result-inheritence.xml");
ConfigurationManager configurationManager = new ConfigurationManager(Container.DEFAULT_NAME);
configurationManager.addContainerProvider(new XWorkConfigurationProvider());
configurationManager.addContainerProvider(new StrutsDefaultConfigurationProvider());
configurationManager.addContainerProvider(provider);
Configuration configuration = configurationManager.getConfiguration();
@@ -46,7 +46,7 @@ public class XmlConfigurationProviderInterceptorParamOverridingTest extends XWor
p.setFileManagerFactory(factory);
conf.reloadContainer(new ArrayList<ContainerProvider>() {
{
add(new XWorkConfigurationProvider());
add(new StrutsDefaultConfigurationProvider());
add(p);
}
});
@@ -49,7 +49,7 @@ public class XmlConfigurationProviderInterceptorStackParamOverridingTest extends
configurationManager.addContainerProvider(p);
conf.reloadContainer(new ArrayList<ContainerProvider>() {
{
add(new XWorkConfigurationProvider());
add(new StrutsDefaultConfigurationProvider());
add(p);
}
});
@@ -28,7 +28,7 @@ import com.opensymphony.xwork2.TextProvider;
import com.opensymphony.xwork2.XWorkTestCase;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.providers.MockConfigurationProvider;
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
import com.opensymphony.xwork2.config.providers.StrutsDefaultConfigurationProvider;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
import com.opensymphony.xwork2.mock.MockActionInvocation;
@@ -95,7 +95,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
public void testInsecureParameters() throws Exception {
// given
loadConfigurationProviders(new XWorkConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-param-test.xml"));
loadConfigurationProviders(new StrutsDefaultConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-param-test.xml"));
final Map<String, Object> params = new HashMap<String, Object>() {
{
put("name", "(#context[\"xwork.MethodAccessor.denyMethodExecution\"]= new " +
@@ -132,7 +132,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
final String pollution1 = "class.classLoader.jarPath";
final String pollution2 = "model.class.classLoader.jarPath";
loadConfigurationProviders(new XWorkConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-param-test.xml"));
loadConfigurationProviders(new StrutsDefaultConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-param-test.xml"));
final Map<String, Object> params = new HashMap<String, Object>() {
{
put(pollution1, "bad");
@@ -171,7 +171,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
final String pollution2 = "model.class.classLoader.jarPath";
final String pollution3 = "class.classLoader.defaultAssertionStatus";
loadConfigurationProviders(new XWorkConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-class-param-test.xml"));
loadConfigurationProviders(new StrutsDefaultConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-class-param-test.xml"));
final Map<String, Object> params = new HashMap<String, Object>() {
{
put(pollution1, "bad");
@@ -290,7 +290,7 @@ public class ParametersInterceptorTest extends XWorkTestCase {
final String pollution5 = "class['classLoader']['jarPath']";
final String pollution6 = "class[\"classLoader\"]['jarPath']";
loadConfigurationProviders(new XWorkConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-param-test.xml"));
loadConfigurationProviders(new StrutsDefaultConfigurationProvider(), new StrutsXmlConfigurationProvider("xwork-param-test.xml"));
final Map<String, Object> params = new HashMap<String, Object>() {
{
put(pollution1, "bad");