Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/ModuleException.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL
Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/ModuleUtils.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/PropertyMessageResources.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/PropertyMessageResourcesFactory.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/ResponseUtils.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/ServletContextWriter.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/TokenProcessor.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/WildcardHelper.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/BeanValidatorForm.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/DynaValidatorForm.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/FieldChecks.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/LazyValidatorForm.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/Resources.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorPlugIn.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhen.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParserTokenTypes.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_3.dtd ------------------------------------------------------------------------------ svn:eol-style = native Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestActionMessage.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestActionMessages.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Modified: struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestActionRedirect.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestActionRedirect.java?rev=421119&r1=421118&r2=421119&view=diff ============================================================================== --- struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestActionRedirect.java (original) +++ struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestActionRedirect.java Tue Jul 11 21:49:11 2006 @@ -1,193 +1,193 @@ -/* - * $Id$ - * - * Copyright 2000-2004 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 org.apache.struts.action; - -import junit.framework.AssertionFailedError; -import junit.framework.ComparisonFailure; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -import java.util.Map; - -/** - * <p>Unit tests for the [EMAIL PROTECTED] ActionRedirect} class.</p> - * - * @version $Rev$ $Date$ - */ -public class TestActionRedirect extends TestCase { - public TestActionRedirect(String s) { - super(s); - } - - public static TestSuite getSuite() { - return new TestSuite(TestActionRedirect.class); - } - - public static void main(String[] args) { - junit.textui.TestRunner runner = new junit.textui.TestRunner(); - - runner.doRun(TestActionRedirect.getSuite()); - } - - // ----------------------------------------------------- Test Methods - - /** - * Check that the redirect flag is set. - */ - public void testActionRedirectRedirectFlag() { - ActionRedirect ar = new ActionRedirect("/path.do"); - - assertTrue("Redirect flag should be set to true.", ar.getRedirect()); - } - - /** - * Test all addParameter methods accepting different data types. - */ - public void testActionRedirectAddParameter() { - ActionRedirect ar = new ActionRedirect("/path.do"); - - ar.addParameter("st", "test"); - ar.addParameter("obj", new StringBuffer("someString")); - - assertTrue("Incorrect path", ar.getPath().indexOf("/path.do") == 0); - assertHasParameter(ar.parameterValues, "st", "test"); - assertHasParameter(ar.parameterValues, "obj", "someString"); - } - - /** - * Test redirect with anchor. - */ - public void testActionRedirectWithAnchor() { - ActionRedirect ar = new ActionRedirect("/path.do"); - - ar.addParameter("st", "test"); - ar.setAnchor("foo"); - - assertTrue("Incorrect path", "/path.do?st=test#foo".equals(ar.getPath())); - } - - /** - * Test adding parameters with the same name. - */ - public void testActionRedirectAddSameNameParameter() { - ActionRedirect ar = new ActionRedirect("/path.do"); - - ar.addParameter("param", "param1"); - ar.addParameter("param", "param2"); - ar.addParameter("param", new StringBuffer("someString")); - - assertTrue("Incorrect path", ar.getPath().indexOf("/path.do") == 0); - assertHasParameter(ar.parameterValues, "param", "param1"); - assertHasParameter(ar.parameterValues, "param", "param2"); - assertHasParameter(ar.parameterValues, "param", "someString"); - assertEquals("Incorrect number of parameters", 3, - countParameters(ar.parameterValues, "param")); - } - - /** - * Test creating an ActionRedirect which copies its configuration from an - * existing ActionForward. - */ - public void testActionRedirectFromExistingForward() { - ActionForward forward = new ActionForward("/path.do?param=param1"); - forward.setRedirect(false); - - ActionRedirect ar = new ActionRedirect(forward); - - ar.addParameter("param", "param2"); - ar.addParameter("object1", new StringBuffer("someString")); - - assertTrue("Incorrect path", ar.getPath().indexOf("/path.do") == 0); - assertHasParameter(ar.parameterValues, "param", "param2"); - assertHasParameter(ar.parameterValues, "object1", "someString"); - assertEquals("Incorrect original path.", forward.getPath(), - ar.getOriginalPath()); - assertTrue("Original had redirect to false", !ar.getRedirect()); - } - - /** - * Assert that the given parameters contains an entry for - * <code>paramValue</code> under the <code>paramName</code> key. <p/> - * - * @param parameters the map of parameters to check into - * @param paramName the key of the value to be checked - * @param paramValue the value to check for - */ - static void assertHasParameter(Map parameters, String paramName, - String paramValue) { - Object value = parameters.get(paramName); - - if (value == null) { - throw new AssertionFailedError("Parameter [" + paramName - + "] not found"); - } - - if (value instanceof String) { - if (!paramValue.equals(value)) { - throw new ComparisonFailure("Incorrect value found", - paramValue, (String) value); - } - } else if (value instanceof String[]) { - // see if our value is among those in the array - String[] values = (String[]) value; - - for (int i = 0; i < values.length; i++) { - if (paramValue.equals(values[i])) { - return; - } - } - - throw new AssertionFailedError( - "Expected value not found for parameter [" + paramName + "]"); - } else { - // can't recognize the value - throw new AssertionFailedError( - "Unexpected type found as parameter value for [" + paramName - + "]"); - } - } - - /** - * Determine the number of values that are available for a specific - * parameter. <p/> - * - * @param parameters the map of parameters to check into - * @param paramName the key of the value(s) to count - * @return the number of values for the specified parameter - */ - static int countParameters(Map parameters, String paramName) { - Object value = parameters.get(paramName); - - if (value == null) { - return 0; - } - - if (value instanceof String) { - return 1; - } else if (value instanceof String[]) { - String[] values = (String[]) value; - - return values.length; - } else { - // can't recognize the value - throw new AssertionFailedError( - "Unexpected type found as parameter value for [" + paramName - + "]"); - } - } -} +/* + * $Id$ + * + * Copyright 2000-2004 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 org.apache.struts.action; + +import junit.framework.AssertionFailedError; +import junit.framework.ComparisonFailure; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +import java.util.Map; + +/** + * <p>Unit tests for the [EMAIL PROTECTED] ActionRedirect} class.</p> + * + * @version $Rev$ $Date$ + */ +public class TestActionRedirect extends TestCase { + public TestActionRedirect(String s) { + super(s); + } + + public static TestSuite getSuite() { + return new TestSuite(TestActionRedirect.class); + } + + public static void main(String[] args) { + junit.textui.TestRunner runner = new junit.textui.TestRunner(); + + runner.doRun(TestActionRedirect.getSuite()); + } + + // ----------------------------------------------------- Test Methods + + /** + * Check that the redirect flag is set. + */ + public void testActionRedirectRedirectFlag() { + ActionRedirect ar = new ActionRedirect("/path.do"); + + assertTrue("Redirect flag should be set to true.", ar.getRedirect()); + } + + /** + * Test all addParameter methods accepting different data types. + */ + public void testActionRedirectAddParameter() { + ActionRedirect ar = new ActionRedirect("/path.do"); + + ar.addParameter("st", "test"); + ar.addParameter("obj", new StringBuffer("someString")); + + assertTrue("Incorrect path", ar.getPath().indexOf("/path.do") == 0); + assertHasParameter(ar.parameterValues, "st", "test"); + assertHasParameter(ar.parameterValues, "obj", "someString"); + } + + /** + * Test redirect with anchor. + */ + public void testActionRedirectWithAnchor() { + ActionRedirect ar = new ActionRedirect("/path.do"); + + ar.addParameter("st", "test"); + ar.setAnchor("foo"); + + assertTrue("Incorrect path", "/path.do?st=test#foo".equals(ar.getPath())); + } + + /** + * Test adding parameters with the same name. + */ + public void testActionRedirectAddSameNameParameter() { + ActionRedirect ar = new ActionRedirect("/path.do"); + + ar.addParameter("param", "param1"); + ar.addParameter("param", "param2"); + ar.addParameter("param", new StringBuffer("someString")); + + assertTrue("Incorrect path", ar.getPath().indexOf("/path.do") == 0); + assertHasParameter(ar.parameterValues, "param", "param1"); + assertHasParameter(ar.parameterValues, "param", "param2"); + assertHasParameter(ar.parameterValues, "param", "someString"); + assertEquals("Incorrect number of parameters", 3, + countParameters(ar.parameterValues, "param")); + } + + /** + * Test creating an ActionRedirect which copies its configuration from an + * existing ActionForward. + */ + public void testActionRedirectFromExistingForward() { + ActionForward forward = new ActionForward("/path.do?param=param1"); + forward.setRedirect(false); + + ActionRedirect ar = new ActionRedirect(forward); + + ar.addParameter("param", "param2"); + ar.addParameter("object1", new StringBuffer("someString")); + + assertTrue("Incorrect path", ar.getPath().indexOf("/path.do") == 0); + assertHasParameter(ar.parameterValues, "param", "param2"); + assertHasParameter(ar.parameterValues, "object1", "someString"); + assertEquals("Incorrect original path.", forward.getPath(), + ar.getOriginalPath()); + assertTrue("Original had redirect to false", !ar.getRedirect()); + } + + /** + * Assert that the given parameters contains an entry for + * <code>paramValue</code> under the <code>paramName</code> key. <p/> + * + * @param parameters the map of parameters to check into + * @param paramName the key of the value to be checked + * @param paramValue the value to check for + */ + static void assertHasParameter(Map parameters, String paramName, + String paramValue) { + Object value = parameters.get(paramName); + + if (value == null) { + throw new AssertionFailedError("Parameter [" + paramName + + "] not found"); + } + + if (value instanceof String) { + if (!paramValue.equals(value)) { + throw new ComparisonFailure("Incorrect value found", + paramValue, (String) value); + } + } else if (value instanceof String[]) { + // see if our value is among those in the array + String[] values = (String[]) value; + + for (int i = 0; i < values.length; i++) { + if (paramValue.equals(values[i])) { + return; + } + } + + throw new AssertionFailedError( + "Expected value not found for parameter [" + paramName + "]"); + } else { + // can't recognize the value + throw new AssertionFailedError( + "Unexpected type found as parameter value for [" + paramName + + "]"); + } + } + + /** + * Determine the number of values that are available for a specific + * parameter. <p/> + * + * @param parameters the map of parameters to check into + * @param paramName the key of the value(s) to count + * @return the number of values for the specified parameter + */ + static int countParameters(Map parameters, String paramName) { + Object value = parameters.get(paramName); + + if (value == null) { + return 0; + } + + if (value instanceof String) { + return 1; + } else if (value instanceof String[]) { + String[] values = (String[]) value; + + return values.length; + } else { + // can't recognize the value + throw new AssertionFailedError( + "Unexpected type found as parameter value for [" + paramName + + "]"); + } + } +} Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestActionRedirect.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestActionRedirect.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestActionServlet.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestDynaActionForm.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestDynaActionFormClass.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Modified: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/generic/TestWrappingLookupCommand.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/generic/TestWrappingLookupCommand.java?rev=421119&r1=421118&r2=421119&view=diff ============================================================================== --- struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/generic/TestWrappingLookupCommand.java (original) +++ struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/generic/TestWrappingLookupCommand.java Tue Jul 11 21:49:11 2006 @@ -1,71 +1,71 @@ -/* - * $Id$ - * - * Copyright 2003,2004 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 org.apache.struts.chain.commands.generic; - -import junit.framework.TestCase; - -import org.apache.commons.chain.Context; -import org.apache.commons.chain.impl.ContextBase; -import org.apache.commons.chain.web.servlet.ServletWebContext; -import org.apache.struts.chain.contexts.ServletActionContext; - -/* JUnitTest case for class: org.apache.struts.chain.commands.generic.WrappingLookupCommand */ -public class TestWrappingLookupCommand extends TestCase { - public TestWrappingLookupCommand(String _name) { - super(_name); - } - - /* setUp method for test case */ - protected void setUp() { - } - - /* tearDown method for test case */ - protected void tearDown() { - } - - public void testSame() throws Exception { - WrappingLookupCommand command = new WrappingLookupCommand(); - Context testContext = new ContextBase(); - - Context wrapped = command.getContext(testContext); - - assertNotNull(wrapped); - assertSame(testContext, wrapped); - } - - public void testWrapContextSubclass() - throws Exception { - WrappingLookupCommand command = new WrappingLookupCommand(); - - command.setWrapperClassName(ServletActionContext.class.getName()); - - Context testContext = new ServletWebContext(); - - Context wrapped = command.getContext(testContext); - - assertNotNull(wrapped); - assertTrue(wrapped instanceof ServletActionContext); - } - - /* Executes the test case */ - public static void main(String[] argv) { - String[] testCaseList = { TestWrappingLookupCommand.class.getName() }; - - junit.textui.TestRunner.main(testCaseList); - } -} +/* + * $Id$ + * + * Copyright 2003,2004 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 org.apache.struts.chain.commands.generic; + +import junit.framework.TestCase; + +import org.apache.commons.chain.Context; +import org.apache.commons.chain.impl.ContextBase; +import org.apache.commons.chain.web.servlet.ServletWebContext; +import org.apache.struts.chain.contexts.ServletActionContext; + +/* JUnitTest case for class: org.apache.struts.chain.commands.generic.WrappingLookupCommand */ +public class TestWrappingLookupCommand extends TestCase { + public TestWrappingLookupCommand(String _name) { + super(_name); + } + + /* setUp method for test case */ + protected void setUp() { + } + + /* tearDown method for test case */ + protected void tearDown() { + } + + public void testSame() throws Exception { + WrappingLookupCommand command = new WrappingLookupCommand(); + Context testContext = new ContextBase(); + + Context wrapped = command.getContext(testContext); + + assertNotNull(wrapped); + assertSame(testContext, wrapped); + } + + public void testWrapContextSubclass() + throws Exception { + WrappingLookupCommand command = new WrappingLookupCommand(); + + command.setWrapperClassName(ServletActionContext.class.getName()); + + Context testContext = new ServletWebContext(); + + Context wrapped = command.getContext(testContext); + + assertNotNull(wrapped); + assertTrue(wrapped instanceof ServletActionContext); + } + + /* Executes the test case */ + public static void main(String[] argv) { + String[] testCaseList = { TestWrappingLookupCommand.class.getName() }; + + junit.textui.TestRunner.main(testCaseList); + } +} Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/generic/TestWrappingLookupCommand.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/generic/TestWrappingLookupCommand.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Modified: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestAuthorizeAction.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestAuthorizeAction.java?rev=421119&r1=421118&r2=421119&view=diff ============================================================================== --- struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestAuthorizeAction.java (original) +++ struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestAuthorizeAction.java Tue Jul 11 21:49:11 2006 @@ -1,126 +1,126 @@ -package org.apache.struts.chain.commands.servlet; - -import junit.framework.TestCase; - -import org.apache.commons.chain.web.servlet.ServletWebContext; -import org.apache.struts.chain.commands.UnauthorizedActionException; -import org.apache.struts.chain.contexts.ServletActionContext; -import org.apache.struts.config.ActionConfig; -import org.apache.struts.mock.MockActionServlet; -import org.apache.struts.mock.MockHttpServletRequest; -import org.apache.struts.mock.MockHttpServletResponse; -import org.apache.struts.mock.MockPrincipal; -import org.apache.struts.mock.MockServletConfig; -import org.apache.struts.mock.MockServletContext; - -/* JUnitTest case for class: org.apache.struts.chain.commands.servlet.AuthorizeAction */ -public class TestAuthorizeAction extends TestCase { - MockHttpServletRequest request = null; - MockPrincipal principal = null; - ServletWebContext swContext = null; - ServletActionContext saContext = null; - AuthorizeAction command = null; - - public TestAuthorizeAction(String _name) { - super(_name); - } - - /* setUp method for test case */ - protected void setUp() throws Exception { - this.request = new MockHttpServletRequest(); - this.principal = - new MockPrincipal("Mr. Macri", new String[] { "administrator" }); - this.request.setUserPrincipal(principal); - - MockServletConfig servletConfig = new MockServletConfig(); - MockServletContext servletContext = new MockServletContext(); - MockActionServlet servlet = - new MockActionServlet(servletContext, servletConfig); - - servlet.initInternal(); - - this.saContext = - new ServletActionContext(servletContext, request, - new MockHttpServletResponse()); - - this.saContext.setActionServlet(servlet); - this.command = new AuthorizeAction(); - } - - /* tearDown method for test case */ - protected void tearDown() { - } - - public void testAuthorizeOneRole() - throws Exception { - ActionConfig config = new ActionConfig(); - - config.setPath("/testAuthorizeOneRole"); - config.setRoles("administrator"); - this.saContext.setActionConfig(config); - - boolean result = command.execute(saContext); - - assertFalse(result); - } - - public void testAuthorizeOneOfManyRoles() - throws Exception { - ActionConfig config = new ActionConfig(); - - config.setPath("/testAuthorizeOneOfManyRoles"); - config.setRoles("administrator,roustabout,memory"); - this.saContext.setActionConfig(config); - - boolean result = command.execute(saContext); - - assertFalse(result); - } - - public void testAuthorizeNoRoles() - throws Exception { - ActionConfig config = new ActionConfig(); - - config.setPath("/testAuthorizeNoRoles"); - this.saContext.setActionConfig(config); - - boolean result = command.execute(saContext); - - assertFalse(result); - } - - public void testNotAuthorizedOneRole() - throws Exception { - ActionConfig config = new ActionConfig(); - - config.setPath("/testNotAuthorizedOneRole"); - config.setRoles("roustabout"); - this.saContext.setActionConfig(config); - - try { - boolean result = command.execute(saContext); - } catch (UnauthorizedActionException ex) { - } - } - - public void testNotAuthorizedOneOfManyRoles() - throws Exception { - ActionConfig config = new ActionConfig(); - - config.setPath("/testNotAuthorizedOneOfManyRoles"); - config.setRoles("roustabout,memory"); - this.saContext.setActionConfig(config); - - try { - boolean result = command.execute(saContext); - } catch (UnauthorizedActionException ex) { - } - } - - /* Executes the test case */ - public static void main(String[] argv) { - String[] testCaseList = { TestAuthorizeAction.class.getName() }; - - junit.textui.TestRunner.main(testCaseList); - } -} +package org.apache.struts.chain.commands.servlet; + +import junit.framework.TestCase; + +import org.apache.commons.chain.web.servlet.ServletWebContext; +import org.apache.struts.chain.commands.UnauthorizedActionException; +import org.apache.struts.chain.contexts.ServletActionContext; +import org.apache.struts.config.ActionConfig; +import org.apache.struts.mock.MockActionServlet; +import org.apache.struts.mock.MockHttpServletRequest; +import org.apache.struts.mock.MockHttpServletResponse; +import org.apache.struts.mock.MockPrincipal; +import org.apache.struts.mock.MockServletConfig; +import org.apache.struts.mock.MockServletContext; + +/* JUnitTest case for class: org.apache.struts.chain.commands.servlet.AuthorizeAction */ +public class TestAuthorizeAction extends TestCase { + MockHttpServletRequest request = null; + MockPrincipal principal = null; + ServletWebContext swContext = null; + ServletActionContext saContext = null; + AuthorizeAction command = null; + + public TestAuthorizeAction(String _name) { + super(_name); + } + + /* setUp method for test case */ + protected void setUp() throws Exception { + this.request = new MockHttpServletRequest(); + this.principal = + new MockPrincipal("Mr. Macri", new String[] { "administrator" }); + this.request.setUserPrincipal(principal); + + MockServletConfig servletConfig = new MockServletConfig(); + MockServletContext servletContext = new MockServletContext(); + MockActionServlet servlet = + new MockActionServlet(servletContext, servletConfig); + + servlet.initInternal(); + + this.saContext = + new ServletActionContext(servletContext, request, + new MockHttpServletResponse()); + + this.saContext.setActionServlet(servlet); + this.command = new AuthorizeAction(); + } + + /* tearDown method for test case */ + protected void tearDown() { + } + + public void testAuthorizeOneRole() + throws Exception { + ActionConfig config = new ActionConfig(); + + config.setPath("/testAuthorizeOneRole"); + config.setRoles("administrator"); + this.saContext.setActionConfig(config); + + boolean result = command.execute(saContext); + + assertFalse(result); + } + + public void testAuthorizeOneOfManyRoles() + throws Exception { + ActionConfig config = new ActionConfig(); + + config.setPath("/testAuthorizeOneOfManyRoles"); + config.setRoles("administrator,roustabout,memory"); + this.saContext.setActionConfig(config); + + boolean result = command.execute(saContext); + + assertFalse(result); + } + + public void testAuthorizeNoRoles() + throws Exception { + ActionConfig config = new ActionConfig(); + + config.setPath("/testAuthorizeNoRoles"); + this.saContext.setActionConfig(config); + + boolean result = command.execute(saContext); + + assertFalse(result); + } + + public void testNotAuthorizedOneRole() + throws Exception { + ActionConfig config = new ActionConfig(); + + config.setPath("/testNotAuthorizedOneRole"); + config.setRoles("roustabout"); + this.saContext.setActionConfig(config); + + try { + boolean result = command.execute(saContext); + } catch (UnauthorizedActionException ex) { + } + } + + public void testNotAuthorizedOneOfManyRoles() + throws Exception { + ActionConfig config = new ActionConfig(); + + config.setPath("/testNotAuthorizedOneOfManyRoles"); + config.setRoles("roustabout,memory"); + this.saContext.setActionConfig(config); + + try { + boolean result = command.execute(saContext); + } catch (UnauthorizedActionException ex) { + } + } + + /* Executes the test case */ + public static void main(String[] argv) { + String[] testCaseList = { TestAuthorizeAction.class.getName() }; + + junit.textui.TestRunner.main(testCaseList); + } +} Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestAuthorizeAction.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestAuthorizeAction.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Modified: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestPerformForward.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestPerformForward.java?rev=421119&r1=421118&r2=421119&view=diff ============================================================================== --- struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestPerformForward.java (original) +++ struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestPerformForward.java Tue Jul 11 21:49:11 2006 @@ -1,76 +1,76 @@ -package org.apache.struts.chain.commands.servlet; - -import junit.framework.TestCase; - -import org.apache.commons.chain.web.servlet.ServletWebContext; -import org.apache.struts.chain.contexts.ServletActionContext; -import org.apache.struts.config.ForwardConfig; -import org.apache.struts.mock.MockActionServlet; -import org.apache.struts.mock.MockHttpServletRequest; -import org.apache.struts.mock.MockHttpServletResponse; -import org.apache.struts.mock.MockPrincipal; -import org.apache.struts.mock.MockServletConfig; -import org.apache.struts.mock.MockServletContext; - -/* JUnitTest case for class: org.apache.struts.chain.commands.servlet.PerformForward */ -public class TestPerformForward extends TestCase { - MockHttpServletRequest request = null; - MockPrincipal principal = null; - ServletWebContext swContext = null; - ServletActionContext saContext = null; - PerformForward command = null; - - public TestPerformForward(String _name) { - super(_name); - } - - /* setUp method for test case */ - protected void setUp() throws Exception { - this.request = new MockHttpServletRequest(); - this.principal = - new MockPrincipal("Mr. Macri", new String[] { "administrator" }); - this.request.setUserPrincipal(principal); - - MockServletConfig servletConfig = new MockServletConfig(); - MockServletContext servletContext = new MockServletContext(); - MockActionServlet servlet = - new MockActionServlet(servletContext, servletConfig); - - servlet.initInternal(); - - this.saContext = - new ServletActionContext(servletContext, request, - new MockHttpServletResponse()); - - this.saContext.setActionServlet(servlet); - this.command = new PerformForward(); - } - - /* tearDown method for test case */ - protected void tearDown() { - } - - public void testNullForwardPath() - throws Exception { - ForwardConfig config = new ForwardConfig(); - - config.setPath(null); - - try { - command.perform(saContext, config); - fail( - "Didn't throw an illegal argument exception on null forward path"); - } catch (IllegalArgumentException ex) { - System.out.println("exception: " + ex.getMessage()); - - // Do nothing, the test passed - } - } - - /* Executes the test case */ - public static void main(String[] argv) { - String[] testCaseList = { TestPerformForward.class.getName() }; - - junit.textui.TestRunner.main(testCaseList); - } -} +package org.apache.struts.chain.commands.servlet; + +import junit.framework.TestCase; + +import org.apache.commons.chain.web.servlet.ServletWebContext; +import org.apache.struts.chain.contexts.ServletActionContext; +import org.apache.struts.config.ForwardConfig; +import org.apache.struts.mock.MockActionServlet; +import org.apache.struts.mock.MockHttpServletRequest; +import org.apache.struts.mock.MockHttpServletResponse; +import org.apache.struts.mock.MockPrincipal; +import org.apache.struts.mock.MockServletConfig; +import org.apache.struts.mock.MockServletContext; + +/* JUnitTest case for class: org.apache.struts.chain.commands.servlet.PerformForward */ +public class TestPerformForward extends TestCase { + MockHttpServletRequest request = null; + MockPrincipal principal = null; + ServletWebContext swContext = null; + ServletActionContext saContext = null; + PerformForward command = null; + + public TestPerformForward(String _name) { + super(_name); + } + + /* setUp method for test case */ + protected void setUp() throws Exception { + this.request = new MockHttpServletRequest(); + this.principal = + new MockPrincipal("Mr. Macri", new String[] { "administrator" }); + this.request.setUserPrincipal(principal); + + MockServletConfig servletConfig = new MockServletConfig(); + MockServletContext servletContext = new MockServletContext(); + MockActionServlet servlet = + new MockActionServlet(servletContext, servletConfig); + + servlet.initInternal(); + + this.saContext = + new ServletActionContext(servletContext, request, + new MockHttpServletResponse()); + + this.saContext.setActionServlet(servlet); + this.command = new PerformForward(); + } + + /* tearDown method for test case */ + protected void tearDown() { + } + + public void testNullForwardPath() + throws Exception { + ForwardConfig config = new ForwardConfig(); + + config.setPath(null); + + try { + command.perform(saContext, config); + fail( + "Didn't throw an illegal argument exception on null forward path"); + } catch (IllegalArgumentException ex) { + System.out.println("exception: " + ex.getMessage()); + + // Do nothing, the test passed + } + } + + /* Executes the test case */ + public static void main(String[] argv) { + String[] testCaseList = { TestPerformForward.class.getName() }; + + junit.textui.TestRunner.main(testCaseList); + } +} Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestPerformForward.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestPerformForward.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Modified: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestSetOriginalURI.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestSetOriginalURI.java?rev=421119&r1=421118&r2=421119&view=diff ============================================================================== --- struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestSetOriginalURI.java (original) +++ struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestSetOriginalURI.java Tue Jul 11 21:49:11 2006 @@ -1,66 +1,66 @@ -package org.apache.struts.chain.commands.servlet; - -import junit.framework.TestCase; - -import org.apache.struts.Globals; -import org.apache.struts.chain.contexts.ServletActionContext; -import org.apache.struts.mock.MockActionServlet; -import org.apache.struts.mock.MockHttpServletRequest; -import org.apache.struts.mock.MockHttpServletResponse; -import org.apache.struts.mock.MockServletConfig; -import org.apache.struts.mock.MockServletContext; - -/* JUnitTest case for class: org.apache.struts.chain.commands.servlet.SetOriginalURI */ -public class TestSetOriginalURI extends TestCase { - SetOriginalURI command = null; - - public TestSetOriginalURI(String _name) { - super(_name); - } - - /* setUp method for test case */ - protected void setUp() throws Exception { - this.command = new SetOriginalURI(); - } - - /* tearDown method for test case */ - protected void tearDown() { - } - - public void testSetOriginalURI() - throws Exception { - MockHttpServletRequest request = - new MockHttpServletRequest("foo/", "bar.do", null, null); - MockServletConfig servletConfig = new MockServletConfig(); - MockServletContext servletContext = new MockServletContext(); - MockActionServlet servlet = - new MockActionServlet(servletContext, servletConfig); - - servlet.initInternal(); - - ServletActionContext saContext = - new ServletActionContext(servletContext, request, - new MockHttpServletResponse()); - - saContext.setActionServlet(servlet); - - boolean result = command.execute(saContext); - - assertTrue(!result); - - String uri = (String) request.getAttribute(Globals.ORIGINAL_URI_KEY); - - assertTrue("Original uri not correct: " + uri, "bar.do".equals(uri)); - - request.setPathElements("foo/", "bar2.do", null, null); - uri = (String) request.getAttribute(Globals.ORIGINAL_URI_KEY); - assertTrue("Original uri not correct: " + uri, "bar.do".equals(uri)); - } - - /* Executes the test case */ - public static void main(String[] argv) { - String[] testCaseList = { TestSetOriginalURI.class.getName() }; - - junit.textui.TestRunner.main(testCaseList); - } -} +package org.apache.struts.chain.commands.servlet; + +import junit.framework.TestCase; + +import org.apache.struts.Globals; +import org.apache.struts.chain.contexts.ServletActionContext; +import org.apache.struts.mock.MockActionServlet; +import org.apache.struts.mock.MockHttpServletRequest; +import org.apache.struts.mock.MockHttpServletResponse; +import org.apache.struts.mock.MockServletConfig; +import org.apache.struts.mock.MockServletContext; + +/* JUnitTest case for class: org.apache.struts.chain.commands.servlet.SetOriginalURI */ +public class TestSetOriginalURI extends TestCase { + SetOriginalURI command = null; + + public TestSetOriginalURI(String _name) { + super(_name); + } + + /* setUp method for test case */ + protected void setUp() throws Exception { + this.command = new SetOriginalURI(); + } + + /* tearDown method for test case */ + protected void tearDown() { + } + + public void testSetOriginalURI() + throws Exception { + MockHttpServletRequest request = + new MockHttpServletRequest("foo/", "bar.do", null, null); + MockServletConfig servletConfig = new MockServletConfig(); + MockServletContext servletContext = new MockServletContext(); + MockActionServlet servlet = + new MockActionServlet(servletContext, servletConfig); + + servlet.initInternal(); + + ServletActionContext saContext = + new ServletActionContext(servletContext, request, + new MockHttpServletResponse()); + + saContext.setActionServlet(servlet); + + boolean result = command.execute(saContext); + + assertTrue(!result); + + String uri = (String) request.getAttribute(Globals.ORIGINAL_URI_KEY); + + assertTrue("Original uri not correct: " + uri, "bar.do".equals(uri)); + + request.setPathElements("foo/", "bar2.do", null, null); + uri = (String) request.getAttribute(Globals.ORIGINAL_URI_KEY); + assertTrue("Original uri not correct: " + uri, "bar.do".equals(uri)); + } + + /* Executes the test case */ + public static void main(String[] argv) { + String[] testCaseList = { TestSetOriginalURI.class.getName() }; + + junit.textui.TestRunner.main(testCaseList); + } +} Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestSetOriginalURI.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/chain/commands/servlet/TestSetOriginalURI.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/config/CustomMappingTest.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/config/TestActionConfigMatcher.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/config/TestModuleConfig.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/util/TestRequestUtils.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/validator/PojoBean.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL Propchange: struts/struts1/trunk/core/src/test/java/org/apache/struts/validator/TestValidWhen.java ------------------------------------------------------------------------------ --- svn:keywords (original) +++ svn:keywords Tue Jul 11 21:49:11 2006 @@ -1 +1 @@ -date author id rev +Date Author Id Revision HeadURL