struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From musa...@apache.org
Subject svn commit: r659138 - in /struts/sandbox/trunk/struts2-convention-plugin/src: main/java/org/apache/struts2/convention/ main/java/org/apache/struts2/convention/annotation/ test/java/org/apache/struts2/convention/ test/java/org/apache/struts2/convention/...
Date Thu, 22 May 2008 15:43:11 GMT
Author: musachy
Date: Thu May 22 08:43:10 2008
New Revision: 659138

URL: http://svn.apache.org/viewvc?rev=659138&view=rev
Log:
Add @Namespaces annotation
set svn:keywords in files that are missing it

Added:
    struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/Namespaces.java
  (with props)
    struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace3/
    struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace3/ActionLevelNamespacesAction.java
  (with props)
    struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/
    struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/ActionAndPackageLevelNamespacesAction.java
  (with props)
    struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/package-info.java
  (with props)
Modified:
    struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java
  (contents, props changed)
    struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/InterceptorMapBuilder.java
  (contents, props changed)
    struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
    struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMapping.java
  (contents, props changed)
    struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMappings.java
  (contents, props changed)
    struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/InterceptorRef.java
  (props changed)
    struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/InterceptorRefs.java
  (props changed)
    struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/PackageBasedActionConfigBuilderTest.java
    struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsActionLevelAction.java
  (contents, props changed)
    struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsMethodLevelAction.java
  (contents, props changed)
    struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/params/ActionParamsMethodLevelAction.java
  (contents, props changed)

Modified: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java?rev=659138&r1=659137&r2=659138&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java
(original)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java
Thu May 22 08:43:10 2008
@@ -1,5 +1,5 @@
 /*
- * $ID$
+ * $Id$
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/InterceptorMapBuilder.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/InterceptorMapBuilder.java?rev=659138&r1=659137&r2=659138&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/InterceptorMapBuilder.java
(original)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/InterceptorMapBuilder.java
Thu May 22 08:43:10 2008
@@ -1,5 +1,5 @@
 /*
- * $ID$
+ * $Id$
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/InterceptorMapBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java?rev=659138&r1=659137&r2=659138&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
(original)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
Thu May 22 08:43:10 2008
@@ -39,6 +39,7 @@
 import org.apache.struts2.convention.annotation.ExceptionMappings;
 import org.apache.struts2.convention.annotation.InterceptorRef;
 import org.apache.struts2.convention.annotation.Namespace;
+import org.apache.struts2.convention.annotation.Namespaces;
 import org.apache.struts2.convention.annotation.ParentPackage;
 
 import com.opensymphony.xwork2.ObjectFactory;
@@ -291,64 +292,66 @@
             }
 
             // Determine the default namespace and action name
-            String defaultActionNamespace = determineActionNamespace(actionClass);
-            String defaultActionName = determineActionName(actionClass);
-            String defaultActionMethod = "execute";
-            PackageConfig.Builder defaultPackageConfig = getPackageConfig(packageConfigs,
defaultActionNamespace,
-                actionPackage, actionClass, null);
-
-            // Verify that the annotations have no errors and also determine if the default
action
-            // configuration should still be built or not.
-            Map<String, List<Action>> map = getActionAnnotations(actionClass);
-            Set<String> actionNames = new HashSet<String>();
-            if (!map.containsKey(defaultActionMethod) && ReflectionTools.containsMethod(actionClass,
defaultActionMethod)) {
-                boolean found = false;
-                for (String method : map.keySet()) {
-                    List<Action> actions = map.get(method);
-                    for (Action action : actions) {
-
-                        // Check if there are duplicate action names in the annotations.
-                        String actionName = action.value().equals(Action.DEFAULT_VALUE) ?
defaultActionName : action.value();
-                        if (actionNames.contains(actionName)) {
-                            throw new ConfigurationException("The action class [" + actionClass
+
-                                "] contains two methods with an action name annotation whose
value " +
-                                "is the same (they both might be empty as well).");
-                        } else {
-                            actionNames.add(actionName);
+            List<String> namespaces = determineActionNamespace(actionClass);
+            for (String namespace : namespaces) {
+                String defaultActionName = determineActionName(actionClass);
+                String defaultActionMethod = "execute";
+                PackageConfig.Builder defaultPackageConfig = getPackageConfig(packageConfigs,
namespace,
+                    actionPackage, actionClass, null);
+
+                // Verify that the annotations have no errors and also determine if the default
action
+                // configuration should still be built or not.
+                Map<String, List<Action>> map = getActionAnnotations(actionClass);
+                Set<String> actionNames = new HashSet<String>();
+                if (!map.containsKey(defaultActionMethod) && ReflectionTools.containsMethod(actionClass,
defaultActionMethod)) {
+                    boolean found = false;
+                    for (String method : map.keySet()) {
+                        List<Action> actions = map.get(method);
+                        for (Action action : actions) {
+
+                            // Check if there are duplicate action names in the annotations.
+                            String actionName = action.value().equals(Action.DEFAULT_VALUE)
? defaultActionName : action.value();
+                            if (actionNames.contains(actionName)) {
+                                throw new ConfigurationException("The action class [" + actionClass
+
+                                    "] contains two methods with an action name annotation
whose value " +
+                                    "is the same (they both might be empty as well).");
+                            } else {
+                                actionNames.add(actionName);
+                            }
+
+                            // Check this annotation is the default action
+                            if (action.value().equals(Action.DEFAULT_VALUE)) {
+                                found = true;
+                            }
                         }
+                    }
 
-                        // Check this annotation is the default action
-                        if (action.value().equals(Action.DEFAULT_VALUE)) {
-                            found = true;
-                        }
+                    // Build the default
+                    if (!found) {
+                        createActionConfig(defaultPackageConfig, actionClass, defaultActionName,
defaultActionMethod, null);
                     }
                 }
 
-                // Build the default
-                if (!found) {
-                    createActionConfig(defaultPackageConfig, actionClass, defaultActionName,
defaultActionMethod, null);
-                }
-            }
+                // Build the actions for the annotations
+                for (String method : map.keySet()) {
+                    List<Action> actions = map.get(method);
+                    for (Action action : actions) {
+                        PackageConfig.Builder pkgCfg = defaultPackageConfig;
+                        if (action.value().contains("/")) {
+                            pkgCfg = getPackageConfig(packageConfigs, namespace, actionPackage,
+                                actionClass, action);
+                        }
 
-            // Build the actions for the annotations
-            for (String method : map.keySet()) {
-                List<Action> actions = map.get(method);
-                for (Action action : actions) {
-                    PackageConfig.Builder pkgCfg = defaultPackageConfig;
-                    if (action.value().contains("/")) {
-                        pkgCfg = getPackageConfig(packageConfigs, defaultActionNamespace,
actionPackage,
-                            actionClass, action);
+                        createActionConfig(pkgCfg, actionClass, defaultActionName, method,
action);
                     }
-
-                    createActionConfig(pkgCfg, actionClass, defaultActionName, method, action);
                 }
-            }
 
-            // some actions will not have any @Action or a default method, like the rest
actions
-            // where the action mapper is the one that finds the right method at runtime
-            if (map.isEmpty() && mapAllMatches) {
-                Action actionAnnotation = actionClass.getAnnotation(Action.class);
-                createActionConfig(defaultPackageConfig, actionClass, defaultActionName,
null, actionAnnotation);
+                // some actions will not have any @Action or a default method, like the rest
actions
+                // where the action mapper is the one that finds the right method at runtime
+                if (map.isEmpty() && mapAllMatches) {
+                    Action actionAnnotation = actionClass.getAnnotation(Action.class);
+                    createActionConfig(defaultPackageConfig, actionClass, defaultActionName,
null, actionAnnotation);
+                }
             }
         }
 
@@ -362,7 +365,7 @@
     }
 
     /**
-     * Determines the namespace for the action based on the action class. If there is a {@link
Namespace}
+     * Determines the namespace(s) for the action based on the action class. If there is
a {@link Namespace}
      * annotation on the class (including parent classes) or on the package that the class
is in, than
      * it is used. Otherwise, the Java package name that the class is in is used in conjunction
with
      * either the <b>struts.convention.action.packages</b> or <b>struts.convention.package.locators</b>
@@ -372,17 +375,39 @@
      * @param   actionClass The action class.
      * @return  The namespace or an empty string.
      */
-    protected String determineActionNamespace(Class<?> actionClass) {
+    protected List<String> determineActionNamespace(Class<?> actionClass) {
+        List<String> namespaces = new ArrayList<String>();
+
         // Check if there is a class or package level annotation for the namespace
-        Namespace ns = AnnotationTools.findAnnotation(actionClass, Namespace.class);
-        if (ns != null) {
+        //single namespace
+        Namespace namespaceAnnotation = AnnotationTools.findAnnotation(actionClass, Namespace.class);
+        if (namespaceAnnotation != null) {
             if (LOG.isTraceEnabled()) {
-                LOG.trace("Using non-default action namespace from Namespace annotation of
[#0]", ns.value());
+                LOG.trace("Using non-default action namespace from Namespace annotation of
[#0]", namespaceAnnotation.value());
             }
 
-            return ns.value();
+            namespaces.add(namespaceAnnotation.value());
         }
 
+        //multiple annotations
+        Namespaces namespacesAnnotation = AnnotationTools.findAnnotation(actionClass, Namespaces.class);
+        if (namespacesAnnotation != null) {
+            if (LOG.isTraceEnabled()) {
+                StringBuilder sb = new StringBuilder();
+                for (Namespace namespace : namespacesAnnotation.value())
+                    sb.append(namespace.value()).append(",");
+                sb.deleteCharAt(sb.length() - 1);
+                LOG.trace("Using non-default action namespaces from Namespaces annotation
of [#0]", sb.toString());
+            }
+
+            for (Namespace namespace : namespacesAnnotation.value())
+                namespaces.add(namespace.value());
+        }
+
+        //don't use default if there are annotations
+        if (!namespaces.isEmpty())
+            return namespaces;
+
         String pkg = actionClass.getPackage().getName();
         String pkgPart = null;
         if (actionPackages != null) {
@@ -409,11 +434,13 @@
             final int indexOfDot = pkgPart.lastIndexOf('.');
             if (indexOfDot >= 0) {
                 String convertedNamespace = actionNameBuilder.build(pkgPart.substring(0,
indexOfDot));
-                return "/" + convertedNamespace.replace('.', '/');
+                namespaces.add("/" + convertedNamespace.replace('.', '/'));
+                return namespaces;
             }
         }
 
-        return "";
+        namespaces.add("");
+        return namespaces;
     }
 
     /**

Modified: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMapping.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMapping.java?rev=659138&r1=659137&r2=659138&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMapping.java
(original)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMapping.java
Thu May 22 08:43:10 2008
@@ -1,5 +1,5 @@
 /*
- * $ID$
+ * $Id$
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMapping.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMappings.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMappings.java?rev=659138&r1=659137&r2=659138&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMappings.java
(original)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMappings.java
Thu May 22 08:43:10 2008
@@ -1,5 +1,5 @@
 /*
- * $ID$
+ * $Id$
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/ExceptionMappings.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/InterceptorRef.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/InterceptorRefs.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/Namespaces.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/Namespaces.java?rev=659138&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/Namespaces.java
(added)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/Namespaces.java
Thu May 22 08:43:10 2008
@@ -0,0 +1,39 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.struts2.convention.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * <!-- START SNIPPET: javadoc -->
+ * <p>
+ * This annotation allows actions to be defined in more than one {@link Namespace}
+ * </p>
+ * <!-- END SNIPPET: javadoc -->
+ */
+@Target({ElementType.PACKAGE, ElementType.TYPE})
+@Retention(value = RetentionPolicy.RUNTIME)
+public @interface Namespaces {
+    Namespace[] value();
+}

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/main/java/org/apache/struts2/convention/annotation/Namespaces.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/PackageBasedActionConfigBuilderTest.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/PackageBasedActionConfigBuilderTest.java?rev=659138&r1=659137&r2=659138&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/PackageBasedActionConfigBuilderTest.java
(original)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/PackageBasedActionConfigBuilderTest.java
Thu May 22 08:43:10 2008
@@ -51,6 +51,8 @@
 import org.apache.struts2.convention.actions.namespace.ClassLevelNamespaceAction;
 import org.apache.struts2.convention.actions.namespace.PackageLevelNamespaceAction;
 import org.apache.struts2.convention.actions.namespace2.DefaultNamespaceAction;
+import org.apache.struts2.convention.actions.namespace3.ActionLevelNamespacesAction;
+import org.apache.struts2.convention.actions.namespace4.ActionAndPackageLevelNamespacesAction;
 import org.apache.struts2.convention.actions.params.ActionParamsMethodLevelAction;
 import org.apache.struts2.convention.actions.parentpackage.ClassLevelParentPackageAction;
 import org.apache.struts2.convention.actions.parentpackage.PackageLevelParentPackageAction;
@@ -144,6 +146,14 @@
             "/action-level", strutsDefault, null);
         PackageConfig defaultNamespacePkg = makePackageConfig("org.apache.struts2.convention.actions.namespace2#struts-default#/namespace2",
             "/namespace2", strutsDefault, null);
+        PackageConfig namespaces1Pkg = makePackageConfig("org.apache.struts2.convention.actions.namespace3#struts-default#/namespaces1",
+                "/namespaces1", strutsDefault, null);
+        PackageConfig namespaces2Pkg = makePackageConfig("org.apache.struts2.convention.actions.namespace3#struts-default#/namespaces2",
+                "/namespaces2", strutsDefault, null);
+        PackageConfig namespaces3Pkg = makePackageConfig("org.apache.struts2.convention.actions.namespace4#struts-default#/namespaces3",
+                "/namespaces3", strutsDefault, null);
+        PackageConfig namespaces4Pkg = makePackageConfig("org.apache.struts2.convention.actions.namespace4#struts-default#/namespaces4",
+                "/namespaces4", strutsDefault, null);
         PackageConfig resultPkg = makePackageConfig("org.apache.struts2.convention.actions.result#struts-default#/result",
             "/result", strutsDefault, null);
         PackageConfig resultPathPkg = makePackageConfig("org.apache.struts2.convention.actions.resultpath#struts-default#/resultpath",
@@ -196,6 +206,14 @@
         /* org.apache.struts2.convention.actions.namespace2 */
         expect(resultMapBuilder.build(DefaultNamespaceAction.class, null, "default-namespace",
defaultNamespacePkg)).andReturn(results);
 
+        /* org.apache.struts2.convention.actions.namespace3 */
+        expect(resultMapBuilder.build(ActionLevelNamespacesAction.class, null, "action-level-namespaces",
namespaces1Pkg)).andReturn(results);
+        expect(resultMapBuilder.build(ActionLevelNamespacesAction.class, null, "action-level-namespaces",
namespaces2Pkg)).andReturn(results);
+
+        /* org.apache.struts2.convention.actions.namespace4 */
+        expect(resultMapBuilder.build(ActionAndPackageLevelNamespacesAction.class, null,
"action-and-package-level-namespaces", namespaces3Pkg)).andReturn(results);
+        expect(resultMapBuilder.build(ActionAndPackageLevelNamespacesAction.class, null,
"action-and-package-level-namespaces", namespaces4Pkg)).andReturn(results);
+
         /* org.apache.struts2.convention.actions.parentpackage */
         expect(resultMapBuilder.build(PackageLevelParentPackageAction.class, null, "package-level-parent-package",
packageLevelPkg)).andReturn(results);
         expect(resultMapBuilder.build(ClassLevelParentPackageAction.class, null, "class-level-parent-package",
differentPkg)).andReturn(results);
@@ -262,6 +280,34 @@
         verifyActionConfig(pkgConfig, "action", SingleActionNameAction.class, "run", pkgConfig.getName());
         verifyActionConfig(pkgConfig, "test", TestAction.class, "execute", pkgConfig.getName());
 
+        /* org.apache.struts2.convention.actions.namespace3 */
+        //action on namespace1 (action level)
+        pkgConfig = configuration.getPackageConfig("org.apache.struts2.convention.actions.namespace3#struts-default#/namespaces1");
+        assertNotNull(pkgConfig);
+        assertEquals(1, pkgConfig.getActionConfigs().size());
+        verifyActionConfig(pkgConfig, "action-level-namespaces", ActionLevelNamespacesAction.class,
"execute", pkgConfig.getName());
+
+        //action on namespace2 (action level)
+        pkgConfig = configuration.getPackageConfig("org.apache.struts2.convention.actions.namespace3#struts-default#/namespaces2");
+        assertNotNull(pkgConfig);
+        assertEquals(1, pkgConfig.getActionConfigs().size());
+        verifyActionConfig(pkgConfig, "action-level-namespaces", ActionLevelNamespacesAction.class,
"execute", pkgConfig.getName());
+
+        /* org.apache.struts2.convention.actions.namespace4 */
+        //action on namespace3 (action level)
+        pkgConfig = configuration.getPackageConfig("org.apache.struts2.convention.actions.namespace4#struts-default#/namespaces3");
+        assertNotNull(pkgConfig);
+        assertEquals(1, pkgConfig.getActionConfigs().size());
+        verifyActionConfig(pkgConfig, "action-and-package-level-namespaces", ActionAndPackageLevelNamespacesAction.class,
"execute", pkgConfig.getName());
+
+        //action on namespace4 (package level)
+        pkgConfig = configuration.getPackageConfig("org.apache.struts2.convention.actions.namespace4#struts-default#/namespaces4");
+        assertNotNull(pkgConfig);
+        assertEquals(1, pkgConfig.getActionConfigs().size());
+        verifyActionConfig(pkgConfig, "action-and-package-level-namespaces", ActionAndPackageLevelNamespacesAction.class,
"execute", pkgConfig.getName());
+
+
+
         /* org.apache.struts2.convention.actions.params */
         pkgConfig = configuration.getPackageConfig("org.apache.struts2.convention.actions.params#struts-default#/params");
         assertNotNull(pkgConfig);

Modified: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsActionLevelAction.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsActionLevelAction.java?rev=659138&r1=659137&r2=659138&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsActionLevelAction.java
(original)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsActionLevelAction.java
Thu May 22 08:43:10 2008
@@ -1,5 +1,5 @@
 /*
- * $ID$
+ * $Id$
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsActionLevelAction.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsMethodLevelAction.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsMethodLevelAction.java?rev=659138&r1=659137&r2=659138&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsMethodLevelAction.java
(original)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsMethodLevelAction.java
Thu May 22 08:43:10 2008
@@ -1,5 +1,5 @@
 /*
- * $ID$
+ * $Id$
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/exception/ExceptionsMethodLevelAction.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace3/ActionLevelNamespacesAction.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace3/ActionLevelNamespacesAction.java?rev=659138&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace3/ActionLevelNamespacesAction.java
(added)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace3/ActionLevelNamespacesAction.java
Thu May 22 08:43:10 2008
@@ -0,0 +1,34 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.struts2.convention.actions.namespace3;
+
+import org.apache.struts2.convention.annotation.Namespace;
+import org.apache.struts2.convention.annotation.Namespaces;
+
+@Namespaces({
+    @Namespace("/namespaces1"),
+    @Namespace("/namespaces2")
+})
+public class ActionLevelNamespacesAction {
+    public String execute() {
+        return null;
+    }
+}

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace3/ActionLevelNamespacesAction.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/ActionAndPackageLevelNamespacesAction.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/ActionAndPackageLevelNamespacesAction.java?rev=659138&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/ActionAndPackageLevelNamespacesAction.java
(added)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/ActionAndPackageLevelNamespacesAction.java
Thu May 22 08:43:10 2008
@@ -0,0 +1,33 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 org.apache.struts2.convention.actions.namespace4;
+
+import org.apache.struts2.convention.annotation.Namespace;
+import org.apache.struts2.convention.annotation.Namespaces;
+
+@Namespaces({
+    @Namespace("/namespaces3"),
+})
+public class ActionAndPackageLevelNamespacesAction {
+    public String execute() {
+        return null;
+    }
+}

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/ActionAndPackageLevelNamespacesAction.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/package-info.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/package-info.java?rev=659138&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/package-info.java
(added)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/package-info.java
Thu May 22 08:43:10 2008
@@ -0,0 +1,22 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+@org.apache.struts2.convention.annotation.Namespace("/namespaces4")
+package org.apache.struts2.convention.actions.namespace4;
\ No newline at end of file

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/namespace4/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/params/ActionParamsMethodLevelAction.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/params/ActionParamsMethodLevelAction.java?rev=659138&r1=659137&r2=659138&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/params/ActionParamsMethodLevelAction.java
(original)
+++ struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/params/ActionParamsMethodLevelAction.java
Thu May 22 08:43:10 2008
@@ -1,5 +1,5 @@
 /*
- * $ID$
+ * $Id$
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file

Propchange: struts/sandbox/trunk/struts2-convention-plugin/src/test/java/org/apache/struts2/convention/actions/params/ActionParamsMethodLevelAction.java
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message