You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by hu...@apache.org on 2006/02/10 22:05:22 UTC
svn commit: r376846 [5/14] - in
/struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib: ./ bean/
bean/resources/ html/ logic/
Modified: struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestSizeTag.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestSizeTag.java?rev=376846&r1=376845&r2=376846&view=diff
==============================================================================
--- struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestSizeTag.java (original)
+++ struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestSizeTag.java Fri Feb 10 13:05:03 2006
@@ -17,33 +17,30 @@
*/
package org.apache.struts.taglib.bean;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.servlet.ServletException;
-import javax.servlet.jsp.PageContext;
-
import junit.framework.Test;
import junit.framework.TestSuite;
-
import org.apache.cactus.WebResponse;
import org.apache.struts.taglib.SimpleBeanForTesting;
import org.apache.struts.taglib.TaglibTestBase;
+import javax.servlet.ServletException;
+import javax.servlet.jsp.PageContext;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
/**
- * Suite of unit tests for the
- * <code>org.apache.struts.taglib.bean.SizeTag</code> class.
- *
+ * Suite of unit tests for the <code>org.apache.struts.taglib.bean.SizeTag</code>
+ * class.
*/
public class TestSizeTag extends TaglibTestBase {
- protected final static String TEST_VAL = "Test Value";
- protected final static String REQUEST_KEY = "REQUEST_KEY";
- private String [] strings = { TEST_VAL, TEST_VAL, TEST_VAL };
- private Collection collection = new ArrayList();
- private Map map = new HashMap();
+ protected final static String TEST_VAL = "Test Value";
+ protected final static String REQUEST_KEY = "REQUEST_KEY";
+ private String [] strings = { TEST_VAL, TEST_VAL, TEST_VAL };
+ private Collection collection = new ArrayList();
+ private Map map = new HashMap();
/**
* Defines the testcase name for JUnit.
@@ -60,7 +57,8 @@
* @param theArgs the arguments. Not used
*/
public static void main(String[] theArgs) {
- junit.awtui.TestRunner.main(new String[] {TestSizeTag.class.getName()});
+ junit.awtui.TestRunner
+ .main(new String[] { TestSizeTag.class.getName() });
}
/**
@@ -71,441 +69,601 @@
// All methods starting with "test" will be executed in the test suite.
return new TestSuite(TestSizeTag.class);
}
-
+
public void setUp() {
- for (int i = 0; i < 3; i++) {
- collection.add(TEST_VAL + i);
- }
- for (int i = 0; i < 3; i++) {
- map.put(REQUEST_KEY + i, TEST_VAL + i);
- }
- }
-
- private void formatAndTest(String compare, String output) {
- //fix for introduced carriage return / line feeds
- output = replace(output,"\r","");
- output = replace(output,"\n","");
- output = output.trim();
- //System.out.println("Testing [" + compare + "] == [" + output + "]");
- assertEquals(compare, output);
- }
-
-
-
- // Array
- public void testSizeTagNameArrayNoScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameArrayNoScope");
- request.setAttribute(REQUEST_KEY, strings);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameArrayNoScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNameArrayApplicationScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameArrayApplicationScope");
- pageContext.setAttribute(REQUEST_KEY, strings, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameArrayApplicationScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNameArraySessionScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameArraySessionScope");
- pageContext.setAttribute(REQUEST_KEY, strings, PageContext.SESSION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameArraySessionScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNameArrayRequestScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameArrayRequestScope");
- pageContext.setAttribute(REQUEST_KEY, strings, PageContext.REQUEST_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameArrayRequestScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
-
- public void testSizeTagNamePropertyArrayNoScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyArrayNoScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setArray(strings);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyArrayNoScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyArrayApplicationScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyArrayApplicationScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setArray(strings);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyArrayApplicationScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyArraySessionScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyArraySessionScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setArray(strings);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.SESSION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyArraySessionScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyArrayRequestScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyArrayRequestScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setArray(strings);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.REQUEST_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyArrayRequestScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
-
-
-
- public void testSizeTagNamePropertyArrayNoScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyArrayNoScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setArray(strings);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyArrayNoScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyArrayApplicationScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyArrayApplicationScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setArray(strings);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyArrayApplicationScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyArraySessionScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyArraySessionScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setArray(strings);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.SESSION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyArraySessionScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyArrayRequestScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyArrayRequestScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setArray(strings);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.REQUEST_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyArrayRequestScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
-
-
- // Collection
- public void testSizeTagNameCollectionNoScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameCollectionNoScope");
- request.setAttribute(REQUEST_KEY, collection);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameCollectionNoScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNameCollectionApplicationScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameCollectionApplicationScope");
- pageContext.setAttribute(REQUEST_KEY, collection, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameCollectionApplicationScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNameCollectionSessionScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameCollectionSessionScope");
- pageContext.setAttribute(REQUEST_KEY, collection, PageContext.SESSION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameCollectionSessionScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNameCollectionRequestScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameCollectionRequestScope");
- pageContext.setAttribute(REQUEST_KEY, collection, PageContext.REQUEST_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameCollectionRequestScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
-
- public void testSizeTagNamePropertyCollectionNoScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyCollectionNoScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setCollection(collection);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyCollectionNoScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyCollectionApplicationScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyCollectionApplicationScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setCollection(collection);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyCollectionApplicationScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyCollectionSessionScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyCollectionSessionScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setCollection(collection);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.SESSION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyCollectionSessionScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyCollectionRequestScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyCollectionRequestScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setCollection(collection);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.REQUEST_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyCollectionRequestScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
-
-
-
- public void testSizeTagNamePropertyCollectionNoScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyCollectionNoScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setCollection(collection);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyCollectionNoScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyCollectionApplicationScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyCollectionApplicationScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setCollection(collection);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyCollectionApplicationScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyCollectionSessionScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyCollectionSessionScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setCollection(collection);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.SESSION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyCollectionSessionScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyCollectionRequestScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyCollectionRequestScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setCollection(collection);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.REQUEST_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyCollectionRequestScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
-
-
- // Map
- public void testSizeTagNameMapNoScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameMapNoScope");
- request.setAttribute(REQUEST_KEY, map);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameMapNoScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNameMapApplicationScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameMapApplicationScope");
- pageContext.setAttribute(REQUEST_KEY, map, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameMapApplicationScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNameMapSessionScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameMapSessionScope");
- pageContext.setAttribute(REQUEST_KEY, map, PageContext.SESSION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameMapSessionScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNameMapRequestScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNameMapRequestScope");
- pageContext.setAttribute(REQUEST_KEY, map, PageContext.REQUEST_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNameMapRequestScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
-
- public void testSizeTagNamePropertyMapNoScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyMapNoScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setMap(map);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyMapNoScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyMapApplicationScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyMapApplicationScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setMap(map);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyMapApplicationScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyMapSessionScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyMapSessionScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setMap(map);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.SESSION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyMapSessionScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyMapRequestScope() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyMapRequestScope");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- sbft.setMap(map);
- pageContext.setAttribute(REQUEST_KEY, sbft, PageContext.REQUEST_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyMapRequestScope(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
-
-
-
- public void testSizeTagNamePropertyMapNoScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyMapNoScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setMap(map);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyMapNoScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyMapApplicationScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyMapApplicationScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setMap(map);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.APPLICATION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyMapApplicationScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyMapSessionScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyMapSessionScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setMap(map);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.SESSION_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyMapSessionScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
-
- public void testSizeTagNamePropertyMapRequestScopeNested() throws IOException, ServletException{
- request.setAttribute("runTest", "testSizeTagNamePropertyMapRequestScopeNested");
- SimpleBeanForTesting sbft = new SimpleBeanForTesting();
- SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
- sbft.setMap(map);
- sbft2.setNestedObject(sbft);
- pageContext.setAttribute(REQUEST_KEY, sbft2, PageContext.REQUEST_SCOPE);
- pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
- }
- public void endSizeTagNamePropertyMapRequestScopeNested(WebResponse response){
- formatAndTest("3", response.getText());
- }
+ for (int i = 0; i < 3; i++) {
+ collection.add(TEST_VAL + i);
+ }
+ for (int i = 0; i < 3; i++) {
+ map.put(REQUEST_KEY + i, TEST_VAL + i);
+ }
+ }
+
+ private void formatAndTest(String compare, String output) {
+ //fix for introduced carriage return / line feeds
+ output = replace(output, "\r", "");
+ output = replace(output, "\n", "");
+ output = output.trim();
+ //System.out.println("Testing [" + compare + "] == [" + output + "]");
+ assertEquals(compare, output);
+ }
+
+
+ // Array
+ public void testSizeTagNameArrayNoScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest", "testSizeTagNameArrayNoScope");
+ request.setAttribute(REQUEST_KEY, strings);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameArrayNoScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNameArrayApplicationScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNameArrayApplicationScope");
+ pageContext.setAttribute(REQUEST_KEY,
+ strings,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameArrayApplicationScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNameArraySessionScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest", "testSizeTagNameArraySessionScope");
+ pageContext.setAttribute(REQUEST_KEY,
+ strings,
+ PageContext.SESSION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameArraySessionScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNameArrayRequestScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest", "testSizeTagNameArrayRequestScope");
+ pageContext.setAttribute(REQUEST_KEY,
+ strings,
+ PageContext.REQUEST_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameArrayRequestScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+
+ public void testSizeTagNamePropertyArrayNoScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyArrayNoScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setArray(strings);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyArrayNoScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyArrayApplicationScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyArrayApplicationScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setArray(strings);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyArrayApplicationScope(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyArraySessionScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyArraySessionScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setArray(strings);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft, PageContext.SESSION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyArraySessionScope(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyArrayRequestScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyArrayRequestScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setArray(strings);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft, PageContext.REQUEST_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyArrayRequestScope(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+
+ public void testSizeTagNamePropertyArrayNoScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyArrayNoScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setArray(strings);
+ sbft2.setNestedObject(sbft);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft2,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyArrayNoScopeNested(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyArrayApplicationScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyArrayApplicationScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setArray(strings);
+ sbft2.setNestedObject(sbft);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft2,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyArrayApplicationScopeNested(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyArraySessionScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyArraySessionScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setArray(strings);
+ sbft2.setNestedObject(sbft);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft2, PageContext.SESSION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyArraySessionScopeNested(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyArrayRequestScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyArrayRequestScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setArray(strings);
+ sbft2.setNestedObject(sbft);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft2, PageContext.REQUEST_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyArrayRequestScopeNested(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+
+ // Collection
+ public void testSizeTagNameCollectionNoScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest", "testSizeTagNameCollectionNoScope");
+ request.setAttribute(REQUEST_KEY, collection);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameCollectionNoScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNameCollectionApplicationScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNameCollectionApplicationScope");
+ pageContext.setAttribute(REQUEST_KEY,
+ collection,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameCollectionApplicationScope(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNameCollectionSessionScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNameCollectionSessionScope");
+ pageContext.setAttribute(REQUEST_KEY,
+ collection,
+ PageContext.SESSION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameCollectionSessionScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNameCollectionRequestScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNameCollectionRequestScope");
+ pageContext.setAttribute(REQUEST_KEY,
+ collection,
+ PageContext.REQUEST_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameCollectionRequestScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+
+ public void testSizeTagNamePropertyCollectionNoScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyCollectionNoScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setCollection(collection);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyCollectionNoScope(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyCollectionApplicationScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyCollectionApplicationScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setCollection(collection);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyCollectionApplicationScope(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyCollectionSessionScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyCollectionSessionScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setCollection(collection);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft, PageContext.SESSION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyCollectionSessionScope(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyCollectionRequestScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyCollectionRequestScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setCollection(collection);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft, PageContext.REQUEST_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyCollectionRequestScope(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+
+ public void testSizeTagNamePropertyCollectionNoScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyCollectionNoScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setCollection(collection);
+ sbft2.setNestedObject(sbft);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft2,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyCollectionNoScopeNested(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyCollectionApplicationScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyCollectionApplicationScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setCollection(collection);
+ sbft2.setNestedObject(sbft);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft2,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyCollectionApplicationScopeNested(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyCollectionSessionScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyCollectionSessionScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setCollection(collection);
+ sbft2.setNestedObject(sbft);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft2, PageContext.SESSION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyCollectionSessionScopeNested(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyCollectionRequestScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyCollectionRequestScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setCollection(collection);
+ sbft2.setNestedObject(sbft);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft2, PageContext.REQUEST_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyCollectionRequestScopeNested(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+
+ // Map
+ public void testSizeTagNameMapNoScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest", "testSizeTagNameMapNoScope");
+ request.setAttribute(REQUEST_KEY, map);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameMapNoScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNameMapApplicationScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest", "testSizeTagNameMapApplicationScope");
+ pageContext.setAttribute(REQUEST_KEY,
+ map,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameMapApplicationScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNameMapSessionScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest", "testSizeTagNameMapSessionScope");
+ pageContext.setAttribute(REQUEST_KEY, map, PageContext.SESSION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameMapSessionScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNameMapRequestScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest", "testSizeTagNameMapRequestScope");
+ pageContext.setAttribute(REQUEST_KEY, map, PageContext.REQUEST_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNameMapRequestScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+
+ public void testSizeTagNamePropertyMapNoScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest", "testSizeTagNamePropertyMapNoScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setMap(map);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyMapNoScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyMapApplicationScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyMapApplicationScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setMap(map);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyMapApplicationScope(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyMapSessionScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyMapSessionScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setMap(map);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft, PageContext.SESSION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyMapSessionScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyMapRequestScope()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyMapRequestScope");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ sbft.setMap(map);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft, PageContext.REQUEST_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyMapRequestScope(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+
+ public void testSizeTagNamePropertyMapNoScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyMapNoScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setMap(map);
+ sbft2.setNestedObject(sbft);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft2,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyMapNoScopeNested(WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyMapApplicationScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyMapApplicationScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setMap(map);
+ sbft2.setNestedObject(sbft);
+ pageContext.setAttribute(REQUEST_KEY,
+ sbft2,
+ PageContext.APPLICATION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyMapApplicationScopeNested(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyMapSessionScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyMapSessionScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setMap(map);
+ sbft2.setNestedObject(sbft);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft2, PageContext.SESSION_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyMapSessionScopeNested(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
+
+ public void testSizeTagNamePropertyMapRequestScopeNested()
+ throws IOException, ServletException {
+ request.setAttribute("runTest",
+ "testSizeTagNamePropertyMapRequestScopeNested");
+ SimpleBeanForTesting sbft = new SimpleBeanForTesting();
+ SimpleBeanForTesting sbft2 = new SimpleBeanForTesting();
+ sbft.setMap(map);
+ sbft2.setNestedObject(sbft);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft2, PageContext.REQUEST_SCOPE);
+ pageContext.forward("/org/apache/struts/taglib/bean/TestSizeTag.jsp");
+ }
+
+ public void endSizeTagNamePropertyMapRequestScopeNested(
+ WebResponse response) {
+ formatAndTest("3", response.getText());
+ }
}
Modified: struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestStrutsTag.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestStrutsTag.java?rev=376846&r1=376845&r2=376846&view=diff
==============================================================================
--- struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestStrutsTag.java (original)
+++ struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestStrutsTag.java Fri Feb 10 13:05:03 2006
@@ -17,24 +17,21 @@
*/
package org.apache.struts.taglib.bean;
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-
import junit.framework.Test;
import junit.framework.TestSuite;
-
import org.apache.cactus.WebResponse;
import org.apache.struts.taglib.TaglibTestBase;
+import javax.servlet.ServletException;
+import java.io.IOException;
+
/**
- * Suite of unit tests for the
- * <code>org.apache.struts.taglib.bean.StrutsTag</code> class.
- *
+ * Suite of unit tests for the <code>org.apache.struts.taglib.bean.StrutsTag</code>
+ * class.
*/
public class TestStrutsTag extends TaglibTestBase {
- protected final static String TEST_VAL = "Test Value";
- protected final static String REQUEST_KEY = "REQUEST_KEY";
+ protected final static String TEST_VAL = "Test Value";
+ protected final static String REQUEST_KEY = "REQUEST_KEY";
/**
* Defines the testcase name for JUnit.
@@ -51,7 +48,8 @@
* @param theArgs the arguments. Not used
*/
public static void main(String[] theArgs) {
- junit.awtui.TestRunner.main(new String[] {TestStrutsTag.class.getName()});
+ junit.awtui.TestRunner
+ .main(new String[] { TestStrutsTag.class.getName() });
}
/**
@@ -62,49 +60,57 @@
// All methods starting with "test" will be executed in the test suite.
return new TestSuite(TestStrutsTag.class);
}
-
- private void formatAndTest(String compare, String output) {
- //fix for introduced carriage return / line feeds
- output = replace(output,"\r","");
- output = replace(output,"\n","");
- output = output.trim();
- //System.out.println("Testing [" + compare + "] == [" + output + "]");
- assertEquals(compare, output);
- }
+ private void formatAndTest(String compare, String output) {
+ //fix for introduced carriage return / line feeds
+ output = replace(output, "\r", "");
+ output = replace(output, "\n", "");
+ output = output.trim();
+ //System.out.println("Testing [" + compare + "] == [" + output + "]");
+ assertEquals(compare, output);
+ }
+
+
+ public void testStrutsTagFormBean() throws IOException, ServletException {
+ request.setAttribute("runTest", "testStrutsTagFormBean");
+ pageContext
+ .forward("/org/apache/struts/taglib/bean/TestStrutsTag.jsp");
+ }
+
+ public void endStrutsTagFormBean(WebResponse response) {
+ formatAndTest("testFormBean", response.getText());
+ }
+
+ public void testStrutsTagDynaFormBean()
+ throws IOException, ServletException {
+ request.setAttribute("runTest", "testStrutsTagDynaFormBean");
+ pageContext
+ .forward("/org/apache/struts/taglib/bean/TestStrutsTag.jsp");
+ }
+
+ public void endStrutsTagDynaFormBean(WebResponse response) {
+ formatAndTest("testDynaFormBean", response.getText());
+ }
+
+ public void testStrutsTagForward() throws IOException, ServletException {
+ request.setAttribute("runTest", "testStrutsTagForward");
+ pageContext
+ .forward("/org/apache/struts/taglib/bean/TestStrutsTag.jsp");
+ }
+
+ public void endStrutsTagForward(WebResponse response) {
+ formatAndTest("testIncludeTagForward", response.getText());
+ }
+ public void testStrutsTagMapping() throws IOException, ServletException {
+ request.setAttribute("runTest", "testStrutsTagMapping");
+ pageContext
+ .forward("/org/apache/struts/taglib/bean/TestStrutsTag.jsp");
+ }
- public void testStrutsTagFormBean() throws IOException, ServletException{
- request.setAttribute("runTest", "testStrutsTagFormBean");
- pageContext.forward("/org/apache/struts/taglib/bean/TestStrutsTag.jsp");
- }
- public void endStrutsTagFormBean(WebResponse response){
- formatAndTest("testFormBean", response.getText());
- }
-
- public void testStrutsTagDynaFormBean() throws IOException, ServletException{
- request.setAttribute("runTest", "testStrutsTagDynaFormBean");
- pageContext.forward("/org/apache/struts/taglib/bean/TestStrutsTag.jsp");
- }
- public void endStrutsTagDynaFormBean(WebResponse response){
- formatAndTest("testDynaFormBean", response.getText());
- }
-
- public void testStrutsTagForward() throws IOException, ServletException{
- request.setAttribute("runTest", "testStrutsTagForward");
- pageContext.forward("/org/apache/struts/taglib/bean/TestStrutsTag.jsp");
- }
- public void endStrutsTagForward(WebResponse response){
- formatAndTest("testIncludeTagForward", response.getText());
- }
-
- public void testStrutsTagMapping() throws IOException, ServletException{
- request.setAttribute("runTest", "testStrutsTagMapping");
- pageContext.forward("/org/apache/struts/taglib/bean/TestStrutsTag.jsp");
- }
- public void endStrutsTagMapping(WebResponse response){
- formatAndTest("/testIncludeTagTransaction", response.getText());
- }
+ public void endStrutsTagMapping(WebResponse response) {
+ formatAndTest("/testIncludeTagTransaction", response.getText());
+ }
}
Modified: struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestWriteTag.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestWriteTag.java?rev=376846&r1=376845&r2=376846&view=diff
==============================================================================
--- struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestWriteTag.java (original)
+++ struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/TestWriteTag.java Fri Feb 10 13:05:03 2006
@@ -17,29 +17,26 @@
*/
package org.apache.struts.taglib.bean;
-import java.util.Locale;
-
-import javax.servlet.jsp.PageContext;
-
import junit.framework.Test;
import junit.framework.TestSuite;
-
import org.apache.cactus.WebResponse;
import org.apache.struts.Globals;
import org.apache.struts.taglib.SimpleBeanForTesting;
import org.apache.struts.taglib.TagUtils;
import org.apache.struts.taglib.TaglibTestBase;
+import javax.servlet.jsp.PageContext;
+import java.util.Locale;
+
/**
- * Suite of unit tests for the
- * <code>org.apache.struts.taglib.bean.WriteTag</code> class.
- *
+ * Suite of unit tests for the <code>org.apache.struts.taglib.bean.WriteTag</code>
+ * class.
*/
public class TestWriteTag extends TaglibTestBase {
- protected final static String TEST_STRING_VAL = "Test Value";
- protected final static Integer TEST_INTEGER_VAL = new Integer("1234");
- protected final static Double TEST_DOUBLE_VAL = new Double("1234.5961");
- protected final static String REQUEST_KEY = "REQUEST_KEY";
+ protected final static String TEST_STRING_VAL = "Test Value";
+ protected final static Integer TEST_INTEGER_VAL = new Integer("1234");
+ protected final static Double TEST_DOUBLE_VAL = new Double("1234.5961");
+ protected final static String REQUEST_KEY = "REQUEST_KEY";
/**
* Defines the testcase name for JUnit.
@@ -56,7 +53,8 @@
* @param theArgs the arguments. Not used
*/
public static void main(String[] theArgs) {
- junit.awtui.TestRunner.main(new String[] {TestWriteTag.class.getName()});
+ junit.awtui.TestRunner
+ .main(new String[] { TestWriteTag.class.getName() });
}
/**
@@ -68,129 +66,174 @@
return new TestSuite(TestWriteTag.class);
}
- private void formatAndTest(String compare, String output) {
- //fix for introduced carriage return / line feeds
- output = replace(output,"\r","");
- output = replace(output,"\n","");
- output = output.trim();
- //System.out.println("Testing [" + compare + "] == [" + output + "]");
- assertEquals(compare, output);
- }
+ private void formatAndTest(String compare, String output) {
+ //fix for introduced carriage return / line feeds
+ output = replace(output, "\r", "");
+ output = replace(output, "\n", "");
+ output = output.trim();
+ //System.out.println("Testing [" + compare + "] == [" + output + "]");
+ assertEquals(compare, output);
+ }
private void runMyTest(String whichTest, String locale) throws Exception {
- pageContext.setAttribute(Globals.LOCALE_KEY, new Locale(locale, locale), PageContext.SESSION_SCOPE);
- request.setAttribute("runTest", whichTest);
- pageContext.forward("/org/apache/struts/taglib/bean/TestWriteTag.jsp");
+ pageContext.setAttribute(Globals.LOCALE_KEY,
+ new Locale(locale, locale),
+ PageContext.SESSION_SCOPE);
+ request.setAttribute("runTest", whichTest);
+ pageContext
+ .forward("/org/apache/struts/taglib/bean/TestWriteTag.jsp");
}
- // Name
+ // Name
public void testWriteTagName() throws Exception {
- pageContext.setAttribute(REQUEST_KEY,TEST_STRING_VAL,PageContext.REQUEST_SCOPE);
- runMyTest("testWriteTagName", "");
- }
- public void endWriteTagName(WebResponse response){
- formatAndTest(TEST_STRING_VAL, response.getText());
- }
+ pageContext.setAttribute(REQUEST_KEY,
+ TEST_STRING_VAL,
+ PageContext.REQUEST_SCOPE);
+ runMyTest("testWriteTagName", "");
+ }
+
+ public void endWriteTagName(WebResponse response) {
+ formatAndTest(TEST_STRING_VAL, response.getText());
+ }
- // Property
+ // Property
public void testWriteTagNameProperty() throws Exception {
SimpleBeanForTesting sbft = new SimpleBeanForTesting(TEST_STRING_VAL);
- pageContext.setAttribute(REQUEST_KEY, sbft,PageContext.REQUEST_SCOPE);
- runMyTest("testWriteTagNameProperty", "");
- }
- public void endWriteTagNameProperty(WebResponse response){
- formatAndTest(TEST_STRING_VAL, response.getText());
- }
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft, PageContext.REQUEST_SCOPE);
+ runMyTest("testWriteTagNameProperty", "");
+ }
+
+ public void endWriteTagNameProperty(WebResponse response) {
+ formatAndTest(TEST_STRING_VAL, response.getText());
+ }
- // Name and Format
+ // Name and Format
public void testWriteTagNameFormat() throws Exception {
- pageContext.setAttribute(REQUEST_KEY,TEST_INTEGER_VAL,PageContext.REQUEST_SCOPE);
- runMyTest("testWriteTagNameFormat", "");
- }
- public void endWriteTagNameFormat(WebResponse response){
- formatAndTest("1,234" , response.getText());
- }
+ pageContext.setAttribute(REQUEST_KEY,
+ TEST_INTEGER_VAL,
+ PageContext.REQUEST_SCOPE);
+ runMyTest("testWriteTagNameFormat", "");
+ }
+
+ public void endWriteTagNameFormat(WebResponse response) {
+ formatAndTest("1,234", response.getText());
+ }
- // Name, Format, and FormatKey (default bundle)
+ // Name, Format, and FormatKey (default bundle)
public void testWriteTagNameFormatKeyDefaultBundle() throws Exception {
- pageContext.setAttribute(REQUEST_KEY,TEST_INTEGER_VAL,PageContext.REQUEST_SCOPE);
- runMyTest("testWriteTagNameFormatKeyDefaultBundle", "");
- }
- public void endWriteTagNameFormatKeyDefaultBundle(WebResponse response){
- formatAndTest("$1,234" , response.getText());
- }
+ pageContext.setAttribute(REQUEST_KEY,
+ TEST_INTEGER_VAL,
+ PageContext.REQUEST_SCOPE);
+ runMyTest("testWriteTagNameFormatKeyDefaultBundle", "");
+ }
+
+ public void endWriteTagNameFormatKeyDefaultBundle(WebResponse response) {
+ formatAndTest("$1,234", response.getText());
+ }
- // Name, Format, and FormatKey (alternate bundle)
+ // Name, Format, and FormatKey (alternate bundle)
public void testWriteTagNameFormatKeyAlternateBundle() throws Exception {
- pageContext.setAttribute(REQUEST_KEY,TEST_INTEGER_VAL,PageContext.REQUEST_SCOPE);
- runMyTest("testWriteTagNameFormatKeyAlternateBundle", "");
- }
- public void endWriteTagNameFormatKeyAlternateBundle(WebResponse response){
- formatAndTest("$1,234" , response.getText());
- }
-
- // Name, Format, and FormatKey (default bundle) (Double)
- public void testWriteTagNameFormatKeyDefaultBundleDouble() throws Exception {
- pageContext.setAttribute(REQUEST_KEY, TEST_DOUBLE_VAL,PageContext.REQUEST_SCOPE);
- runMyTest("testWriteTagNameFormatKeyDefaultBundleDouble", "");
- }
- public void endWriteTagNameFormatKeyDefaultBundleDouble(WebResponse response){
- formatAndTest("$1,235" , response.getText());
- }
-
- // Name, Format, and FormatKey (alternate bundle) (Double)
- public void testWriteTagNameFormatKeyAlternateBundleDouble() throws Exception {
- pageContext.setAttribute(REQUEST_KEY,TEST_DOUBLE_VAL,PageContext.REQUEST_SCOPE);
- runMyTest("testWriteTagNameFormatKeyAlternateBundleDouble", "");
- }
- public void endWriteTagNameFormatKeyAlternateBundleDouble(WebResponse response){
- formatAndTest("$1,234.6" , response.getText());
- }
+ pageContext.setAttribute(REQUEST_KEY,
+ TEST_INTEGER_VAL,
+ PageContext.REQUEST_SCOPE);
+ runMyTest("testWriteTagNameFormatKeyAlternateBundle", "");
+ }
+
+ public void endWriteTagNameFormatKeyAlternateBundle(
+ WebResponse response) {
+ formatAndTest("$1,234", response.getText());
+ }
- // Name, Format, and FormatKey (default bundle)
+ // Name, Format, and FormatKey (default bundle) (Double)
+ public void testWriteTagNameFormatKeyDefaultBundleDouble()
+ throws Exception {
+ pageContext.setAttribute(REQUEST_KEY,
+ TEST_DOUBLE_VAL,
+ PageContext.REQUEST_SCOPE);
+ runMyTest("testWriteTagNameFormatKeyDefaultBundleDouble", "");
+ }
+
+ public void endWriteTagNameFormatKeyDefaultBundleDouble(
+ WebResponse response) {
+ formatAndTest("$1,235", response.getText());
+ }
+
+ // Name, Format, and FormatKey (alternate bundle) (Double)
+ public void testWriteTagNameFormatKeyAlternateBundleDouble()
+ throws Exception {
+ pageContext.setAttribute(REQUEST_KEY,
+ TEST_DOUBLE_VAL,
+ PageContext.REQUEST_SCOPE);
+ runMyTest("testWriteTagNameFormatKeyAlternateBundleDouble", "");
+ }
+
+ public void endWriteTagNameFormatKeyAlternateBundleDouble(
+ WebResponse response) {
+ formatAndTest("$1,234.6", response.getText());
+ }
+
+ // Name, Format, and FormatKey (default bundle)
public void testWriteTagNameFormatKeyDefaultBundle_fr() throws Exception {
- pageContext.setAttribute(REQUEST_KEY, TEST_DOUBLE_VAL,PageContext.REQUEST_SCOPE);
- runMyTest("testWriteTagNameFormatKeyDefaultBundle", "fr");
- }
- public void endWriteTagNameFormatKeyDefaultBundle_fr(WebResponse response){
- formatAndTest("$1234,5961.", response.getText());
- }
-
- // Name, Format, and FormatKey (alternate bundle)
- public void testWriteTagNameFormatKeyAlternateBundle_fr() throws Exception {
- pageContext.setAttribute(REQUEST_KEY,TEST_DOUBLE_VAL,PageContext.REQUEST_SCOPE);
- runMyTest("testWriteTagNameFormatKeyAlternateBundle", "fr");
- }
- public void endWriteTagNameFormatKeyAlternateBundle_fr(WebResponse response){
- formatAndTest("$1234,5961." , response.getText());
- }
+ pageContext.setAttribute(REQUEST_KEY,
+ TEST_DOUBLE_VAL,
+ PageContext.REQUEST_SCOPE);
+ runMyTest("testWriteTagNameFormatKeyDefaultBundle", "fr");
+ }
+
+ public void endWriteTagNameFormatKeyDefaultBundle_fr(
+ WebResponse response) {
+ formatAndTest("$1234,5961.", response.getText());
+ }
+
+ // Name, Format, and FormatKey (alternate bundle)
+ public void testWriteTagNameFormatKeyAlternateBundle_fr()
+ throws Exception {
+ pageContext.setAttribute(REQUEST_KEY,
+ TEST_DOUBLE_VAL,
+ PageContext.REQUEST_SCOPE);
+ runMyTest("testWriteTagNameFormatKeyAlternateBundle", "fr");
+ }
+
+ public void endWriteTagNameFormatKeyAlternateBundle_fr(
+ WebResponse response) {
+ formatAndTest("$1234,5961.", response.getText());
+ }
- // Name, Property, and Format
+ // Name, Property, and Format
public void testWriteTagNamePropertyFormat() throws Exception {
- SimpleBeanForTesting sbft = new SimpleBeanForTesting(TEST_INTEGER_VAL);
- pageContext.setAttribute(REQUEST_KEY, sbft,PageContext.REQUEST_SCOPE);
- runMyTest("testWriteTagNamePropertyFormat", "");
- }
- public void endWriteTagNamePropertyFormat(WebResponse response){
- formatAndTest("1,234", response.getText());
- }
+ SimpleBeanForTesting sbft =
+ new SimpleBeanForTesting(TEST_INTEGER_VAL);
+ pageContext
+ .setAttribute(REQUEST_KEY, sbft, PageContext.REQUEST_SCOPE);
+ runMyTest("testWriteTagNamePropertyFormat", "");
+ }
+
+ public void endWriteTagNamePropertyFormat(WebResponse response) {
+ formatAndTest("1,234", response.getText());
+ }
- // Name and ignore
+ // Name and ignore
public void testWriteTagNameIgnore() throws Exception {
- runMyTest("testWriteTagNameIgnore", "");
- }
- public void endWriteTagNameIgnore(WebResponse response){
- formatAndTest("", response.getText());
- }
+ runMyTest("testWriteTagNameIgnore", "");
+ }
+
+ public void endWriteTagNameIgnore(WebResponse response) {
+ formatAndTest("", response.getText());
+ }
- // Name and filter
+ // Name and filter
public void testWriteTagNameFilter() throws Exception {
- pageContext.setAttribute(REQUEST_KEY,"<testing&'\">",PageContext.REQUEST_SCOPE);
- runMyTest("testWriteTagNameFilter", "");
- }
- public void endWriteTagNameFilter(WebResponse response){
- formatAndTest(TagUtils.getInstance().filter("<testing&'\">"), response.getText());
- }
+ pageContext.setAttribute(REQUEST_KEY,
+ "<testing&'\">",
+ PageContext.REQUEST_SCOPE);
+ runMyTest("testWriteTagNameFilter", "");
+ }
+
+ public void endWriteTagNameFilter(WebResponse response) {
+ formatAndTest(TagUtils.getInstance().filter("<testing&'\">"),
+ response.getText());
+ }
}
Modified: struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/resources/FormTagTestAction.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/resources/FormTagTestAction.java?rev=376846&r1=376845&r2=376846&view=diff
==============================================================================
--- struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/resources/FormTagTestAction.java (original)
+++ struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/resources/FormTagTestAction.java Fri Feb 10 13:05:03 2006
@@ -18,23 +18,24 @@
package org.apache.struts.taglib.bean.resources;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
-public class FormTagTestAction extends Action{
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class FormTagTestAction extends Action {
+
+ public ActionForward execute(ActionMapping mapping,
+ ActionForm form, HttpServletRequest request,
+ HttpServletResponse response)
+ throws Exception {
+
+ return mapping.findForward("success");
- public ActionForward execute(ActionMapping mapping,
- ActionForm form, HttpServletRequest request,
- HttpServletResponse response) throws Exception {
-
- return mapping.findForward("success");
-
- }
+ }
}
Modified: struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/resources/IncludeTagTransactionTestAction.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/resources/IncludeTagTransactionTestAction.java?rev=376846&r1=376845&r2=376846&view=diff
==============================================================================
--- struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/resources/IncludeTagTransactionTestAction.java (original)
+++ struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/bean/resources/IncludeTagTransactionTestAction.java Fri Feb 10 13:05:03 2006
@@ -18,23 +18,24 @@
package org.apache.struts.taglib.bean.resources;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
-public class IncludeTagTransactionTestAction extends Action{
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public class IncludeTagTransactionTestAction extends Action {
+
+ public ActionForward execute(ActionMapping mapping,
+ ActionForm form, HttpServletRequest request,
+ HttpServletResponse response)
+ throws Exception {
+
+ return mapping.findForward("success");
- public ActionForward execute(ActionMapping mapping,
- ActionForm form, HttpServletRequest request,
- HttpServletResponse response) throws Exception {
-
- return mapping.findForward("success");
-
- }
+ }
}
Modified: struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestBaseTag.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestBaseTag.java?rev=376846&r1=376845&r2=376846&view=diff
==============================================================================
--- struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestBaseTag.java (original)
+++ struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestBaseTag.java Fri Feb 10 13:05:03 2006
@@ -19,15 +19,12 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-
import org.apache.struts.taglib.TaglibTestBase;
-
/**
- * Suite of unit tests for the
- * <code>org.apache.struts.taglib.html.BaseTag</code> class.
- *
+ * Suite of unit tests for the <code>org.apache.struts.taglib.html.BaseTag</code>
+ * class.
*/
public class TestBaseTag extends TaglibTestBase {
@@ -46,7 +43,8 @@
* @param theArgs the arguments. Not used
*/
public static void main(String[] theArgs) {
- junit.awtui.TestRunner.main(new String[] {TestBaseTag.class.getName()});
+ junit.awtui.TestRunner
+ .main(new String[] { TestBaseTag.class.getName() });
}
/**
@@ -60,12 +58,12 @@
private void runMyTest(String whichTest) throws Exception {
request.setAttribute("runTest", whichTest);
- pageContext.forward("/org/apache/struts/taglib/html/TestBaseTag.jsp");
+ pageContext.forward("/org/apache/struts/taglib/html/TestBaseTag.jsp");
}
-
+
/*
- * Testing BaseTag.
- */
+ * Testing BaseTag.
+ */
public void testBase() throws Exception {
runMyTest("testBase");
}
Modified: struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestButtonTag1.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestButtonTag1.java?rev=376846&r1=376845&r2=376846&view=diff
==============================================================================
--- struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestButtonTag1.java (original)
+++ struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestButtonTag1.java Fri Feb 10 13:05:03 2006
@@ -17,19 +17,17 @@
*/
package org.apache.struts.taglib.html;
-import java.util.Locale;
-
-import javax.servlet.jsp.PageContext;
import junit.framework.Test;
import junit.framework.TestSuite;
-
import org.apache.cactus.JspTestCase;
import org.apache.struts.Globals;
+import javax.servlet.jsp.PageContext;
+import java.util.Locale;
+
/**
- * Suite of unit tests for the
- * <code>org.apache.struts.taglib.html.ButtonTag</code> class.
- *
+ * Suite of unit tests for the <code>org.apache.struts.taglib.html.ButtonTag</code>
+ * class.
*/
public class TestButtonTag1 extends JspTestCase {
@@ -48,7 +46,8 @@
* @param theArgs the arguments. Not used
*/
public static void main(String[] theArgs) {
- junit.awtui.TestRunner.main(new String[] {TestButtonTag1.class.getName()});
+ junit.awtui.TestRunner
+ .main(new String[] { TestButtonTag1.class.getName() });
}
/**
@@ -61,96 +60,111 @@
}
private void runMyTest(String whichTest, String locale) throws Exception {
- pageContext.setAttribute(Globals.LOCALE_KEY, new Locale(locale, locale), PageContext.SESSION_SCOPE);
+ pageContext.setAttribute(Globals.LOCALE_KEY,
+ new Locale(locale, locale),
+ PageContext.SESSION_SCOPE);
request.setAttribute("runTest", whichTest);
- pageContext.forward("/org/apache/struts/taglib/html/TestButtonTag1.jsp"); }
+ pageContext
+ .forward("/org/apache/struts/taglib/html/TestButtonTag1.jsp");
+ }
/*
* Testing ButtonTag.
*/
public void testButtonProperty() throws Exception {
runMyTest("testButtonProperty", "");
- }
+ }
+
public void testButtonPropertyAccesskey() throws Exception {
runMyTest("testButtonPropertyAccesskey", "");
- }
+ }
+
public void testButtonPropertyAlt() throws Exception {
runMyTest("testButtonPropertyAlt", "");
- }
+ }
+
public void testButtonPropertyAltKey1() throws Exception {
runMyTest("testButtonPropertyAltKey1", "");
- }
+ }
+
public void testButtonPropertyAltKey2() throws Exception {
runMyTest("testButtonPropertyAltKey2", "");
- }
+ }
+
public void testButtonPropertyAltKey3() throws Exception {
runMyTest("testButtonPropertyAltKey3", "");
}
+
public void testButtonPropertyAltKey_fr1() throws Exception {
runMyTest("testButtonPropertyAltKey1_fr", "fr");
- }
+ }
+
public void testButtonPropertyAltKey_fr2() throws Exception {
runMyTest("testButtonPropertyAltKey2_fr", "fr");
- }
+ }
+
public void testButtonPropertyDisabled_True() throws Exception {
runMyTest("testButtonPropertyDisabled_True", "");
- }
+ }
+
public void testButtonPropertyDisabled_False1() throws Exception {
runMyTest("testButtonPropertyDisabled_False1", "");
- }
+ }
+
public void testButtonPropertyDisabled_False2() throws Exception {
runMyTest("testButtonPropertyDisabled_False2", "");
- }
+ }
+
public void testButtonPropertyOnblur() throws Exception {
runMyTest("testButtonPropertyOnblur", "");
- }
+ }
public void testButtonPropertyOnchange() throws Exception {
runMyTest("testButtonPropertyOnchange", "");
- }
+ }
public void testButtonPropertyOnclick() throws Exception {
runMyTest("testButtonPropertyOnclick", "");
- }
+ }
public void testButtonPropertyOndblclick() throws Exception {
runMyTest("testButtonPropertyOndblclick", "");
- }
+ }
public void testButtonPropertyOnfocus() throws Exception {
runMyTest("testButtonPropertyOnfocus", "");
- }
+ }
public void testButtonPropertyOnkeydown() throws Exception {
runMyTest("testButtonPropertyOnkeydown", "");
- }
+ }
public void testButtonPropertyOnkeypress() throws Exception {
runMyTest("testButtonPropertyOnkeypress", "");
- }
+ }
public void testButtonPropertyOnkeyup() throws Exception {
runMyTest("testButtonPropertyOnkeyup", "");
- }
+ }
public void testButtonPropertyOnmousedown() throws Exception {
runMyTest("testButtonPropertyOnmousedown", "");
- }
+ }
public void testButtonPropertyOnmousemove() throws Exception {
runMyTest("testButtonPropertyOnmousemove", "");
- }
+ }
public void testButtonPropertyOnmouseout() throws Exception {
runMyTest("testButtonPropertyOnmouseout", "");
- }
+ }
public void testButtonPropertyOnmouseover() throws Exception {
runMyTest("testButtonPropertyOnmouseover", "");
- }
+ }
public void testButtonPropertyOnmouseup() throws Exception {
runMyTest("testButtonPropertyOnmouseup", "");
- }
+ }
}
Modified: struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestButtonTag2.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestButtonTag2.java?rev=376846&r1=376845&r2=376846&view=diff
==============================================================================
--- struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestButtonTag2.java (original)
+++ struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestButtonTag2.java Fri Feb 10 13:05:03 2006
@@ -17,23 +17,21 @@
*/
package org.apache.struts.taglib.html;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.StringTokenizer;
-
-import javax.servlet.jsp.PageContext;
import junit.framework.Test;
import junit.framework.TestSuite;
-
import org.apache.cactus.JspTestCase;
import org.apache.struts.Globals;
import org.apache.struts.taglib.SimpleBeanForTesting;
+import javax.servlet.jsp.PageContext;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.StringTokenizer;
+
/**
- * Suite of unit tests for the
- * <code>org.apache.struts.taglib.html.ButtonTag</code> class.
- *
+ * Suite of unit tests for the <code>org.apache.struts.taglib.html.ButtonTag</code>
+ * class.
*/
public class TestButtonTag2 extends JspTestCase {
@@ -52,7 +50,8 @@
* @param theArgs the arguments. Not used
*/
public static void main(String[] theArgs) {
- junit.awtui.TestRunner.main(new String[] {TestButtonTag2.class.getName()});
+ junit.awtui.TestRunner
+ .main(new String[] { TestButtonTag2.class.getName() });
}
/**
@@ -65,9 +64,12 @@
}
private void runMyTest(String whichTest, String locale) throws Exception {
- pageContext.setAttribute(Globals.LOCALE_KEY, new Locale(locale, locale), PageContext.SESSION_SCOPE);
+ pageContext.setAttribute(Globals.LOCALE_KEY,
+ new Locale(locale, locale),
+ PageContext.SESSION_SCOPE);
request.setAttribute("runTest", whichTest);
- pageContext.forward("/org/apache/struts/taglib/html/TestButtonTag2.jsp");
+ pageContext
+ .forward("/org/apache/struts/taglib/html/TestButtonTag2.jsp");
}
/*
@@ -76,54 +78,55 @@
public void testButtonPropertyStyle() throws Exception {
runMyTest("testButtonPropertyStyle", "");
- }
+ }
public void testButtonPropertyStyleClass() throws Exception {
runMyTest("testButtonPropertyStyleClass", "");
- }
+ }
public void testButtonPropertyStyleId() throws Exception {
runMyTest("testButtonPropertyStyleId", "");
- }
+ }
public void testButtonPropertyTabindex() throws Exception {
runMyTest("testButtonPropertyTabindex", "");
- }
+ }
public void testButtonPropertyTitle() throws Exception {
runMyTest("testButtonPropertyTitle", "");
- }
+ }
public void testButtonPropertyTitleKey() throws Exception {
runMyTest("testButtonPropertyTitleKey", "");
- }
+ }
public void testButtonPropertyTitleKey_fr() throws Exception {
runMyTest("testButtonPropertyTitleKey_fr", "fr");
- }
+ }
public void testButtonPropertyValue() throws Exception {
runMyTest("testButtonPropertyValue", "");
- }
+ }
public void testButtonPropertyBodyContent() throws Exception {
runMyTest("testButtonPropertyBodyContent", "");
- }
+ }
public void testButtonPropertyBodyContentMessageKey() throws Exception {
runMyTest("testButtonPropertyBodyContentMessageKey", "");
- }
+ }
- public void testButtonPropertyBodyContentMessageKey_fr() throws Exception {
+ public void testButtonPropertyBodyContentMessageKey_fr()
+ throws Exception {
runMyTest("testButtonPropertyBodyContentMessageKey_fr", "fr");
- }
+ }
public void testButtonPropertyIndexedArray() throws Exception {
ArrayList lst = new ArrayList();
lst.add("Test Message");
pageContext.setAttribute("lst", lst, PageContext.REQUEST_SCOPE);
runMyTest("testButtonPropertyIndexedArray", "");
- }
+ }
public void testButtonPropertyIndexedArrayProperty() throws Exception {
SimpleBeanForTesting sbft = new SimpleBeanForTesting();
@@ -132,14 +135,14 @@
sbft.setList(lst);
pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE);
runMyTest("testButtonPropertyIndexedArrayProperty", "");
- }
+ }
public void testButtonPropertyIndexedMap() throws Exception {
HashMap map = new HashMap();
map.put("tst1", "Test Message");
pageContext.setAttribute("lst", map, PageContext.REQUEST_SCOPE);
runMyTest("testButtonPropertyIndexedMap", "");
- }
+ }
public void testButtonPropertyIndexedMapProperty() throws Exception {
SimpleBeanForTesting sbft = new SimpleBeanForTesting();
@@ -148,22 +151,22 @@
sbft.setMap(map);
pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE);
runMyTest("testButtonPropertyIndexedMapProperty", "");
- }
+ }
public void testButtonPropertyIndexedEnumeration() throws Exception {
StringTokenizer st = new StringTokenizer("Test Message");
pageContext.setAttribute("lst", st, PageContext.REQUEST_SCOPE);
runMyTest("testButtonPropertyIndexedEnumeration", "");
- }
+ }
- public void testButtonPropertyIndexedEnumerationProperty() throws Exception {
+ public void testButtonPropertyIndexedEnumerationProperty()
+ throws Exception {
SimpleBeanForTesting sbft = new SimpleBeanForTesting();
StringTokenizer st = new StringTokenizer("Test Message");
sbft.setEnumeration(st);
pageContext.setAttribute("lst", sbft, PageContext.REQUEST_SCOPE);
runMyTest("testButtonPropertyIndexedEnumerationProperty", "");
- }
-
+ }
}
Modified: struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestCancelTag1.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestCancelTag1.java?rev=376846&r1=376845&r2=376846&view=diff
==============================================================================
--- struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestCancelTag1.java (original)
+++ struts/taglib/trunk/src/test-cactus/org/apache/struts/taglib/html/TestCancelTag1.java Fri Feb 10 13:05:03 2006
@@ -17,19 +17,17 @@
*/
package org.apache.struts.taglib.html;
-import java.util.Locale;
-
-import javax.servlet.jsp.PageContext;
import junit.framework.Test;
import junit.framework.TestSuite;
-
import org.apache.cactus.JspTestCase;
import org.apache.struts.Globals;
+import javax.servlet.jsp.PageContext;
+import java.util.Locale;
+
/**
- * Suite of unit tests for the
- * <code>org.apache.struts.taglib.html.CancelTag</code> class.
- *
+ * Suite of unit tests for the <code>org.apache.struts.taglib.html.CancelTag</code>
+ * class.
*/
public class TestCancelTag1 extends JspTestCase {
@@ -48,7 +46,8 @@
* @param theArgs the arguments. Not used
*/
public static void main(String[] theArgs) {
- junit.awtui.TestRunner.main(new String[] {TestCancelTag1.class.getName()});
+ junit.awtui.TestRunner
+ .main(new String[] { TestCancelTag1.class.getName() });
}
/**
@@ -61,9 +60,12 @@
}
private void runMyTest(String whichTest, String locale) throws Exception {
- pageContext.setAttribute(Globals.LOCALE_KEY, new Locale(locale, locale), PageContext.SESSION_SCOPE);
+ pageContext.setAttribute(Globals.LOCALE_KEY,
+ new Locale(locale, locale),
+ PageContext.SESSION_SCOPE);
request.setAttribute("runTest", whichTest);
- pageContext.forward("/org/apache/struts/taglib/html/TestCancelTag1.jsp");
+ pageContext
+ .forward("/org/apache/struts/taglib/html/TestCancelTag1.jsp");
}
/*
@@ -71,84 +73,94 @@
*/
public void testCancelAccesskey() throws Exception {
runMyTest("testCancelAccesskey", "");
- }
+ }
+
public void testCancelAlt() throws Exception {
runMyTest("testCancelAlt", "");
- }
+ }
+
public void testCancelAltKey1() throws Exception {
runMyTest("testCancelAltKey1", "");
- }
+ }
+
public void testCancelAltKey2() throws Exception {
runMyTest("testCancelAltKey2", "");
- }
+ }
+
public void testCancelAltKey3() throws Exception {
runMyTest("testCancelAltKey3", "");
}
+
public void testCancelAltKey_fr1() throws Exception {
runMyTest("testCancelAltKey1_fr", "fr");
- }
+ }
+
public void testCancelAltKey_fr2() throws Exception {
runMyTest("testCancelAltKey2_fr", "fr");
- }
+ }
+
public void testCancelDisabled_True() throws Exception {
runMyTest("testCancelDisabled_True", "");
- }
+ }
+
public void testCancelDisabled_False1() throws Exception {
runMyTest("testCancelDisabled_False1", "");
- }
+ }
+
public void testCancelDisabled_False2() throws Exception {
runMyTest("testCancelDisabled_False2", "");
- }
+ }
+
public void testCancelOnblur() throws Exception {
runMyTest("testCancelOnblur", "");
- }
+ }
public void testCancelOnchange() throws Exception {
runMyTest("testCancelOnchange", "");
- }
+ }
public void testCancelOnclick() throws Exception {
runMyTest("testCancelOnclick", "");
- }
+ }
public void testCancelOndblclick() throws Exception {
runMyTest("testCancelOndblclick", "");
- }
+ }
public void testCancelOnfocus() throws Exception {
runMyTest("testCancelOnfocus", "");
- }
+ }
public void testCancelOnkeydown() throws Exception {
runMyTest("testCancelOnkeydown", "");
- }
+ }
public void testCancelOnkeypress() throws Exception {
runMyTest("testCancelOnkeypress", "");
- }
+ }
public void testCancelOnkeyup() throws Exception {
runMyTest("testCancelOnkeyup", "");
- }
+ }
public void testCancelOnmousedown() throws Exception {
runMyTest("testCancelOnmousedown", "");
- }
+ }
public void testCancelOnmousemove() throws Exception {
runMyTest("testCancelOnmousemove", "");
- }
+ }
public void testCancelOnmouseout() throws Exception {
runMyTest("testCancelOnmouseout", "");
- }
+ }
public void testCancelOnmouseover() throws Exception {
runMyTest("testCancelOnmouseover", "");
- }
+ }
public void testCancelOnmouseup() throws Exception {
runMyTest("testCancelOnmouseup", "");
- }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org