Commits

Joe Xie  committed 27df31b

CONF-27294 : remove the ability to perform an action command

  • Participants
  • Parent commits 55999f2
  • Branches CONF-27294, xwork_1-0-3 1
    1. xwork_1-0-3_branch
  • Tags xwork_1-0-3-4

Comments (0)

Files changed (3)

File build.properties

 name=xwork
-version=1.0.3.3
+version=1.0.3.4

File src/test/com/opensymphony/xwork/config/ConfigurationTest.java

         }
     }
 
+    public void testActionIsCommand() throws Exception {
+        try {
+            ActionProxyFactory.getFactory().createActionProxy("/bangcommand", "bang", null);
+        } catch (ConfigurationException ignored) {
+            fail("action proxy creation should not have failed");
+        }
+        try {
+            ActionProxyFactory.getFactory().createActionProxy("/bangcommand", "bang!command", null);
+            fail("expected to fail action proxy creation, but didn't");
+        } catch (ConfigurationException ignored) {
+            //expected
+        }
+        assertNotNull("should have found the action configuration for /bangcommand/bang",
+                ConfigurationManager.getConfiguration().getRuntimeConfiguration().getActionConfig("/bangcommand", "bang"));
+        assertNull("should not have created an action configuration for /bangcommand/bang!command",
+                ConfigurationManager.getConfiguration().getRuntimeConfiguration().getActionConfig("/bangcommand", "bang!command"));
+    }
+
     public void testDefaultNamespace() {
         HashMap params = new HashMap();
         params.put("blah", "this is blah");

File src/test/xwork.xml

         </action>
     </package>
 
+    <package name="bang" namespace="/bangcommand">
+        <action name="bang" class="com.opensymphony.xwork.SimpleAction"/>
+    </package>
+
     <include file="includeTest.xml"/>
 </xwork>