diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/ActionTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/ActionTest.java
deleted file mode 100644
index 28a088e..0000000
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/ActionTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.pluto.testsuite;
-
-
-/**
- * Empty interface that marks a PortletTest class that has test code which
- * should be run in the <code>Portlet.processAction()</code> method.
- *
- */
-public interface ActionTest extends PortletTest {
-
-	// Empty interface.
-
-}
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/InvalidConfigurationException.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/InvalidConfigurationException.java
index 82e74a6..c5489a9 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/InvalidConfigurationException.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/InvalidConfigurationException.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  * 
  *     http://www.apache.org/licenses/LICENSE-2.0
@@ -22,6 +22,8 @@
  */
 public class InvalidConfigurationException extends RuntimeException {
 
+	private static final long serialVersionUID = -7010299791708559054L;
+
 	public InvalidConfigurationException(String message) {
 		super(message);
 	}
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/NoOpTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/NoOpTest.java
index 7562f9a..f3d21d0 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/NoOpTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/NoOpTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -20,6 +20,8 @@
 import javax.portlet.PortletContext;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletResponse;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -50,8 +52,8 @@
         return "NoOpTest";
     }
 
-    public Map getRenderParameters(PortletRequest request) {
-        return new HashMap();
+    public Map<String, String[]> getRenderParameters(PortletRequest request) {
+        return new HashMap<String, String[]>();
     }
 
     public TestResults doTest(PortletConfig config,
@@ -69,5 +71,10 @@
         return config;
     }
 
+    public void doHeaders(PortletConfig config, PortletContext context,
+            RenderRequest request, RenderResponse response) {
+        
+    }
+
 }
 
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/PortletTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/PortletTest.java
index da20cfe..3ed4f30 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/PortletTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/PortletTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -22,6 +22,8 @@
 import javax.portlet.PortletContext;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletResponse;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
 
 /**
  * Interface for pluto portlet test classes.
@@ -50,7 +52,7 @@
      * @return a map of render parameters, key is the string name of the
      *         parameter, value is a string array.
      */
-    public Map getRenderParameters(PortletRequest request);
+    public Map<String, String[]> getRenderParameters(PortletRequest request);
 
     /**
      * Runs the test.
@@ -71,5 +73,17 @@
      */
     public TestConfig getConfig();
 
+    /**
+     * Called by TestPortlet.doHeaders()
+     * @param config
+     * @param context
+     * @param request
+     * @param response
+     */
+    public void doHeaders(PortletConfig config,
+                          PortletContext context,
+                          RenderRequest request,
+                          RenderResponse response);
+    
 }
 
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestConfig.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestConfig.java
index 8d767e3..a0b7d33 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestConfig.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestConfig.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -34,6 +34,8 @@
  */
 public class TestConfig implements Serializable {
 
+	private static final long serialVersionUID = -6878431356359186658L;
+
 	// Private Member Variables ------------------------------------------------
 
 	/** PortletTest class name. */
@@ -44,14 +46,14 @@
 
     private String displayURI;
 
-    private Map initParameters = new HashMap();
+    private Map<String, String> initParameters = new HashMap<String, String>();
 
     /**
      * The action parameters list holding TestConfig.Parameter objects.
      * We are not using Map to hold action parameters because parameters with
      * the same name are allowed.
      */
-    private List actionParameters = new ArrayList();
+    private List<Parameter> actionParameters = new ArrayList<Parameter>();
 
     /**
      * The render parameters list holding TestConfig.Parameter objects.
@@ -60,7 +62,7 @@
      *
      * FIXME: when is this field used?
      */
-    private List renderParameters = new ArrayList();
+//    private List renderParameters = new ArrayList();
 
 
     // Constructor -------------------------------------------------------------
@@ -102,7 +104,7 @@
         initParameters.put(parameter, value);
     }
 
-    public Map getInitParameters() {
+    public Map<String, String> getInitParameters() {
         return Collections.unmodifiableMap(initParameters);
     }
 
@@ -110,23 +112,27 @@
     	actionParameters.add(new Parameter(name, value));
     }
 
-    public List getActionParameters() {
+    public List<Parameter> getActionParameters() {
     	return actionParameters;
     }
 
     /**
      * FIXME: why is this method required?
      */
+    /*
     public void addRenderParameter(String name, String value) {
     	renderParameters.add(new Parameter(name, value));
     }
+    */
 
     /**
      * FIXME: when is this method used?
      */
+    /*
     public List getRenderParameters() {
     	return renderParameters;
     }
+    */
 
     public String toString() {
     	StringBuffer buffer = new StringBuffer();
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestConfigFactory.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestConfigFactory.java
index 7e13bb3..48c5ac9 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestConfigFactory.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestConfigFactory.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -86,9 +86,10 @@
      * @throws IOException  if an IO error occurs.
      * @see TestConfig
      */
-    public List createTestConfigs(InputStream in)
+    @SuppressWarnings("unchecked")
+	public List<TestConfig> createTestConfigs(InputStream in)
     throws SAXException, IOException {
-        return (List) digester.parse(in);
+        return (List<TestConfig>) digester.parse(in);
     }
 
 }
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestPortlet.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestPortlet.java
index 6a55339..bac913a 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestPortlet.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestPortlet.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -16,26 +16,33 @@
  */
 package org.apache.pluto.testsuite;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
 import javax.portlet.GenericPortlet;
 import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletRequestDispatcher;
 import javax.portlet.PortletSession;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.StateAwareResponse;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
 /**
  * Pluto testsuite's test portlet.
  *
@@ -45,20 +52,20 @@
  */
 public class TestPortlet extends GenericPortlet {
 
-	/** Internal logger. */
-	private static final Log LOG = LogFactory.getLog(TestPortlet.class);
+    /** Internal logger. */
+    private static final Log LOG = LogFactory.getLog(TestPortlet.class);
 
 
-	// Private Member Variables ------------------------------------------------
+    // Private Member Variables ------------------------------------------------
 
-	/** List of test configurations. */
-    private List testConfigs;
+    /** List of test configurations. */
+    private List<TestConfig> testConfigs;
 
     /**
      * Map of test instances: key is an integer ID (as a string), and value is
      * the <code>PortletTest</code> instances.
      */
-    private Map tests;
+    private Map<String, PortletTest> tests;
 
 
     // GenericPortlet Impl -----------------------------------------------------
@@ -68,9 +75,10 @@
      * files, constructs and initializes all <code>PortletTest</code> instances.
      * @throws PortletException if fail to read the configuration file.
      */
+    @SuppressWarnings("unchecked")
     public void init() throws PortletException {
 
-    	// Get configuration file name.
+        // Get configuration file name.
         String configFile = getInitParameter("config");
         if (configFile == null) {
             configFile = "/WEB-INF/testsuite-config.xml";
@@ -79,39 +87,39 @@
         // Get configuration file as an input stream.
         InputStream is = getPortletContext().getResourceAsStream(configFile);
         if (is == null) {
-        	String message = "Testsuite configuration file not found.";
-        	LOG.error(message);
-        	throw new PortletException(message);
+            String message = "Testsuite configuration file not found.";
+            LOG.error(message);
+            throw new PortletException(message);
         }
 
         // Load PortletTest instances: constructing and initializing.
         TestConfigFactory factory = new TestConfigFactory();
         try {
-        	testConfigs = factory.createTestConfigs(is);
-            tests = new HashMap();
+            testConfigs = factory.createTestConfigs(is);
+            tests = new HashMap<String, PortletTest>();
             int i = 0;
-            for (Iterator it = testConfigs.iterator(); it.hasNext(); ) {
-                TestConfig testConfig = (TestConfig) it.next();
+            for (TestConfig testConfig : testConfigs) {
                 String name = testConfig.getTestClassName();
                 PortletTest test = null;
                 if (name != null) {
-                	if (LOG.isDebugEnabled()) {
-                		LOG.debug("Loading test: " + name);
-                	}
-                    Class clazz = Class.forName(testConfig.getTestClassName());
-                    test = (PortletTest) clazz.newInstance();
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Loading test: " + name);
+                    }
+                    Class<PortletTest> clazz = (Class<PortletTest>)
+                        Class.forName(testConfig.getTestClassName());
+                    test = clazz.newInstance();
                 } else {
-                	if (LOG.isDebugEnabled()) {
-                		LOG.debug("Loading NoOpTest (test with no name).");
-                	}
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("Loading NoOpTest (test with no name).");
+                    }
                     test = new NoOpTest();
                 }
                 test.init(testConfig);
                 tests.put(String.valueOf(i++), test);
             }
         } catch (Throwable th) {
-        	String message = "Unable to read testsuite configuration.";
-        	LOG.error(message, th);
+            String message = "Unable to read testsuite configuration.";
+            LOG.error(message, th);
             throw new PortletException(message, th);
         }
     }
@@ -119,29 +127,60 @@
 
     public void processAction(ActionRequest request, ActionResponse response)
     throws PortletException, IOException {
+        this.processStateAwarePhase(request, response);
+    }
+    
+    protected void doHeaders(RenderRequest request, RenderResponse response) {
+        if (PortletMode.VIEW.equals(request.getPortletMode())) {
+            String testId = getTestId(request);
+            PortletTest test = (PortletTest) tests.get(testId);
+            if (test != null)
+                test.doHeaders( getPortletConfig(), 
+                                getPortletContext(), 
+                                request,
+                                response);
+        }
+    }
 
+    private void processStateAwarePhase(
+            PortletRequest request, StateAwareResponse response) {
         String testId = getTestId(request);
         PortletTest test = (PortletTest) tests.get(testId);
-
-        // For ActionTest, run test and save results in session.
-        if (test != null && test instanceof ActionTest) {
+        if (test != null) {
             TestResults results = test.doTest(getPortletConfig(),
                                               getPortletContext(),
                                               request,
                                               response);
             PortletSession session = request.getPortletSession();
-            session.setAttribute(test.getClass().getName(), results);
+            TestResults existingResults = (TestResults) 
+                session.getAttribute(test.getClass().getName());
+            if (existingResults != null) {
+                existingResults.getCollection().addAll(results.getCollection());
+            } else {
+                session.setAttribute(test.getClass().getName(), results);
+            }
         }
-
-        Map renderParameters = null;
+        Map<String, String[]> renderParameters = null;
         if (test != null) {
             renderParameters = test.getRenderParameters(request);
         }
         if (renderParameters == null) {
-            renderParameters = new HashMap();
+            renderParameters = new HashMap<String, String[]>();
         }
         renderParameters.put("testId", new String[] { testId });
-        response.setRenderParameters(renderParameters);
+        response.setRenderParameters(renderParameters);        
+    }
+
+    public void processEvent(EventRequest request, EventResponse response)
+            throws PortletException, IOException {
+        this.processStateAwarePhase(request, response);
+    }
+
+
+    public void serveResource(ResourceRequest arg0, ResourceResponse arg1)
+            throws PortletException, IOException {
+        // TODO: Add resource serving support
+        super.serveResource(arg0, arg1);
     }
 
     /**
@@ -154,47 +193,58 @@
     public void doView(RenderRequest request, RenderResponse response)
     throws PortletException, IOException {
 
-    	// Get the current test ID, the test instance and its config.
+        // Get the current test ID, the test instance and its config.
         String testId = getTestId(request);
         TestConfig testConfig = null;
         PortletTest test = null;
         if (testId != null) {
-        	testConfig = (TestConfig) testConfigs.get(Integer.parseInt(testId));
-        	test = (PortletTest) tests.get(testId);
+            testConfig = (TestConfig) testConfigs.get(Integer.parseInt(testId));
+            test = (PortletTest) tests.get(testId);
         }
-
+        
+        if (LOG.isDebugEnabled()) {
+            for (Entry<String, String[]> e : request.getParameterMap().entrySet()) {
+                LOG.debug(e.getKey() + " => " + Arrays.asList(e.getValue()));
+            }
+            
+            LOG.debug("Test ID: " + testId);
+            LOG.debug("Test Config: " + testConfig);
+            if (testConfig != null) {
+                LOG.debug("Test config view: " + testConfig.getDisplayURI());
+            }
+        }
         // For non-ActionTest, run test and save results in request.
-        if (test != null && !(test instanceof ActionTest)) {
+        if (test != null) {
             TestResults results = test.doTest(getPortletConfig(),
                                               getPortletContext(),
                                               request,
                                               response);
-            request.setAttribute("results", results);
-        }
-        // For ActionTest, retrieve results from session and save in request.
-        else if (test != null) {
             PortletSession session = request.getPortletSession();
-            TestResults results = (TestResults) session.getAttribute(
-            		test.getClass().getName());
-            request.setAttribute("results", results);
+            TestResults existing = (TestResults) session.getAttribute(
+                    test.getClass().getName());
+            if (existing != null) {
+                existing.getCollection().addAll(results.getCollection());
+                request.setAttribute("results", existing);
+                session.setAttribute(test.getClass().getName(), null);
+            } else {
+                request.setAttribute("results", results);
+            }
         }
 
-
         if (testId == null) {
-        	// FIXME: update attribute name from tests to testConfigs.
-            request.setAttribute("tests", testConfigs);
+            request.setAttribute("testConfigs", testConfigs);
         } else {
             TestConfig nextTestConfig = null;
             TestConfig prevTestConfig = null;
             int index = testConfigs.indexOf(test.getConfig());
             if (index == 0) {
-            	prevTestConfig = (TestConfig) testConfigs.get(testConfigs.size() - 1);
+                prevTestConfig = (TestConfig) testConfigs.get(testConfigs.size() - 1);
                 nextTestConfig = (TestConfig) testConfigs.get(index + 1);
             } else if (index == testConfigs.size() - 1) {
-            	prevTestConfig = (TestConfig) testConfigs.get(index - 1);
+                prevTestConfig = (TestConfig) testConfigs.get(index - 1);
                 nextTestConfig = (TestConfig) testConfigs.get(0);
             } else {
-            	prevTestConfig = (TestConfig) testConfigs.get(index - 1);
+                prevTestConfig = (TestConfig) testConfigs.get(index - 1);
                 nextTestConfig = (TestConfig) testConfigs.get(index + 1);
             }
             request.setAttribute("prevTest", prevTestConfig);
@@ -205,12 +255,14 @@
         response.setContentType("text/html");
         String displayUri = null;
         if (testConfig != null) {
-        	displayUri = testConfig.getDisplayURI();
+            displayUri = testConfig.getDisplayURI();
         } else {
-        	displayUri = "/jsp/introduction.jsp";
+            displayUri = "/jsp/introduction.jsp";
         }
+        LOG.debug("Display URI: " + displayUri);
         PortletRequestDispatcher dispatcher = getPortletContext()
-        		.getRequestDispatcher(displayUri);
+                .getRequestDispatcher(displayUri);
+        LOG.debug("request dispatcher: " + dispatcher);
         dispatcher.include(request, response);
     }
 
@@ -222,8 +274,9 @@
      */
     protected void doEdit(RenderRequest request, RenderResponse response)
     throws PortletException, IOException {
+        response.setContentType("text/html");
         PortletRequestDispatcher dispatcher = getPortletContext()
-        		.getRequestDispatcher("/jsp/edit.jsp");
+                .getRequestDispatcher("/jsp/edit.jsp");
         dispatcher.include(request, response);
     }
 
@@ -235,9 +288,10 @@
      */
     protected void doHelp(RenderRequest request, RenderResponse response)
     throws PortletException, IOException {
-    	PortletRequestDispatcher dispatcher = getPortletContext()
-    			.getRequestDispatcher("/jsp/help.jsp");
-    	dispatcher.include(request, response);
+        response.setContentType("text/html");
+        PortletRequestDispatcher dispatcher = getPortletContext()
+                .getRequestDispatcher("/jsp/help.jsp");
+        dispatcher.include(request, response);
     }
 
 
@@ -250,14 +304,14 @@
      */
     private String getTestId(PortletRequest request) {
 
-    	String testId = request.getParameter("testId");
+        String testId = request.getParameter("testId");
         String prevTestId = request.getParameter("previousTestId");
         String nextTestId = request.getParameter("nextTestId");
 
         // If none of the parameters are available, return null.
         if ((testId == null || testId.trim().length() == 0)
-        		&& nextTestId == null && prevTestId == null
-        		&& tests.size() > 0) {
+                && nextTestId == null && prevTestId == null
+                && tests.size() > 0) {
             return null;
         }
 
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestResult.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestResult.java
index cdbd7a1..6631db2 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestResult.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestResult.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -24,6 +24,8 @@
  */
 public class TestResult implements Serializable {
 
+	private static final long serialVersionUID = 5247797277017349129L;
+
 	/** The undefined return code. */
 	public static final int UNDEFINED = -1;
 
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestResults.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestResults.java
index 70e775e..9d03c8c 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestResults.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/TestResults.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -19,17 +19,17 @@
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 
 /**
  * This class contains one or more test results.
  */
 public class TestResults implements Serializable {
 
+	private static final long serialVersionUID = 279901260532957514L;
 
-    private String name;
+	private String name;
 
-    private ArrayList list = new ArrayList();
+    private ArrayList<TestResult> list = new ArrayList<TestResult>();
 
     private boolean failed = false;
     private boolean inQuestion = false;
@@ -63,8 +63,8 @@
         return inQuestion;
     }
 
-    public Collection getCollection() {
-        return Collections.unmodifiableCollection(list);
+    public Collection<TestResult> getCollection() {
+        return list;
     }
 
     /**
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/AbstractReflectivePortletTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/AbstractReflectivePortletTest.java
index c84b694..8dda174 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/AbstractReflectivePortletTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/AbstractReflectivePortletTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -16,36 +16,40 @@
  */
 package org.apache.pluto.testsuite.test;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.testsuite.TestConfig;
-import org.apache.pluto.testsuite.PortletTest;
-import org.apache.pluto.testsuite.TestResult;
-import org.apache.pluto.testsuite.TestResults;
-
-import javax.portlet.PortletResponse;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletSession;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.HashMap;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.testsuite.PortletTest;
+import org.apache.pluto.testsuite.TestConfig;
+import org.apache.pluto.testsuite.TestResult;
+import org.apache.pluto.testsuite.TestResults;
+import org.apache.pluto.testsuite.annotations.DefaultTestPhase;
+import org.apache.pluto.testsuite.annotations.TestPhase;
 
 /**
  */
 public abstract class AbstractReflectivePortletTest implements PortletTest {
 
-	/** Logger. */
-	private static final Log LOG = LogFactory.getLog(
-			AbstractReflectivePortletTest.class);
+    /** Logger. */
+    private static final Log LOG = LogFactory.getLog(
+            AbstractReflectivePortletTest.class);
 
-    private Map initParameters;
+    private Map<String, String> initParameters;
     private TestConfig config;
 
 
@@ -64,8 +68,8 @@
      * @param request  the portlet request.
      * @return an empty Map object.
      */
-    public Map getRenderParameters(PortletRequest request) {
-        return new HashMap();
+    public Map<String, String[]> getRenderParameters(PortletRequest request) {
+        return new HashMap<String, String[]>();
     }
 
     public TestConfig getConfig() {
@@ -78,13 +82,13 @@
      * @return the test suite name.
      */
     public String getTestSuiteName() {
-    	String className = getClass().getName();
-    	int index = className.lastIndexOf(".");
-    	if (index >= 0 && index < className.length() - 1) {
-    		return className.substring(index + 1);
-    	} else {
-    		return className;
-    	}
+        String className = getClass().getName();
+        int index = className.lastIndexOf(".");
+        if (index >= 0 && index < className.length() - 1) {
+            return className.substring(index + 1);
+        } else {
+            return className;
+        }
     }
 
     /**
@@ -102,36 +106,32 @@
                               PortletResponse response) {
         TestResults results = new TestResults(getTestSuiteName());
 
-        for (Iterator it = getCheckMethods().iterator(); it.hasNext(); ) {
-        	Method method = (Method) it.next();
-        	debugWithName("Invoking test method: " + method.getName());
-        	try {
-        		TestResult result = invoke(method, config, context, request, response);
-        		if (result.getName() == null) {
-        			result.setName(method.getName());
-        		}
-        		results.add(result);
-        		debugWithName("Result: " + result.getReturnCodeAsString());
-        	} catch (Throwable th) {
-        		String message = "Error invoking " + method.getName()
-        				+ " (" + th.getClass().getName() + "): "
-        				+ th.getMessage();
-        		errorWithName(message, th);
-        		TestResult result = new TestResult();
-        		result.setName(method.getName());
-        		result.setReturnCode(TestResult.FAILED);
-        		result.setResultMessage(message);
-        		results.add(result);
+        for (Method method : getCheckMethods(request)) {
+            try {
+                TestResult result = invoke(method, config, context, request, response);
+                if (result.getName() == null) {
+                    result.setName(method.getName());
+                }
+                results.add(result);
+            } catch (Throwable th) {
+                String message = "Error invoking " + method.getName()
+                        + " (" + th.getClass().getName() + "): "
+                        + th.getMessage();
+                errorWithName(message, th);
+                TestResult result = new TestResult();
+                result.setName(method.getName());
+                result.setReturnCode(TestResult.FAILED);
+                result.setResultMessage(message);
+                results.add(result);
             }
         }
 
         return results;
     }
 
-
     // Protected Methods -------------------------------------------------------
 
-    protected Map getInitParameters() {
+    protected Map<String, String> getInitParameters() {
         return initParameters;
     }
 
@@ -139,15 +139,15 @@
     // Private Methods ---------------------------------------------------------
 
     private void debugWithName(String message) {
-    	if (LOG.isDebugEnabled()) {
-    		LOG.debug("Test [" + getTestSuiteName() + "]: " + message);
-    	}
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Test [" + getTestSuiteName() + "]: " + message);
+        }
     }
 
     private void errorWithName(String message, Throwable cause) {
-    	if (LOG.isErrorEnabled()) {
-    		LOG.error("Test [" + getTestSuiteName() + "]: " + message, cause);
-    	}
+        if (LOG.isErrorEnabled()) {
+            LOG.error("Test [" + getTestSuiteName() + "]: " + message, cause);
+        }
     }
 
     /**
@@ -160,26 +160,39 @@
      * </ul>
      * @return a list of check methods.
      */
-    private List getCheckMethods() {
-    	List checkMethods = new ArrayList();
-    	for (Class clazz = getClass();
-    			clazz != null && AbstractReflectivePortletTest.class.isAssignableFrom(clazz);
-    			clazz = clazz.getSuperclass()) {
-    		// debugWithName("Checking class: " + clazz.getName());
-    		Method[] methods = clazz.getDeclaredMethods();
-    		for (int i = 0; i < methods.length; i++) {
-    			int mod = methods[i].getModifiers();
-    			if ((Modifier.isPublic(mod) || Modifier.isProtected(mod))
-    					&& !Modifier.isAbstract(mod)
-    					&& methods[i].getName().startsWith("check")) {
-    				// debugWithName(" - got check method: " + methods[i].getName());
-    				checkMethods.add(methods[i]);
-    			}
-    		}
-    	}
+    private List<Method> getCheckMethods(PortletRequest request) {
+        List<Method> checkMethods = new ArrayList<Method>();
+        DefaultTestPhase dtp = getClass().getAnnotation(DefaultTestPhase.class);
+        String defaultPhase = dtp != null ? dtp.value() 
+                                          : PortletRequest.RENDER_PHASE;
+        String lifecyclePhase = (String) 
+                request.getAttribute(PortletRequest.LIFECYCLE_PHASE);
+        debugWithName("Default phase: " + defaultPhase);
+        debugWithName("Lifecycle Phase: " + lifecyclePhase);
+        for (Class<?> clazz = getClass();
+                clazz != null && AbstractReflectivePortletTest.class.isAssignableFrom(clazz);
+                clazz = clazz.getSuperclass()) {
+            // debugWithName("Checking class: " + clazz.getName());
+            Method[] methods = clazz.getDeclaredMethods();
+            String phase;
+            TestPhase testPhase;
+            for (int i = 0; i < methods.length; i++) {
+                int mod = methods[i].getModifiers();
+                testPhase = methods[i].getAnnotation(TestPhase.class);
+                phase = testPhase != null ? testPhase.value() : defaultPhase;
+                if ((Modifier.isPublic(mod) || Modifier.isProtected(mod))
+                       && lifecyclePhase.equals(phase)
+                       && !Modifier.isAbstract(mod)
+                       && methods[i].getName().startsWith("check")) {
+                    // debugWithName(" - got check method: " + methods[i].getName());
+                    debugWithName(" - got check method: " + methods[i].getName());
+                    checkMethods.add(methods[i]);
+                }
+            }
+        }
         return checkMethods;
     }
-
+    
     /**
      * Invokes the test method ('<code>check*</code>') by preparing method
      * parameters. A test method may accept the following types of parameters:
@@ -198,7 +211,7 @@
                               PortletResponse response)
     throws IllegalAccessException, InvocationTargetException {
 
-        Class[] paramTypes = method.getParameterTypes();
+        Class<?>[] paramTypes = method.getParameterTypes();
         Object[] paramValues = new Object[paramTypes.length];
 
         for (int i = 0; i < paramTypes.length; i++) {
@@ -206,9 +219,9 @@
                 paramValues[i] = config;
             } else if (paramTypes[i].equals(PortletContext.class)) {
                 paramValues[i] = context;
-            } else if (paramTypes[i].equals(PortletRequest.class)) {
+            } else if (paramTypes[i].isAssignableFrom(request.getClass())) {
                 paramValues[i] = request;
-            } else if (paramTypes[i].equals(PortletResponse.class)) {
+            } else if (paramTypes[i].isAssignableFrom(response.getClass())) {
                 paramValues[i] = response;
             } else if (paramTypes[i].equals(PortletSession.class)) {
                 paramValues[i] = request.getPortletSession();
@@ -226,10 +239,14 @@
      * @see java.lang.Object#toString()
      */
     public String toString(){
-    	StringBuffer buffer = new StringBuffer();
-    	buffer.append(getClass().getName());
-    	buffer.append("[initParameters=").append(initParameters);
-    	buffer.append(";config=").append(config).append("]");
-    	return buffer.toString();
+        StringBuffer buffer = new StringBuffer();
+        buffer.append(getClass().getName());
+        buffer.append("[initParameters=").append(initParameters);
+        buffer.append(";config=").append(config).append("]");
+        return buffer.toString();
+    }
+
+    public void doHeaders(PortletConfig config, PortletContext context,
+            RenderRequest request, RenderResponse response) {
     }
 }
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ActionParameterTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ActionParameterTest.java
index 8ce0794..619bba1 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ActionParameterTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ActionParameterTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -16,19 +16,20 @@
  */
 package org.apache.pluto.testsuite.test;
 
-import org.apache.pluto.testsuite.ActionTest;
-import org.apache.pluto.testsuite.TestResult;
-import org.apache.pluto.testsuite.TestUtils;
-
 import java.util.Enumeration;
 import java.util.Map;
 
+import javax.portlet.ActionRequest;
 import javax.portlet.PortletRequest;
 
+import org.apache.pluto.testsuite.TestResult;
+import org.apache.pluto.testsuite.TestUtils;
+import org.apache.pluto.testsuite.annotations.DefaultTestPhase;
+
 /**
  */
-public class ActionParameterTest extends AbstractReflectivePortletTest
-implements ActionTest {
+@DefaultTestPhase(PortletRequest.ACTION_PHASE)
+public class ActionParameterTest extends AbstractReflectivePortletTest {
 
 	/** Parameter key encoded in the action URL. */
     public static final String KEY = "org.apache.pluto.testsuite.PARAM_ACTION_KEY";
@@ -39,7 +40,7 @@
 
     // Test Methods ------------------------------------------------------------
 
-    protected TestResult checkGetActionParameter(PortletRequest request) {
+    protected TestResult checkGetActionParameter(ActionRequest request) {
         TestResult result = new TestResult();
         result.setDescription("Ensure parameters encoded in action URL are "
         		+ "available in the action request.");
@@ -53,13 +54,13 @@
         return result;
     }
 
-    protected TestResult checkGetActionParamerMap(PortletRequest request) {
+    protected TestResult checkGetActionParamerMap(ActionRequest request) {
         TestResult result = new TestResult();
         result.setDescription("Ensure parameters encoded in action URL are "
         		+ "available in the action request parameter map.");
 
-        Map parameterMap = request.getParameterMap();
-        String[] values = (String[]) parameterMap.get(KEY);
+        Map<String, String[]> parameterMap = request.getParameterMap();
+        String[] values = parameterMap.get(KEY);
         if (values != null && values.length == 1 && VALUE.equals(values[0])) {
         	result.setReturnCode(TestResult.PASSED);
         } else {
@@ -69,15 +70,15 @@
         return result;
     }
 
-    protected TestResult checkParameterNames(PortletRequest request) {
+    protected TestResult checkParameterNames(ActionRequest request) {
         TestResult result = new TestResult();
         result.setDescription("Ensure parameters encoded in action URL "
         		+ "exists in the parameter name enumeration.");
 
         boolean hasParameterName = false;
-        for (Enumeration en = request.getParameterNames();
+        for (Enumeration<String> en = request.getParameterNames();
         		!hasParameterName && en.hasMoreElements(); ) {
-        	String name = (String) en.nextElement();
+        	String name = en.nextElement();
         	if (KEY.equals(name)) {
         		hasParameterName = true;
         	}
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/AppScopedSessionAttributeTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/AppScopedSessionAttributeTest.java
index 3a30bf0..1803294 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/AppScopedSessionAttributeTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/AppScopedSessionAttributeTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -17,15 +17,15 @@
 
 package org.apache.pluto.testsuite.test;
 
+import javax.portlet.PortletSession;
+
 import org.apache.pluto.testsuite.TestResult;
 import org.apache.pluto.testsuite.TestUtils;
 
-import javax.portlet.PortletSession;
-
 /**
  */
 public class AppScopedSessionAttributeTest
-extends AbstractReflectivePortletTest {
+extends AbstractReflectivePortletTest  {
 
     private static final String BOGUS_KEY = "org.apache.pluto.testsuite.BOGUS_KEY";
     private static final String KEY = "org.apache.pluto.testsuite.KEY";
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ContextInitParameterTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ContextInitParameterTest.java
index 16c2bb6..a5333bc 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ContextInitParameterTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ContextInitParameterTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -16,18 +16,19 @@
  */
 package org.apache.pluto.testsuite.test;
 
-import org.apache.pluto.testsuite.TestResult;
-import org.apache.pluto.testsuite.TestUtils;
+import java.util.Enumeration;
 
 import javax.portlet.PortletContext;
 import javax.portlet.PortletSession;
-import java.util.Enumeration;
+
+import org.apache.pluto.testsuite.TestResult;
+import org.apache.pluto.testsuite.TestUtils;
 
 /**
  * @version 1.0
  * @since Sep 15, 2004
  */
-public class ContextInitParameterTest extends AbstractReflectivePortletTest  {
+public class ContextInitParameterTest extends AbstractReflectivePortletTest {
 
     private static final String TEST_PARAM_NAME = "test-parameter-name";
     private static final String TEST_PARAM_VALUE = "test-parameter-val";
@@ -43,9 +44,9 @@
         result.setSpecPLT("10.3.1");
 
         boolean found = false;
-        for (Enumeration en = context.getInitParameterNames();
+        for (Enumeration<String> en = context.getInitParameterNames();
         		!found && en.hasMoreElements(); ) {
-            String name = (String) en.nextElement();
+            String name = en.nextElement();
             if (TEST_PARAM_NAME.equals(name)) {
                 found = true;
             }
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/DispatcherRenderParameterTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/DispatcherRenderParameterTest.java
index 0f460e4..527012a 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/DispatcherRenderParameterTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/DispatcherRenderParameterTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -16,11 +16,6 @@
  */
 package org.apache.pluto.testsuite.test;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.testsuite.TestResult;
-import org.apache.pluto.testsuite.TestUtils;
-
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.Map;
@@ -37,6 +32,11 @@
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.testsuite.TestResult;
+import org.apache.pluto.testsuite.TestUtils;
+
 /**
  *
  * @version 1.0
@@ -87,8 +87,8 @@
      * Overwrites <code>super.getRenderParameters(..)</code> to set the
      * test-specific render parameter in the render URL.
      */
-    public Map getRenderParameters(PortletRequest request) {
-    	Map parameterMap = super.getRenderParameters(request);
+    public Map<String, String[]> getRenderParameters(PortletRequest request) {
+    	Map<String, String[]> parameterMap = super.getRenderParameters(request);
     	parameterMap.put(KEY_RENDER, new String[] { VALUE_RENDER });
     	return parameterMap;
     }
@@ -208,7 +208,9 @@
 
         // GenericServlet Impl -------------------------------------------------
 
-        public String getServletInfo() {
+		private static final long serialVersionUID = -963706386141654216L;
+
+		public String getServletInfo() {
         	return getClass().getName();
         }
 
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/DispatcherRequestTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/DispatcherRequestTest.java
index b610b54..343db52 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/DispatcherRequestTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/DispatcherRequestTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -174,7 +174,9 @@
     
     public static class CompanionServlet extends HttpServlet {
     	
-        private static final String KEY_REQUEST_URI = "javax.servlet.include.request_uri";
+		private static final long serialVersionUID = -6032809452145653960L;
+		
+		private static final String KEY_REQUEST_URI = "javax.servlet.include.request_uri";
         private static final String KEY_CONTEXT_PATH = "javax.servlet.include.context_path";
         private static final String KEY_SERVLET_PATH = "javax.servlet.include.servlet_path";
         private static final String KEY_PATH_INFO = "javax.servlet.include.path_info";
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ExternalAppScopedAttributeTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ExternalAppScopedAttributeTest.java
index 2a0a6d4..42c8c64 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ExternalAppScopedAttributeTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ExternalAppScopedAttributeTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -19,8 +19,6 @@
 
 import java.io.IOException;
 
-import org.apache.pluto.testsuite.TestResult;
-
 import javax.portlet.PortletSession;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletException;
@@ -29,9 +27,12 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.apache.pluto.testsuite.TestResult;
+
 /**
  */
-public class ExternalAppScopedAttributeTest extends AbstractReflectivePortletTest {
+public class ExternalAppScopedAttributeTest 
+extends AbstractReflectivePortletTest {
 
     public static final String INT_KEY = "org.apache.pluto.testsuite.INTERNALLY_SET_APP_SCOPED_SESSION_TEST_KEY";
     public static final String EXT_KEY = "org.apache.pluto.testsuite.EXTERNALLY_SET_APP_SCOPED_SESSION_TEST_KEY";
@@ -78,7 +79,9 @@
      */
     public static class CompanionServlet extends HttpServlet {
 
-        public void doGet(HttpServletRequest request,
+		private static final long serialVersionUID = 8921101365853307609L;
+
+		public void doGet(HttpServletRequest request,
                           HttpServletResponse response)
         throws ServletException, IOException {
             HttpSession session = request.getSession();
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/MiscTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/MiscTest.java
index b3582eb..6d68d50 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/MiscTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/MiscTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -105,14 +105,15 @@
         TestResult result = new TestResult();
         result.setDescription("Ensure the expected portlet modes are returned.");
 
-        List requiredPortletModes = new ArrayList();
+        List<PortletMode> requiredPortletModes = new ArrayList<PortletMode>();
         requiredPortletModes.add(PortletMode.VIEW);
         requiredPortletModes.add(PortletMode.EDIT);
         requiredPortletModes.add(PortletMode.HELP);
 
-        for (Enumeration en = request.getPortalContext().getSupportedPortletModes();
+        for (Enumeration<PortletMode> en = 
+        		request.getPortalContext().getSupportedPortletModes();
         		en.hasMoreElements(); ) {
-            PortletMode portletMode = (PortletMode) en.nextElement();
+            PortletMode portletMode = en.nextElement();
             requiredPortletModes.remove(portletMode);
         }
 
@@ -121,7 +122,7 @@
         } else {
         	result.setReturnCode(TestResult.FAILED);
         	StringBuffer buffer = new StringBuffer();
-        	for (Iterator it = requiredPortletModes.iterator();
+        	for (Iterator<PortletMode> it = requiredPortletModes.iterator();
         			it.hasNext(); ) {
         		buffer.append(it.next()).append(", ");
         	}
@@ -135,12 +136,13 @@
         TestResult result = new TestResult();
         result.setDescription("Ensure the expected window states are returned.");
 
-        List requiredWindowStates = new ArrayList();
+        List<WindowState> requiredWindowStates = new ArrayList<WindowState>();
         requiredWindowStates.add(WindowState.MINIMIZED);
         requiredWindowStates.add(WindowState.MAXIMIZED);
         requiredWindowStates.add(WindowState.NORMAL);
 
-        for (Enumeration en = request.getPortalContext().getSupportedWindowStates();
+        for (Enumeration<WindowState> en = 
+        		request.getPortalContext().getSupportedWindowStates();
         		en.hasMoreElements(); ) {
             WindowState windowState = (WindowState) en.nextElement();
             requiredWindowStates.remove(windowState);
@@ -151,7 +153,7 @@
         } else {
         	result.setReturnCode(TestResult.FAILED);
             StringBuffer buffer = new StringBuffer();
-            for (Iterator it = requiredWindowStates.iterator();
+            for (Iterator<WindowState> it = requiredWindowStates.iterator();
             		it.hasNext(); ) {
             	buffer.append(it.next()).append(", ");
             }
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/PreferenceCommonTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/PreferenceCommonTest.java
index 4dcc7cf..d90d29c 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/PreferenceCommonTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/PreferenceCommonTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -16,19 +16,18 @@
  */
 package org.apache.pluto.testsuite.test;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.testsuite.TestResult;
-import org.apache.pluto.testsuite.TestUtils;
-
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.Map;
 
 import javax.portlet.PortletPreferences;
 import javax.portlet.PortletRequest;
 import javax.portlet.ReadOnlyException;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.testsuite.TestResult;
+import org.apache.pluto.testsuite.TestUtils;
+
 /**
  * Common portlet preferences test.
  */
@@ -376,9 +375,10 @@
         result.setSpecPLT("14.1");
 
         PortletPreferences preferences = request.getPreferences();
-        Map prefMap = preferences.getMap();
+        Map<String, String[]> prefMap = preferences.getMap();
         boolean hasAll = true;
-        for (Enumeration en = preferences.getNames(); en.hasMoreElements(); ) {
+        for (Enumeration<String> en = preferences.getNames(); 
+        		en.hasMoreElements(); ) {
             if (!prefMap.containsKey(en.nextElement())) {
                 hasAll = false;
                 break;
@@ -422,7 +422,7 @@
         }
 
         // Modify the returned preference map.
-    	Map prefMap = preferences.getMap();
+    	Map<String, String[]> prefMap = preferences.getMap();
     	String[] values = (String[]) prefMap.get(PREF_NAME);
     	String originalValue = null;
     	String modifiedValue = "Value modified in preferences map.";
@@ -457,9 +457,8 @@
      */
     protected void logPreferences(PortletPreferences preferences) {
     	StringBuffer buffer = new StringBuffer();
-    	Map map = preferences.getMap();
-    	for (Iterator it = map.keySet().iterator(); it.hasNext(); ) {
-    		String key = (String) it.next();
+    	Map<String, String[]> map = preferences.getMap();
+    	for (String key : map.keySet()) {
     		String[] values = (String[]) map.get(key);
     		buffer.append(key).append("=");
     		if (values != null) {
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/PreferenceInActionTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/PreferenceInActionTest.java
index ca94729..e15ac04 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/PreferenceInActionTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/PreferenceInActionTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -16,24 +16,25 @@
  */
 package org.apache.pluto.testsuite.test;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.pluto.testsuite.ActionTest;
-import org.apache.pluto.testsuite.TestResult;
-import org.apache.pluto.testsuite.TestUtils;
-import org.apache.pluto.testsuite.validator.PreferencesValidatorImpl;
-
 import java.io.IOException;
 
+import javax.portlet.ActionRequest;
 import javax.portlet.PortletPreferences;
 import javax.portlet.PortletRequest;
 import javax.portlet.ReadOnlyException;
 import javax.portlet.ValidatorException;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pluto.testsuite.TestResult;
+import org.apache.pluto.testsuite.TestUtils;
+import org.apache.pluto.testsuite.annotations.DefaultTestPhase;
+import org.apache.pluto.testsuite.validator.PreferencesValidatorImpl;
+
 /**
  */
-public class PreferenceInActionTest extends PreferenceCommonTest
-implements ActionTest {
+@DefaultTestPhase(PortletRequest.ACTION_PHASE)
+public class PreferenceInActionTest extends PreferenceCommonTest {
 
 	/** Logger. */
     private static final Log LOG = LogFactory.getLog(PreferenceInActionTest.class);
@@ -41,7 +42,7 @@
 
     // Test Methods ------------------------------------------------------------
 
-    protected TestResult checkPreferenceValidator(PortletRequest request) {
+    protected TestResult checkPreferenceValidator(ActionRequest request) {
         TestResult result = new TestResult();
         result.setDescription("Ensure the validator catches invalid preferences.");
         result.setSpecPLT("14.4");
@@ -92,7 +93,7 @@
     }
 
     protected TestResult checkOnePreferenceValidatorPerPortletDefinition(
-    		PortletRequest request) {
+    		ActionRequest request) {
         TestResult result = new TestResult();
         result.setDescription("Ensure only one validator instance is created "
         		+ "per portlet definition.");
@@ -125,7 +126,7 @@
         return result;
     }
 
-    protected TestResult checkStorePreferences(PortletRequest request) {
+    protected TestResult checkStorePreferences(ActionRequest request) {
         TestResult result = new TestResult();
         result.setDescription("Ensure storage works for portlet preferences.");
         result.setSpecPLT("14.1");
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/RenderParameterTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/RenderParameterTest.java
index b9fa822..16f37f1 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/RenderParameterTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/RenderParameterTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -16,15 +16,15 @@
  */
 package org.apache.pluto.testsuite.test;
 
-import org.apache.pluto.testsuite.TestResult;
-import org.apache.pluto.testsuite.TestUtils;
-
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Map;
 
 import javax.portlet.PortletRequest;
 
+import org.apache.pluto.testsuite.TestResult;
+import org.apache.pluto.testsuite.TestUtils;
+
 /**
  */
 public class RenderParameterTest extends AbstractReflectivePortletTest {
@@ -35,8 +35,8 @@
     private static final String RENDER_VALUE = "org.apache.pluto.testsuite.RENDER_VALUE";
 
 
-    public Map getRenderParameters(PortletRequest request) {
-        Map parameterMap = new HashMap();
+    public Map<String, String[]> getRenderParameters(PortletRequest request) {
+        Map<String, String[]> parameterMap = new HashMap<String, String[]>();
         parameterMap.put(RENDER_KEY, new String[] { RENDER_VALUE });
         return parameterMap;
     }
@@ -94,7 +94,7 @@
         result.setDescription("Ensure that render request returns the correct "
         		+ "parameter map.");
 
-        Map parameterMap = request.getParameterMap();
+        Map<String, String[]> parameterMap = request.getParameterMap();
         String[] values = (String[]) parameterMap.get(RENDER_KEY);
         if (values != null && values.length == 1
         		&& RENDER_VALUE.equals(values[0])
@@ -121,9 +121,9 @@
 
         boolean hasActionParameter = false;
         boolean hasRenderParameter = false;
-        for (Enumeration en = request.getParameterNames();
+        for (Enumeration<String> en = request.getParameterNames();
         		en.hasMoreElements(); ) {
-            String name = (String) en.nextElement();
+            String name = en.nextElement();
             if (ACTION_KEY.equals(name)) {
             	hasActionParameter = true;
             }
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ResourceBundleTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ResourceBundleTest.java
index 092b212..457dbf3 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ResourceBundleTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/ResourceBundleTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -34,7 +34,7 @@
  * the portlet request, session, and context objects.
  *
  */
-public class ResourceBundleTest extends AbstractReflectivePortletTest {
+public class ResourceBundleTest extends AbstractReflectivePortletTest  {
 
 	// Static Constant Definitions ---------------------------------------------
 
@@ -96,7 +96,7 @@
         result.setDescription("Retrieve the property names and ensure that "
         		+ "the required keys are present.");
 
-        List requiredKeys = new ArrayList();
+        List<String> requiredKeys = new ArrayList<String>();
         requiredKeys.add(TITLE_KEY);
         requiredKeys.add(SHORT_TITLE_KEY);
         requiredKeys.add(KEYWORDS_KEY);
@@ -110,7 +110,8 @@
         	return result;
         }
 
-        for (Enumeration en = bundle.getKeys(); en.hasMoreElements(); ) {
+        for (Enumeration<String> en = bundle.getKeys(); 
+        			en.hasMoreElements(); ) {
             String key = (String) en.nextElement();
             requiredKeys.remove(key);
         }
@@ -120,7 +121,7 @@
         } else {
         	result.setReturnCode(TestResult.FAILED);
             StringBuffer buffer = new StringBuffer();
-            for (Iterator it = requiredKeys.iterator(); it.hasNext(); ) {
+            for (Iterator<String> it = requiredKeys.iterator(); it.hasNext(); ) {
             	buffer.append(it.next()).append(", ");
             }
             result.setResultMessage("Required keys [" + buffer.toString()
@@ -175,7 +176,7 @@
 
         // Retrieve expected title, short title and keywords from test config.
         String suffix = isBundleDeclared() ? ("_" + locale.getLanguage()) : "";
-        Map initParams = getInitParameters();
+        Map<String, String> initParams = getInitParameters();
         String expectedTitle = (String) initParams.get(
         		TITLE_PARAM + suffix);
         String expectedShortTitle = (String) initParams.get(
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleAttributeTest.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleAttributeTest.java
index 82f0f9f..95670d4 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleAttributeTest.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleAttributeTest.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -16,15 +16,15 @@
  */
 package org.apache.pluto.testsuite.test;
 
-import org.apache.pluto.testsuite.TestResult;
-import org.apache.pluto.testsuite.TestUtils;
-
 import java.util.Enumeration;
 
 import javax.portlet.PortletContext;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletSession;
 
+import org.apache.pluto.testsuite.TestResult;
+import org.apache.pluto.testsuite.TestUtils;
+
 /**
  * Tests basic attribute retrieval and storage functions within the portlet
  * request, session, and context objects.
@@ -97,7 +97,7 @@
         }
 
         int found = 0;
-        for (Enumeration en = req.getAttributeNames();
+        for (Enumeration<String> en = req.getAttributeNames();
         		en.hasMoreElements(); ) {
             if (en.nextElement().toString().startsWith(KEY)) {
                 found++;
@@ -181,7 +181,7 @@
         }
 
         int found = 0;
-        for (Enumeration en = session.getAttributeNames();
+        for (Enumeration<String> en = session.getAttributeNames();
         		en.hasMoreElements(); ) {
         	String name = (String) en.nextElement();
             if (name.startsWith(KEY)) {
@@ -269,7 +269,7 @@
         }
 
         int found = 0;
-        for (Enumeration en = context.getAttributeNames();
+        for (Enumeration<?> en = context.getAttributeNames();
         		en.hasMoreElements(); ) {
             if (en.nextElement().toString().startsWith(KEY)) {
                 found++;
diff --git a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/validator/PreferencesValidatorImpl.java b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/validator/PreferencesValidatorImpl.java
index 01ad63e..2b134cd 100644
--- a/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/validator/PreferencesValidatorImpl.java
+++ b/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/validator/PreferencesValidatorImpl.java
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
@@ -40,7 +40,8 @@
     public static final String CHECK_VALIDATOR_COUNT = "checkValidatorCount";
 
     /** Count of instances created. */
-    private static final Map INSTANCE_COUNTER = new HashMap();
+    private static final Map<String, Integer> INSTANCE_COUNTER = 
+    	new HashMap<String, Integer>();
 
     /** Count of invocation number of method <code>validate()</code>. */
     private int validateInvoked = 0;
@@ -80,8 +81,9 @@
         //   anymore.  When enabled, all preferences fail in testsuite.
         //
         final String[] DEFAULT_VALUES = new String[] { "no values" };
-    	Collection failedNames = new ArrayList();
-        for (Enumeration en = preferences.getNames(); en.hasMoreElements(); ) {
+    	Collection<String> failedNames = new ArrayList<String>();
+        for (Enumeration<String> en = preferences.getNames(); 
+        		en.hasMoreElements(); ) {
             String name = (String) en.nextElement();
             String[] values = preferences.getValues(name, DEFAULT_VALUES);
             if (values != null) { // null values are allowed
