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:03:35 UTC

svn commit: r376845 [1/2] - in /struts/taglib/trunk/src/test/org/apache/struts/taglib: TagTestBase.java TestTagUtils.java

Author: husted
Date: Fri Feb 10 13:03:34 2006
New Revision: 376845

URL: http://svn.apache.org/viewcvs?rev=376845&view=rev
Log:
Checkstyle Roundup 
* Taglib test package reformatted with latest Jalopy settings. Stylistic changes only.


Modified:
    struts/taglib/trunk/src/test/org/apache/struts/taglib/TagTestBase.java
    struts/taglib/trunk/src/test/org/apache/struts/taglib/TestTagUtils.java

Modified: struts/taglib/trunk/src/test/org/apache/struts/taglib/TagTestBase.java
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/test/org/apache/struts/taglib/TagTestBase.java?rev=376845&r1=376844&r2=376845&view=diff
==============================================================================
--- struts/taglib/trunk/src/test/org/apache/struts/taglib/TagTestBase.java (original)
+++ struts/taglib/trunk/src/test/org/apache/struts/taglib/TagTestBase.java Fri Feb 10 13:03:34 2006
@@ -2,13 +2,13 @@
  * $Id: TaglibTestBase.java 54929 2004-10-16 16:38:42Z germuska $
  *
  * Copyright 1999-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.
@@ -33,86 +33,78 @@
 import org.apache.struts.util.MessageResourcesFactory;
 import org.apache.struts.util.PropertyMessageResources;
 
-public class TagTestBase  extends TestCase{
-
+public class TagTestBase extends TestCase {
     protected TagUtils tagutils = TagUtils.getInstance();
-    
     protected MockServletConfig servletConfig;
     protected MockServletContext servletContext;
-    protected MockHttpServletRequest  request;
+    protected MockHttpServletRequest request;
     protected MockPageContext pageContext;
-    
     protected ModuleConfig moduleConfig;
     protected ModuleConfig moduleConfig2;
     protected ModuleConfig moduleConfig3;
 
-    public TagTestBase(){
+    public TagTestBase() {
         super();
     }
-    public TagTestBase(String theName){
+
+    public TagTestBase(String theName) {
         super(theName);
     }
-    
+
     /**
-     * Helper method that creates/configures a basic 
-     * configuration of Mock Objects.
-     * 
-     * 
-     * PageContext
-     *   ServletConfig
-     *        ServletContext
-     *   HttpServletRequest
-     *        HttpSession
-     * 	 HttpServletResponse
-     * 
-     * "/myapp", "/foo", null, null, 
+     * Helper method that creates/configures a basic configuration of Mock
+     * Objects.
+     *
+     *
+     * PageContext ServletConfig ServletContext HttpServletRequest HttpSession
+     * HttpServletResponse
+     *
+     * "/myapp", "/foo", null, null,
      */
     public void setUp() {
-        
         // -- default Module
         this.moduleConfig = new ModuleConfigImpl("");
-        this.moduleConfig.addForwardConfig(
-                new ForwardConfig("foo", "/bar.jsp", false));
-        this.moduleConfig.addForwardConfig(
-                new ForwardConfig("relative1", "relative.jsp", false));
-        this.moduleConfig.addForwardConfig(
-                new ForwardConfig("relative2", "relative.jsp", false));
-        this.moduleConfig.addForwardConfig(
-                new ForwardConfig("external", "http://struts.apache.org/", false));
-                
+        this.moduleConfig.addForwardConfig(new ForwardConfig("foo", "/bar.jsp",
+                false));
+        this.moduleConfig.addForwardConfig(new ForwardConfig("relative1",
+                "relative.jsp", false));
+        this.moduleConfig.addForwardConfig(new ForwardConfig("relative2",
+                "relative.jsp", false));
+        this.moduleConfig.addForwardConfig(new ForwardConfig("external",
+                "http://struts.apache.org/", false));
+
         // -- module "/2"
         this.moduleConfig2 = new ModuleConfigImpl("/2");
-        this.moduleConfig2.addForwardConfig(
-                new ForwardConfig("foo", "/baz.jsp", false));
-        this.moduleConfig2.addForwardConfig(
-                new ForwardConfig("relative1", "relative.jsp", false));
-        this.moduleConfig2.addForwardConfig(
-                new ForwardConfig("relative2", "relative.jsp", false));
-        this.moduleConfig2.addForwardConfig(
-                new ForwardConfig("external", "http://struts.apache.org/", false));
-        
+        this.moduleConfig2.addForwardConfig(new ForwardConfig("foo",
+                "/baz.jsp", false));
+        this.moduleConfig2.addForwardConfig(new ForwardConfig("relative1",
+                "relative.jsp", false));
+        this.moduleConfig2.addForwardConfig(new ForwardConfig("relative2",
+                "relative.jsp", false));
+        this.moduleConfig2.addForwardConfig(new ForwardConfig("external",
+                "http://struts.apache.org/", false));
+
         // -- module "/3"
         this.moduleConfig3 = new ModuleConfigImpl("/3");
 
         // -- configure the ServletContext
         this.servletContext = new MockServletContext();
         this.servletContext.setAttribute(Globals.MODULE_KEY, moduleConfig);
-        this.servletContext.setAttribute(Globals.MODULE_KEY + "/2", moduleConfig2);
-        this.servletContext.setAttribute(Globals.MODULE_KEY + "/3", moduleConfig3);
-        
+        this.servletContext.setAttribute(Globals.MODULE_KEY + "/2",
+            moduleConfig2);
+        this.servletContext.setAttribute(Globals.MODULE_KEY + "/3",
+            moduleConfig3);
+
         // -- configure the ServletConfig
         this.servletConfig = new MockServletConfig();
         this.servletConfig.setServletContext(servletContext);
-        
+
         // -- configure the request
         this.request = new MockHttpServletRequest(new MockHttpSession());
-        
-        pageContext = new MockPageContext(
-                servletConfig,
-                request,
+
+        pageContext =
+            new MockPageContext(servletConfig, request,
                 new MockHttpServletResponse());
-        
-        
     }
 
     public void tearDown() {
@@ -122,15 +114,15 @@
         this.pageContext = null;
         this.request = null;
     }
-    
 
     protected void putBundleInScope(int scope, boolean returnNull) {
-        MessageResourcesFactory factory = MessageResourcesFactory.createFactory();
-        MessageResources messageResources 
-            = new PropertyMessageResources(factory, "org.apache.struts.taglib.sample");
+        MessageResourcesFactory factory =
+            MessageResourcesFactory.createFactory();
+        MessageResources messageResources =
+            new PropertyMessageResources(factory,
+                "org.apache.struts.taglib.sample");
+
         messageResources.setReturnNull(returnNull);
         pageContext.setAttribute(Globals.MESSAGES_KEY, messageResources, scope);
     }
-    
-    
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org