struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [12/24] struts git commit: Puts back the default bean name to allow alias beans
Date Tue, 14 Mar 2017 18:36:05 GMT
Puts back the default bean name to allow alias beans


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/6c19875c
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/6c19875c
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/6c19875c

Branch: refs/heads/master
Commit: 6c19875c786c03a33658f633d5c6a3425bbd5aaf
Parents: 1ab616b
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Thu Mar 9 10:19:12 2017 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Thu Mar 9 10:19:12 2017 +0100

----------------------------------------------------------------------
 .../java/com/opensymphony/xwork2/XWork.java     | 79 --------------------
 .../xwork2/config/ConfigurationManager.java     |  4 -
 .../config/impl/DefaultConfiguration.java       |  7 +-
 .../xwork2/util/XWorkTestCaseHelper.java        |  4 +-
 .../org/apache/struts2/StrutsConstants.java     |  2 +
 .../config/AbstractBeanSelectionProvider.java   |  9 ++-
 .../config/DefaultBeanSelectionProvider.java    |  3 +-
 .../apache/struts2/dispatcher/Dispatcher.java   |  2 +-
 .../xwork2/config/ConfigurationManagerTest.java |  3 +-
 ...tionProviderGlobalResultInheritenceTest.java |  3 +-
 .../struts2/dispatcher/DispatcherTest.java      | 14 ++--
 .../mapper/CompositeActionMapperTest.java       |  4 +-
 .../mapper/DefaultActionMapperTest.java         |  5 +-
 .../mapper/Restful2ActionMapperTest.java        |  3 +-
 .../struts2/rest/RestActionMapperTest.java      |  3 +-
 .../sitegraph/StrutsConfigRetriever.java        |  3 +-
 16 files changed, 39 insertions(+), 109 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/main/java/com/opensymphony/xwork2/XWork.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/XWork.java b/core/src/main/java/com/opensymphony/xwork2/XWork.java
deleted file mode 100644
index 1619a93..0000000
--- a/core/src/main/java/com/opensymphony/xwork2/XWork.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2002-2006,2009 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.opensymphony.xwork2;
-
-import com.opensymphony.xwork2.config.Configuration;
-import com.opensymphony.xwork2.config.ConfigurationManager;
-import com.opensymphony.xwork2.util.logging.LoggerFactory;
-
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * Simple facade to make using XWork standalone easier
- */
-public class XWork {
-    
-    ConfigurationManager configurationManager;
-    
-    public XWork() {
-        this(new ConfigurationManager());
-    }
-    
-    public XWork(ConfigurationManager mgr) {
-        this.configurationManager = mgr;
-    }
-    
-    public void setLoggerFactory(LoggerFactory factory) {
-        LoggerFactory.setLoggerFactory(factory);
-    }
-    
-    /**
-     * Executes an action
-     * 
-     * @param namespace The namespace
-     * @param name The action name
-     * @param method The method name
-     * @throws XWorkException If anything goes wrong
-     */
-    public void executeAction(String namespace, String name, String method) throws XWorkException
{
-        Map<String, Object> extraContext = Collections.emptyMap();
-        executeAction(namespace, name, method, extraContext);
-    }
-    
-    /**
-     * Executes an action with extra context information
-     * 
-     * @param namespace The namespace
-     * @param name The action name
-     * @param method The method name
-     * @param extraContext A map of extra context information
-     * @throws XWorkException If anything goes wrong
-     */
-    public void executeAction(String namespace, String name, String method, Map<String,
Object> extraContext) throws XWorkException {
-        Configuration config = configurationManager.getConfiguration();
-        try {
-            ActionProxy proxy = config.getContainer().getInstance(ActionProxyFactory.class).createActionProxy(
-                    namespace, name, method, extraContext, true, false);
-        
-            proxy.execute();
-        } catch (Exception e) {
-            throw new XWorkException(e);
-        } finally {
-            ActionContext.setContext(null);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java b/core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
index ea51c63..f937e9d 100644
--- a/core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
+++ b/core/src/main/java/com/opensymphony/xwork2/config/ConfigurationManager.java
@@ -47,10 +47,6 @@ public class ConfigurationManager {
     private boolean providersChanged = false;
     private boolean reloadConfigs = true; // for the first time
 
-    public ConfigurationManager() {
-        this("xwork");
-    }
-    
     public ConfigurationManager(String name) {
         this.defaultFrameworkBeanName = name;
     }

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
b/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
index 9830d92..89be0fa 100644
--- a/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
+++ b/core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
@@ -51,11 +51,8 @@ import java.util.*;
  */
 public class DefaultConfiguration implements Configuration {
 
-    public static final String DEFAULT_BEAN_NAME = "struts";
-
     protected static final Logger LOG = LogManager.getLogger(DefaultConfiguration.class);
 
-
     // Programmatic Action Configurations
     protected Map<String, PackageConfig> packageContexts = new LinkedHashMap<>();
     protected RuntimeConfiguration runtimeConfiguration;
@@ -68,7 +65,7 @@ public class DefaultConfiguration implements Configuration {
     ObjectFactory objectFactory;
 
     public DefaultConfiguration() {
-        this(DEFAULT_BEAN_NAME);
+        this(Container.DEFAULT_NAME);
     }
 
     public DefaultConfiguration(String defaultBeanName) {
@@ -266,6 +263,8 @@ public class DefaultConfiguration implements Configuration {
 
         builder.factory(TextParser.class, OgnlTextParser.class, Scope.SINGLETON);
         builder.factory(TextProvider.class, "system", DefaultTextProvider.class, Scope.SINGLETON);
+        builder.factory(TextProvider.class, TextProviderSupport.class, Scope.SINGLETON);
+        builder.factory(LocaleProvider.class, DefaultLocaleProvider.class, Scope.SINGLETON);
 
         builder.factory(ObjectTypeDeterminer.class, DefaultObjectTypeDeterminer.class, Scope.SINGLETON);
         builder.factory(PropertyAccessor.class, CompoundRoot.class.getName(), CompoundRootAccessor.class,
Scope.SINGLETON);

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/main/java/com/opensymphony/xwork2/util/XWorkTestCaseHelper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/util/XWorkTestCaseHelper.java b/core/src/main/java/com/opensymphony/xwork2/util/XWorkTestCaseHelper.java
index 717a3ef..0cabd0f 100644
--- a/core/src/main/java/com/opensymphony/xwork2/util/XWorkTestCaseHelper.java
+++ b/core/src/main/java/com/opensymphony/xwork2/util/XWorkTestCaseHelper.java
@@ -29,7 +29,7 @@ import com.opensymphony.xwork2.util.location.LocatableProperties;
 public class XWorkTestCaseHelper {
 
     public static ConfigurationManager setUp() throws Exception {
-        ConfigurationManager configurationManager = new ConfigurationManager();
+        ConfigurationManager configurationManager = new ConfigurationManager(Container.DEFAULT_NAME);
         configurationManager.addContainerProvider(new XWorkConfigurationProvider());
         Configuration config = configurationManager.getConfiguration();
         Container container = config.getContainer();
@@ -54,7 +54,7 @@ public class XWorkTestCaseHelper {
         } catch (Exception e) {
             throw new RuntimeException("Cannot clean old configuration", e);
         }
-        configurationManager = new ConfigurationManager();
+        configurationManager = new ConfigurationManager(Container.DEFAULT_NAME);
         configurationManager.addContainerProvider(new ContainerProvider() {
             public void destroy() {}
             public void init(Configuration configuration) throws ConfigurationException {}

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/main/java/org/apache/struts2/StrutsConstants.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/StrutsConstants.java b/core/src/main/java/org/apache/struts2/StrutsConstants.java
index c41d542..99eb18e 100644
--- a/core/src/main/java/org/apache/struts2/StrutsConstants.java
+++ b/core/src/main/java/org/apache/struts2/StrutsConstants.java
@@ -306,4 +306,6 @@ public final class StrutsConstants {
     public static final String STRUTS_CONTENT_TYPE_MATCHER = "struts.contentTypeMatcher";
 
     public static final String STRUTS_SMI_METHOD_REGEX = "struts.strictMethodInvocation.methodRegex";
+
+    public static final String STRUTS_LOCALIZED_TEXT_PROVIDER = "struts.localizedTextProvider";
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/main/java/org/apache/struts2/config/AbstractBeanSelectionProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/config/AbstractBeanSelectionProvider.java
b/core/src/main/java/org/apache/struts2/config/AbstractBeanSelectionProvider.java
index f0c691f..664c6f4 100644
--- a/core/src/main/java/org/apache/struts2/config/AbstractBeanSelectionProvider.java
+++ b/core/src/main/java/org/apache/struts2/config/AbstractBeanSelectionProvider.java
@@ -4,7 +4,6 @@ import com.opensymphony.xwork2.ObjectFactory;
 import com.opensymphony.xwork2.config.BeanSelectionProvider;
 import com.opensymphony.xwork2.config.Configuration;
 import com.opensymphony.xwork2.config.ConfigurationException;
-import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
 import com.opensymphony.xwork2.inject.*;
 import com.opensymphony.xwork2.util.ClassLoaderUtil;
 import com.opensymphony.xwork2.util.location.LocatableProperties;
@@ -20,6 +19,8 @@ public abstract class AbstractBeanSelectionProvider implements BeanSelectionProv
 
     private static final Logger LOG = LogManager.getLogger(AbstractBeanSelectionProvider.class);
 
+    public static final String DEFAULT_BEAN_NAME = "struts";
+
     public void destroy() {
         // NO-OP
     }
@@ -41,8 +42,8 @@ public abstract class AbstractBeanSelectionProvider implements BeanSelectionProv
     }
 
     protected void alias(Class type, String key, ContainerBuilder builder, Properties props,
Scope scope) {
-        if (!builder.contains(type)) {
-            String foundName = props.getProperty(key, DefaultConfiguration.DEFAULT_BEAN_NAME);
+        if (!builder.contains(type, Container.DEFAULT_NAME)) {
+            String foundName = props.getProperty(key, DEFAULT_BEAN_NAME);
             if (builder.contains(type, foundName)) {
                 LOG.trace("Choosing bean ({}) for ({})", foundName, type.getName());
                 builder.alias(type, foundName, Container.DEFAULT_NAME);
@@ -54,7 +55,7 @@ public abstract class AbstractBeanSelectionProvider implements BeanSelectionProv
                 } catch (ClassNotFoundException ex) {
                     // Perhaps a spring bean id, so we'll delegate to the object factory
at runtime
                     LOG.trace("Choosing bean ({}) for ({}) to be loaded from the ObjectFactory",
foundName, type.getName());
-                    if (DefaultConfiguration.DEFAULT_BEAN_NAME.equals(foundName)) {
+                    if (DEFAULT_BEAN_NAME.equals(foundName)) {
                         // Probably an optional bean, will ignore
                     } else {
                         if (ObjectFactory.class != type) {

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
b/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
index 20b0f99..b417333 100644
--- a/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
+++ b/core/src/main/java/org/apache/struts2/config/DefaultBeanSelectionProvider.java
@@ -387,8 +387,9 @@ public class DefaultBeanSelectionProvider extends AbstractBeanSelectionProvider
         alias(TypeConverterHolder.class, StrutsConstants.STRUTS_CONVERTER_HOLDER, builder,
props);
 
         alias(TextProvider.class, StrutsConstants.STRUTS_XWORKTEXTPROVIDER, builder, props,
Scope.PROTOTYPE);
-
         alias(LocaleProvider.class, StrutsConstants.STRUTS_LOCALE_PROVIDER, builder, props);
+        alias(LocalizedTextUtil.class, StrutsConstants.STRUTS_LOCALIZED_TEXT_PROVIDER, builder,
props);
+
         alias(ActionProxyFactory.class, StrutsConstants.STRUTS_ACTIONPROXYFACTORY, builder,
props);
         alias(ObjectTypeDeterminer.class, StrutsConstants.STRUTS_OBJECTTYPEDETERMINER, builder,
props);
         alias(ActionMapper.class, StrutsConstants.STRUTS_MAPPER_CLASS, builder, props);

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java b/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
index 98ad701..7b28117 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
@@ -456,7 +456,7 @@ public class Dispatcher {
     public void init() {
 
     	if (configurationManager == null) {
-    		configurationManager = createConfigurationManager(DefaultConfiguration.DEFAULT_BEAN_NAME);
+    		configurationManager = createConfigurationManager(Container.DEFAULT_NAME);
     	}
 
         try {

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/test/java/com/opensymphony/xwork2/config/ConfigurationManagerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/config/ConfigurationManagerTest.java
b/core/src/test/java/com/opensymphony/xwork2/config/ConfigurationManagerTest.java
index e1d81bd..7804f7e 100644
--- a/core/src/test/java/com/opensymphony/xwork2/config/ConfigurationManagerTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/config/ConfigurationManagerTest.java
@@ -22,6 +22,7 @@ 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.inject.Container;
 import com.opensymphony.xwork2.inject.ContainerBuilder;
 import com.opensymphony.xwork2.util.location.LocatableProperties;
 
@@ -73,7 +74,7 @@ public class ConfigurationManagerTest extends XWorkTestCase {
     	}
     	
     	final State state = new State();
-    	ConfigurationManager configurationManager = new ConfigurationManager();
+    	ConfigurationManager configurationManager = new ConfigurationManager(Container.DEFAULT_NAME);
     	configurationManager.addContainerProvider(new ConfigurationProvider() {
 			public void destroy() { 
 				throw new RuntimeException("testing testing 123");

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderGlobalResultInheritenceTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderGlobalResultInheritenceTest.java
b/core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderGlobalResultInheritenceTest.java
index e4553df..6a08349 100644
--- a/core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderGlobalResultInheritenceTest.java
+++ b/core/src/test/java/com/opensymphony/xwork2/config/providers/XmlConfigurationProviderGlobalResultInheritenceTest.java
@@ -6,6 +6,7 @@ import com.opensymphony.xwork2.config.ConfigurationManager;
 import com.opensymphony.xwork2.config.ConfigurationProvider;
 import com.opensymphony.xwork2.config.entities.ActionConfig;
 import com.opensymphony.xwork2.config.entities.ResultConfig;
+import com.opensymphony.xwork2.inject.Container;
 
 /**
  * <code>XmlConfigurationProviderGlobalResultInheritenceTest</code>
@@ -19,7 +20,7 @@ public class XmlConfigurationProviderGlobalResultInheritenceTest extends
Configu
     public void testGlobalResultInheritenceTest() throws Exception {
         ConfigurationProvider provider = buildConfigurationProvider("com/opensymphony/xwork2/config/providers/xwork-test-global-result-inheritence.xml");
 
-        ConfigurationManager configurationManager = new ConfigurationManager();
+        ConfigurationManager configurationManager = new ConfigurationManager(Container.DEFAULT_NAME);
         configurationManager.addContainerProvider(new XWorkConfigurationProvider());
         configurationManager.addContainerProvider(provider);
         Configuration configuration = configurationManager.getConfiguration();

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java b/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
index c0994a5..91b0ebf 100644
--- a/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
+++ b/core/src/test/java/org/apache/struts2/dispatcher/DispatcherTest.java
@@ -175,7 +175,7 @@ public class DispatcherTest extends StrutsInternalTestCase {
     
     public void testConfigurationManager() {
     	Dispatcher du;
-    	final InternalConfigurationManager configurationManager = new InternalConfigurationManager();
+    	final InternalConfigurationManager configurationManager = new InternalConfigurationManager(Container.DEFAULT_NAME);
     	try {
     		du = new MockDispatcher(new MockServletContext(), new HashMap<String, String>(),
configurationManager);
     		du.init();
@@ -196,7 +196,7 @@ public class DispatcherTest extends StrutsInternalTestCase {
     public void testObjectFactoryDestroy() throws Exception {
 
         final InnerDestroyableObjectFactory destroyedObjectFactory = new InnerDestroyableObjectFactory();
-        ConfigurationManager cm = new ConfigurationManager();
+        ConfigurationManager cm = new ConfigurationManager(Container.DEFAULT_NAME);
         Dispatcher du = new MockDispatcher(new MockServletContext(), new HashMap<String,
String>(), cm);
         Mock mockConfiguration = new Mock(Configuration.class);
         cm.setConfiguration((Configuration)mockConfiguration.proxy());
@@ -245,7 +245,7 @@ public class DispatcherTest extends StrutsInternalTestCase {
         mockConfiguration.matchAndReturn("getContainer", mockContainer.proxy());
         mockConfiguration.expect("destroy");
         
-        ConfigurationManager configurationManager = new ConfigurationManager();
+        ConfigurationManager configurationManager = new ConfigurationManager(Container.DEFAULT_NAME);
         configurationManager.setConfiguration((Configuration) mockConfiguration.proxy());
         
         Dispatcher dispatcher = new MockDispatcher(new MockServletContext(), new HashMap<String,
String>(), configurationManager);
@@ -259,8 +259,12 @@ public class DispatcherTest extends StrutsInternalTestCase {
     
     class InternalConfigurationManager extends ConfigurationManager {
     	public boolean destroyConfiguration = false;
-    	
-    	@Override
+
+        public InternalConfigurationManager(String name) {
+            super(name);
+        }
+
+        @Override
     	public synchronized void destroyConfiguration() {
     		super.destroyConfiguration();
     		destroyConfiguration = true;

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/test/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapperTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapperTest.java
b/core/src/test/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapperTest.java
index acd18bb..558ba67 100644
--- a/core/src/test/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapperTest.java
+++ b/core/src/test/java/org/apache/struts2/dispatcher/mapper/CompositeActionMapperTest.java
@@ -51,7 +51,7 @@ public class CompositeActionMapperTest extends TestCase {
         mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper3")),
mapper2);
         CompositeActionMapper compositeActionMapper = new CompositeActionMapper((Container)
mockContainer.proxy(), "mapper1,mapper2,mapper3");
         
-        ActionMapping actionMapping = compositeActionMapper.getMapping(new MockHttpServletRequest(),
new ConfigurationManager());
+        ActionMapping actionMapping = compositeActionMapper.getMapping(new MockHttpServletRequest(),
new ConfigurationManager(Container.DEFAULT_NAME));
         String uri = compositeActionMapper.getUriFromActionMapping(new ActionMapping());
         mockContainer.verify();
         
@@ -69,7 +69,7 @@ public class CompositeActionMapperTest extends TestCase {
         mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper2")),
mapper2);
         CompositeActionMapper compositeActionMapper = new CompositeActionMapper((Container)
mockContainer.proxy(), "mapper1,mapper2");
 
-        ActionMapping actionMapping = compositeActionMapper.getMapping(new MockHttpServletRequest(),
new ConfigurationManager());
+        ActionMapping actionMapping = compositeActionMapper.getMapping(new MockHttpServletRequest(),
new ConfigurationManager(Container.DEFAULT_NAME));
         String uri = compositeActionMapper.getUriFromActionMapping(new ActionMapping());
         mockContainer.verify();
 

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java
b/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java
index 2008e38..45bd6a2 100644
--- a/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java
+++ b/core/src/test/java/org/apache/struts2/dispatcher/mapper/DefaultActionMapperTest.java
@@ -29,6 +29,7 @@ import com.opensymphony.xwork2.config.Configuration;
 import com.opensymphony.xwork2.config.ConfigurationManager;
 import com.opensymphony.xwork2.config.entities.PackageConfig;
 import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
+import com.opensymphony.xwork2.inject.Container;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.StrutsException;
 import org.apache.struts2.StrutsInternalTestCase;
@@ -61,7 +62,7 @@ public class DefaultActionMapperTest extends StrutsInternalTestCase {
         PackageConfig pkg2 = new PackageConfig.Builder("my").namespace("/my").build();
         config.addPackageConfig("mvns", pkg);
         config.addPackageConfig("my", pkg2);
-        configManager = new ConfigurationManager() {
+        configManager = new ConfigurationManager(Container.DEFAULT_NAME) {
             public Configuration getConfiguration() {
                 return config;
             }
@@ -139,7 +140,7 @@ public class DefaultActionMapperTest extends StrutsInternalTestCase {
         config.addPackageConfig("mvns", pkg);
         config.addPackageConfig("my", pkg2);
         config.addPackageConfig("root", pkg3);
-        configManager = new ConfigurationManager() {
+        configManager = new ConfigurationManager(Container.DEFAULT_NAME) {
             public Configuration getConfiguration() {
                 return config;
             }

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/core/src/test/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapperTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapperTest.java
b/core/src/test/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapperTest.java
index 140ad64..42b95a3 100644
--- a/core/src/test/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapperTest.java
+++ b/core/src/test/java/org/apache/struts2/dispatcher/mapper/Restful2ActionMapperTest.java
@@ -21,6 +21,7 @@
 
 package org.apache.struts2.dispatcher.mapper;
 
+import com.opensymphony.xwork2.inject.Container;
 import org.apache.struts2.StrutsInternalTestCase;
 import com.mockobjects.servlet.MockHttpServletRequest;
 import com.opensymphony.xwork2.config.ConfigurationManager;
@@ -53,7 +54,7 @@ public class Restful2ActionMapperTest extends StrutsInternalTestCase {
             .namespace("/my").build();
         config.addPackageConfig("mvns", pkg);
         config.addPackageConfig("my", pkg2);
-        configManager = new ConfigurationManager() {
+        configManager = new ConfigurationManager(Container.DEFAULT_NAME) {
             public Configuration getConfiguration() {
                 return config;
             }

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
----------------------------------------------------------------------
diff --git a/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
b/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
index 5492816..8bfe159 100644
--- a/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
+++ b/plugins/rest/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java
@@ -25,6 +25,7 @@ import com.opensymphony.xwork2.config.Configuration;
 import com.opensymphony.xwork2.config.ConfigurationManager;
 import com.opensymphony.xwork2.config.entities.PackageConfig;
 import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
+import com.opensymphony.xwork2.inject.Container;
 import junit.framework.TestCase;
 import org.apache.struts2.dispatcher.mapper.ActionMapping;
 import org.springframework.mock.web.MockHttpServletRequest;
@@ -50,7 +51,7 @@ public class RestActionMapperTest extends TestCase {
         PackageConfig pkg2 = new PackageConfig.Builder("my").namespace("/my").build();
         config.addPackageConfig("mvns", pkg);
         config.addPackageConfig("my", pkg2);
-        configManager = new ConfigurationManager() {
+        configManager = new ConfigurationManager(Container.DEFAULT_NAME) {
             public Configuration getConfiguration() {
                 return config;
             }

http://git-wip-us.apache.org/repos/asf/struts/blob/6c19875c/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/StrutsConfigRetriever.java
----------------------------------------------------------------------
diff --git a/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/StrutsConfigRetriever.java
b/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/StrutsConfigRetriever.java
index 1e6b245..8e70109 100644
--- a/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/StrutsConfigRetriever.java
+++ b/plugins/sitegraph/src/main/java/org/apache/struts2/sitegraph/StrutsConfigRetriever.java
@@ -25,6 +25,7 @@ import com.opensymphony.xwork2.config.ConfigurationManager;
 import com.opensymphony.xwork2.config.ConfigurationProvider;
 import com.opensymphony.xwork2.config.entities.ActionConfig;
 import com.opensymphony.xwork2.config.entities.ResultConfig;
+import com.opensymphony.xwork2.inject.Container;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.LogManager;
 import org.apache.struts2.config.DefaultBeanSelectionProvider;
@@ -71,7 +72,7 @@ public class StrutsConfigRetriever {
         File configFile = new File(configFilePath);
         try {
             ConfigurationProvider configProvider = new StrutsXmlConfigurationProvider(configFile.getCanonicalPath(),
true, null);
-            cm = new ConfigurationManager();
+            cm = new ConfigurationManager(Container.DEFAULT_NAME);
             cm.addContainerProvider(new DefaultPropertiesProvider());
             cm.addContainerProvider(new StrutsXmlConfigurationProvider("struts-default.xml",
false, null));
             cm.addContainerProvider(configProvider);


Mime
View raw message