portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddew...@apache.org
Subject svn commit: r227271 [2/2] - in /portals/pluto/branches/pluto-1.1: ./ pluto-portal/src/main/resources/org/ pluto-testsuite/src/main/java/org/apache/pluto/portalImpl/ pluto-testsuite/src/main/java/org/apache/pluto/testsuite/ pluto-testsuite/src/main/java...
Date Wed, 03 Aug 2005 21:43:55 GMT
Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleParameterTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleParameterTest.java?rev=227271&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleParameterTest.java
(added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleParameterTest.java
Wed Aug  3 14:43:40 2005
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.testsuite.test;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.portlet.PortletRequest;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public class SimpleParameterTest extends AbstractReflectivePortletTest {
+    public static final String KEY = "org.apache.pluto.testsuite.PARAM_TEST_KEY";
+    public static final String VALUE = "org.apache.pluto.testsuite.PARAM_TEST_VALUE";
+
+    private static final String IKEY = "org.apache.pluto.testsuite.PARAM_TEST_KEY_I";
+
+    public String getTestSuiteName() {
+        return "Simple Parameter Test";
+    }
+
+    public Map getRenderParameters(PortletRequest req) {
+        Map map = new HashMap(req.getParameterMap());
+        map.put(IKEY, new String[] {VALUE});
+        return map;
+    }
+
+    protected TestResult checkSentParameters(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Sent Parameter Test");
+        res.setDesc("Ensure that parameters sent through the action query stream have made
it all the way through");
+
+        String val = req.getParameter(KEY);
+        if(val == null || !VALUE.equals(val)) {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Expected : "+VALUE+" retrieved "+val);
+        }
+        else {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        return res;
+    }
+
+
+    protected TestResult checkInternalRenderParameters(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Render Parameters Test");
+        res.setDesc("Enumerate through all render parameters sent in the action");
+
+        String val = req.getParameter(IKEY);
+        if(val == null || !VALUE.equals(val)) {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Expected : "+VALUE+" retrieved "+val);
+        }
+        else {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        return res;
+    }
+
+    protected TestResult checkParameterNames(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Test Parameter Names Enumeration.");
+        res.setDesc("Enumerate through all expected names.");
+
+        boolean hasExternal = false;
+        boolean hasInternal = false;
+        Enumeration enumerator= req.getParameterNames();
+        while(enumerator.hasMoreElements()) {
+            String val = enumerator.nextElement().toString();
+            if(KEY.equals(val)) {
+                hasExternal = true;
+            }
+            if(IKEY.equals(val)) {
+                hasInternal = true;
+            }
+        }
+        if(!hasInternal || !hasExternal) {
+            res.setReturnCode(TestResult.FAILED);
+            StringBuffer sb = new StringBuffer();
+            if(!hasInternal) {
+                sb.append("Internal Parameter Not Found. ");
+            }
+            if(!hasExternal) {
+                sb.append("External Parameter Not Found. ");
+            }
+            res.setResults(sb.toString());
+        }
+        else {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        return res;
+    }
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimplePreferenceTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimplePreferenceTest.java?rev=227271&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimplePreferenceTest.java
(added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimplePreferenceTest.java
Wed Aug  3 14:43:40 2005
@@ -0,0 +1,408 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.testsuite.test;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Map;
+
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.ValidatorException;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public class SimplePreferenceTest
+ extends ActionAbstractReflectivePortletTest
+ implements ActionTest {
+
+    private static final String BOGUS_KEY = "org.apache.pluto.testsuite.BOGUS_KEY";
+
+    public String getTestSuiteName() {
+        return "Simple Preferences Test";
+    }
+
+    protected TestResult checkGetEmptyPreference(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Get Empty Preference Test");
+        res.setDesc("Ensure proper default is returned when a non-existing preference is
requested.");
+        PortletPreferences preferences = req.getPreferences();
+        String preference =  preferences.getValue("nonexistence!", "Default");
+        if(preference.equals("Default")) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Preferences value was '"+preference+"' expected 'permanent'.");
+        }
+        return res;
+    }
+
+    protected TestResult checkGetEmptyPreferences(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Get Empty Preferences Test");
+        res.setDesc("Ensure proper defaults are returned when a non-existent preference set
is requested.");
+        PortletPreferences preferences = req.getPreferences();
+        String[] preference = preferences.getValues("nonexistence!", new String[] {"Default"});
+        if(preference.length == 1 && preference[0].equals("Default")) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Preferences value was '"+preference[0]+"' expected 'permanent'.");
+        }
+        return res;
+    }
+
+
+    protected TestResult checkGetPreferences(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Get Preference Test");
+        res.setDesc("Tests that preferences defined in the deployment descriptor may be retrieved.");
+        PortletPreferences preferences = req.getPreferences();
+        String preference =  preferences.getValue("dummyName", "defaultValue");
+        if(preference.equals("dummyValue")) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Preferences value was '"+preference+"' expected 'dummyValue'.");
+        }
+        return res;
+    }
+
+    protected TestResult checkSetPreference(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Set Preference  Test");
+        res.setDesc("Ensure a single preference can be set");
+
+        PortletPreferences preferences = req.getPreferences();
+        try {
+            preferences.setValue("TEST", "TEST_VALUE");
+        }
+        catch(ReadOnlyException roe) {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults(roe.getMessage());
+            return res;
+        }
+
+        String preference = preferences.getValue("TEST", "Error!");
+        if(preference.equals("TEST_VALUE")) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Preferences value was '"+preference+"' expected 'permanent'.");
+        }
+        return res;
+    }
+
+    protected TestResult checkSetPreferences(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Set Preferences Test");
+        res.setDesc("Ensure preferences can be set.");
+
+        PortletPreferences preferences = req.getPreferences();
+        try {
+            preferences.setValues("TEST", new String[] {"TEST_VALUE", "ANOTHER"});
+        }
+        catch(ReadOnlyException roe) {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults(roe.getMessage());
+            return res;
+        }
+
+        String[] preference = preferences.getValues("TEST", new String[] { "Error!" });
+        if(preference.length == 2 && preference[0].equals("TEST_VALUE") &&
+           preference[1].equals("ANOTHER")) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Preferences value was '"+preference+"' expected 'permanent'.");
+        }
+        return res;
+    }
+
+    protected TestResult checkSetPreferencesReturnsFirst(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Set Preferences Test");
+        res.setDesc("Ensure preferences can be set.");
+
+        PortletPreferences preferences = req.getPreferences();
+        try {
+            preferences.setValues("TEST", new String[] {"TEST_VALUE", "ANOTHER"});
+        }
+        catch(ReadOnlyException roe) {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults(roe.getMessage());
+            return res;
+        }
+
+        String preference = preferences.getValue("TEST", "Error!");
+        if(preference.equals("TEST_VALUE")) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Preferences value was '"+preference+"' expected 'permanent'.");
+        }
+        return res;
+    }
+
+    protected TestResult checkPreferenceValidator(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Preference Validator Test");
+        res.setDesc("Check to make sure that the validator catches invalid preferences.");
+
+        PortletPreferences preferences = req.getPreferences();
+        boolean exceptionThrown = false;
+        try {
+            preferences.setValue("VALIDATION_TEST_KEY", " Spaces removed by trim ");
+            preferences.store();
+        }
+        catch (ReadOnlyException roe) {
+
+        }
+        catch (ValidatorException e) {
+            exceptionThrown = true;
+            try { preferences.reset("VALIDATION_TEST_KEY"); }catch(Throwable t) {}
+        }
+        catch (IOException io) {
+
+        }
+
+        if(exceptionThrown) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Illegal value not caught by validator.");
+        }
+        return res;
+    }
+
+    protected TestResult checkStorePreferences(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Preference Store Test");
+        res.setDesc("Ensure storage works.");
+
+        PortletPreferences preferences = req.getPreferences();
+        boolean setOccured = false;
+        boolean storeOccured = false;
+        try {
+            preferences.setValue("dummyName", "notTheOriginal");
+            String pref = preferences.getValue("dummyName", "Default");
+            if("notTheOriginal".equals(pref)) {
+                setOccured = true;
+            }
+
+            preferences.store();
+            if("notTheOriginal".equals(preferences.getValue("dummyName", "Default"))) {
+                storeOccured = true;
+            }
+
+            preferences.reset("dummyName");
+        }
+        catch(ReadOnlyException roe) {
+
+        }
+        catch(ValidatorException ve) {
+
+        }
+        catch(IOException io) {
+
+        }
+
+        if(setOccured && storeOccured) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else if (!setOccured) {
+            res.setReturnCode(TestResult.WARNING);
+            res.setResults("A function upon which the reset test depends failed to execute
as expected. Check the other test results in this test suite.");
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Preferences not successfully stored.");
+        }
+        return res;
+    }
+
+    protected TestResult checkResetPreferences(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Reset Preference Test");
+        res.setDesc("Tests that preferences are properly reset.");
+        PortletPreferences preferences = req.getPreferences();
+        boolean setOccured = false;
+        boolean storeOccured = false;
+        boolean resetOccured = false;
+        try {
+            preferences.setValue("dummyName", "notTheOriginal");
+            String pref = preferences.getValue("dummyName", "Default");
+            if("notTheOriginal".equals(pref)) {
+                setOccured = true;
+            }
+
+            preferences.store();
+            if("notTheOriginal".equals(preferences.getValue("dummyName", "Default"))) {
+                storeOccured = true;
+            }
+
+            preferences.reset("dummyName");
+
+            String preference =  preferences.getValue("dummyName", "defaultValue");
+            if(preference.equals("dummyValue")) {
+                resetOccured = true;
+            }
+        }
+        catch(ReadOnlyException roe) {
+            roe.printStackTrace();
+        }
+        catch(ValidatorException ve) {
+            ve.printStackTrace();
+        }
+        catch(IOException io) {
+            io.printStackTrace();
+        }
+
+        if(setOccured && storeOccured && resetOccured) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else if(!setOccured || !storeOccured) {
+            res.setReturnCode(TestResult.WARNING);
+            res.setResults("A function upon which the reset test depends failed to execute
as expected. Check the other test results in this test suite.");
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Preferences value was not successfully reset after store");
+        }
+
+        return res;
+    }
+
+    protected TestResult checkResetToNullPreferences(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Reset to Null Preference Test");
+        res.setDesc("Tests that preferences are properly reset when originally null.");
+        PortletPreferences preferences = req.getPreferences();
+        boolean setOccured = false;
+        boolean storeOccured = false;
+        boolean resetOccured = false;
+        try {
+            preferences.setValue(BOGUS_KEY, "notTheOriginal");
+            String pref = preferences.getValue(BOGUS_KEY, "Default");
+            if("notTheOriginal".equals(pref)) {
+                setOccured = true;
+            }
+
+            preferences.store();
+            if("notTheOriginal".equals(preferences.getValue(BOGUS_KEY, "Default"))) {
+                storeOccured = true;
+            }
+
+            preferences.reset(BOGUS_KEY);
+
+            String preference =  preferences.getValue(BOGUS_KEY, "defaultValue");
+            if("defaultValue".equals(preference)) {
+                resetOccured = true;
+            }
+        }
+        catch(ReadOnlyException roe) {
+            roe.printStackTrace();
+        }
+        catch(ValidatorException ve) {
+            ve.printStackTrace();
+        }
+        catch(IOException io) {
+            io.printStackTrace();
+        }
+
+        if(setOccured && storeOccured && resetOccured) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else if(!setOccured || !storeOccured) {
+            res.setReturnCode(TestResult.WARNING);
+            res.setResults("A function upon which the reset test depends failed to execute
as expected. Check the other test results in this test suite.");
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Preferences value was not successfully reset after store.");
+        }
+        return res;
+    }
+
+    protected TestResult checkReadOnlyPreferences(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Preference Read Only Test");
+        res.setDesc("Check to make sure that read only preferences may not be set.");
+
+        PortletPreferences preferences = req.getPreferences();
+        boolean exceptionThrown = false;
+        try {
+            preferences.setValue("readonly", "written");
+        }
+        catch (ReadOnlyException roe) {
+            exceptionThrown = true;
+        }
+
+        if(exceptionThrown) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Read Only Preference was written.");
+        }
+
+        return res;
+    }
+
+    protected TestResult checkGetPreferenceMap(PortletRequest req) {
+        TestResult res = checkGetPreferenceNames(req);
+        res.setName("Preference Map Test.");
+        res.setDesc("Ensure returned map is valid");
+        return res;
+    }
+
+    protected TestResult checkGetPreferenceNames(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Preference Names Enumeration Test.");
+        res.setDesc("Ensure returned enumeration is valid");
+
+        PortletPreferences prefs = req.getPreferences();
+        Map map = prefs.getMap();
+        Enumeration enumerator= prefs.getNames();
+        boolean hasAll = true;
+        while(enumerator.hasMoreElements()) {
+            if(!map.containsKey(enumerator.nextElement())) {
+                hasAll = false;
+                break;
+            }
+        }
+
+        if(hasAll) {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        else {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("All names not found as preferences.");
+        }
+        return res;
+    }
+
+
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleRenderParameterTest.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleRenderParameterTest.java?rev=227271&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleRenderParameterTest.java
(added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/SimpleRenderParameterTest.java
Wed Aug  3 14:43:40 2005
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.testsuite.test;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.portlet.PortletRequest;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public class SimpleRenderParameterTest extends AbstractReflectivePortletTest {
+
+    public static final String KEY = "org.apache.pluto.testsuite.PARAM_TEST_KEY";
+    public static final String VALUE = "org.apache.pluto.testsuite.PARAM_TEST_VALUE";
+
+    private static final String IKEY = "org.apache.pluto.testsuite.PARAM_TEST_KEY_I";
+
+    public String getTestSuiteName() {
+        return "Simple Parameter Test";
+    }
+
+    // Unlike other tests, we DON'T want to include anything but the test id.
+    public Map getRenderParameters(PortletRequest req) {
+        Map map = new HashMap();
+        map.put(IKEY, new String[] {VALUE});
+        return map;
+    }
+
+    protected TestResult checkActionParametersNotHere(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("No Action Parameters Test");
+        res.setDesc("Ensure that parameters sent through the action query stream have NOT
made it.");
+
+        String val = req.getParameter(KEY);
+        if(val != null) {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Retrieved action parameter ("+KEY+"="+VALUE+" inappropriately");
+        }
+        else {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        return res;
+    }
+
+
+    protected TestResult checkInternalRenderParameter(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Render Parameter Test");
+        res.setDesc("Validate the appropriate render parameters");
+
+        String val = req.getParameter(IKEY);
+        if(val == null || !VALUE.equals(val)) {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Expected : "+VALUE+" retrieved "+val);
+        }
+        else {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        return res;
+    }
+
+    protected TestResult checkInternalRenderParameterValues(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Render Parameter Values Test");
+        res.setDesc("Validate the appropriate render parameter values");
+
+        String[] val = req.getParameterValues(IKEY);
+        if(val == null || val.length<1 || !VALUE.equals(val[0])) {
+            res.setReturnCode(TestResult.FAILED);
+            res.setResults("Expected : "+VALUE+" retrieved "+val);
+        }
+        else {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        return res;
+    }
+
+    protected TestResult checkParameterMap(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Render Parameter Map Test");
+        res.setName("Check the contents of the render parameter map");
+
+        Map map = req.getParameterMap();
+        String[] val = (String[])map.get(IKEY);
+        if(map.containsKey(KEY) || val==null || val.length < 1 || !VALUE.equals(val[0]))
{
+            res.setReturnCode(TestResult.FAILED);
+            if(map.containsKey(KEY)) {
+                res.setResults("Found Action Parameter: "+KEY+"="+map.get(KEY));
+            }
+            if(!map.containsKey(IKEY) || val.length <1 || !VALUE.equals(val[0])) {
+                res.setResults("Render Parameter: "+IKEY+"="+(val.length<1?"null":val[0])+"
does not contain the expected value: "+VALUE);
+            }
+            return res;
+        }
+        res.setReturnCode(TestResult.PASSED);
+        return res;
+    }
+
+    protected TestResult checkParameterNames(PortletRequest req) {
+        TestResult res = new TestResult();
+        res.setName("Test Parameter Names Enumeration.");
+        res.setDesc("Enumerate through all expected names.");
+
+        boolean hasExternal = false;
+        boolean hasInternal = false;
+        Enumeration enumerator= req.getParameterNames();
+        while(enumerator.hasMoreElements()) {
+            String val = enumerator.nextElement().toString();
+            if(KEY.equals(val)) {
+                hasExternal = true;
+            }
+            if(IKEY.equals(val)) {
+                hasInternal = true;
+            }
+        }
+        if(!hasInternal || hasExternal) {
+            res.setReturnCode(TestResult.FAILED);
+            StringBuffer sb = new StringBuffer();
+            if(!hasInternal) {
+                sb.append("Render Parameter Not Found. ");
+            }
+            if(!hasExternal) {
+                sb.append("Action Parameter Found. ");
+            }
+            res.setResults(sb.toString());
+        }
+        else {
+            res.setReturnCode(TestResult.PASSED);
+        }
+        return res;
+    }
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/TestResult.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/TestResult.java?rev=227271&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/TestResult.java
(added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/TestResult.java
Wed Aug  3 14:43:40 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.testsuite.test;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public class TestResult implements Serializable {
+
+    public static final String PASSED = "Passed";
+    public static final String FAILED = "Failed";
+    public static final String WARNING = "Warning";
+
+    private String name;
+    private String desc;
+    private String returnCode;
+    private String results ="unknown";
+
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
+    public String getReturnCode() {
+        return returnCode;
+    }
+
+    public void setReturnCode(String returnCode) {
+        this.returnCode = returnCode;
+    }
+
+    public String getResults() {
+        return results;
+    }
+
+    public void setResults(String results) {
+        this.results = results;
+    }
+
+}

Added: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/TestResults.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/TestResults.java?rev=227271&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/TestResults.java
(added)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/java/org/apache/pluto/testsuite/test/TestResults.java
Wed Aug  3 14:43:40 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2003,2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.testsuite.test;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.io.Serializable;
+
+/**
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ */
+public class TestResults implements Serializable {
+
+    private String name;
+    private ArrayList list = new ArrayList();
+    private boolean failed;
+    private boolean inQuestion;
+
+    public TestResults(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void add(TestResult res) {
+        if(TestResult.FAILED.equals(res.getReturnCode())) {
+            failed = true;
+        }
+        if(TestResult.WARNING.equals(res.getReturnCode())) {
+            inQuestion = true;
+        }
+        list.add(res);
+    }
+
+    public boolean isFailed() {
+        return failed;
+    }
+
+    public boolean isInQuestion() {
+        return inQuestion;
+    }
+
+    public Collection getCollection() {
+        return Collections.unmodifiableCollection(list);
+    }
+
+}

Modified: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/classes/expectedResults.properties
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/classes/expectedResults.properties?rev=227271&r1=227270&r2=227271&view=diff
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/classes/expectedResults.properties
(original)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/classes/expectedResults.properties
Wed Aug  3 14:43:40 2005
@@ -24,11 +24,11 @@
 
 # The value we expect to return from renderRequest.getPortalContext().getPortalInfo();
 
-expected.serverInfo = Pluto/1.0.1-rc3
+expected.serverInfo = Pluto/1.1.0-ALPHA
 expected.version.major=1
 expected.version.minor=0
 
-expected.portalInfo = pluto-driver/1.0.1-rc3
+expected.portalInfo = pluto-driver/1.1.0-ALPHA
 
 expected.security.role=tomcat
 expected.security.role.mapped=plutoTestRole

Modified: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/portlet.xml?rev=227271&r1=227270&r2=227271&view=diff
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/portlet.xml (original)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/portlet.xml Wed
Aug  3 14:43:40 2005
@@ -26,7 +26,7 @@
         <portlet-name>TestPortlet1</portlet-name>
         <display-name>Test Portlet #1</display-name>
 		
-        <portlet-class>org.apache.pluto.portalImpl.portlet.TestPortlet</portlet-class>
+        <portlet-class>org.apache.pluto.testsuite.TestPortlet</portlet-class>
 
         <init-param>
             <name>config</name>
@@ -82,7 +82,7 @@
         <description>TestSuiteDescription</description>
         <portlet-name>TestPortlet2</portlet-name>
         <display-name>Test Portlet #2</display-name>
-        <portlet-class>org.apache.pluto.portalImpl.portlet.TestPortlet</portlet-class>
+        <portlet-class>org.apache.pluto.testsuite.TestPortlet</portlet-class>
 
         <init-param>
             <name>config</name>

Modified: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/testsuite-2-config.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/testsuite-2-config.xml?rev=227271&r1=227270&r2=227271&view=diff
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/testsuite-2-config.xml
(original)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/testsuite-2-config.xml
Wed Aug  3 14:43:40 2005
@@ -17,7 +17,7 @@
     
   <testsuite-config>
     <name>Simple Render Parameter Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.SimpleRenderParameterTest</class>
+    <class>org.apache.pluto.testsuite.test.SimpleRenderParameterTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
     <action-param>
       <name>org.apache.pluto.testsuite.PARAM_TEST_KEY</name>
@@ -27,7 +27,7 @@
 
   <testsuite-config>
       <name>Simple Action Parameter Test</name>
-      <class>org.apache.pluto.portalImpl.portlet.test.SimpleActionParameterTest</class>
+      <class>org.apache.pluto.testsuite.test.SimpleActionParameterTest</class>
       <display-uri>/jsp/test_results.jsp</display-uri>
     <action-param>
       <name>org.apache.pluto.testsuite.PARAM_TEST_KEY</name>
@@ -37,37 +37,37 @@
     
   <testsuite-config>
     <name>Dispatcher Parameter Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.DispatcherRenderParameterTest</class>
+    <class>org.apache.pluto.testsuite.test.DispatcherRenderParameterTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
 
   <testsuite-config>
     <name>Simple Attribute Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.SimpleAttributeTest</class>
+    <class>org.apache.pluto.testsuite.test.SimpleAttributeTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
     
   <testsuite-config>
     <name>Complex Attribute Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.ComplexAttributeTest</class>
+    <class>org.apache.pluto.testsuite.test.ComplexAttributeTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
     
   <testsuite-config>
     <name>External App Scoped Attribute Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.ExternalAppScopedAttributeTest</class>
+    <class>org.apache.pluto.testsuite.test.ExternalAppScopedAttributeTest</class>
     <display-uri>/jsp/ext_app_scoped_attr_test.jsp</display-uri>
   </testsuite-config>
 
   <testsuite-config>
     <name>Context Init Parameter Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.ContextInitParameterTest</class>
+    <class>org.apache.pluto.testsuite.test.ContextInitParameterTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
 
   <testsuite-config>
     <name>Simple Preference Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.SimplePreferenceTest</class>
+    <class>org.apache.pluto.testsuite.test.SimplePreferenceTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
 
@@ -83,19 +83,19 @@
 
   <testsuite-config>
     <name>Misc Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.MiscTest</class>
+    <class>org.apache.pluto.testsuite.test.MiscTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
 
   <testsuite-config>
     <name>Security Mapping Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.SecurityMappingTest</class>
+    <class>org.apache.pluto.testsuite.test.SecurityMappingTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
 
   <testsuite-config>
     <name>Resource Bundle Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.ResourceBundleTest</class>
+    <class>org.apache.pluto.testsuite.test.ResourceBundleTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
     <init-param>
         <name>resource-bundle</name>

Modified: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/testsuite-config.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/testsuite-config.xml?rev=227271&r1=227270&r2=227271&view=diff
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/testsuite-config.xml
(original)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/testsuite-config.xml
Wed Aug  3 14:43:40 2005
@@ -17,7 +17,7 @@
     
   <testsuite-config>
     <name>Simple Render Parameter Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.SimpleRenderParameterTest</class>
+    <class>org.apache.pluto.testsuite.test.SimpleRenderParameterTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
     <action-param>
       <name>org.apache.pluto.testsuite.PARAM_TEST_KEY</name>
@@ -27,7 +27,7 @@
 
   <testsuite-config>
     <name>Simple Action Parameter Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.SimpleActionParameterTest</class>
+    <class>org.apache.pluto.testsuite.test.SimpleActionParameterTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
     <action-param>
       <name>org.apache.pluto.testsuite.PARAM_TEST_KEY</name>
@@ -37,37 +37,37 @@
 
   <testsuite-config>
     <name>Dispatcher Parameter Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.DispatcherRenderParameterTest</class>
+    <class>org.apache.pluto.testsuite.test.DispatcherRenderParameterTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
 
   <testsuite-config>
     <name>Simple Attribute Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.SimpleAttributeTest</class>
+    <class>org.apache.pluto.testsuite.test.SimpleAttributeTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
     
   <testsuite-config>
     <name>Complex Attribute Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.ComplexAttributeTest</class>
+    <class>org.apache.pluto.testsuite.test.ComplexAttributeTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
     
   <testsuite-config>
     <name>External App Scoped Attribute Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.ExternalAppScopedAttributeTest</class>
+    <class>org.apache.pluto.testsuite.test.ExternalAppScopedAttributeTest</class>
     <display-uri>/jsp/ext_app_scoped_attr_test.jsp</display-uri>
   </testsuite-config>
 
   <testsuite-config>
     <name>Context Init Parameter Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.ContextInitParameterTest</class>
+    <class>org.apache.pluto.testsuite.test.ContextInitParameterTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
 
   <testsuite-config>
     <name>Simple Preference Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.SimplePreferenceTest</class>
+    <class>org.apache.pluto.testsuite.test.SimplePreferenceTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
 
@@ -83,19 +83,19 @@
 
   <testsuite-config>
     <name>Misc Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.MiscTest</class>
+    <class>org.apache.pluto.testsuite.test.MiscTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
 
   <testsuite-config>
     <name>Security Mapping Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.SecurityMappingTest</class>
+    <class>org.apache.pluto.testsuite.test.SecurityMappingTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
   </testsuite-config>
 
   <testsuite-config>
     <name>Resource Bundle Test</name>
-    <class>org.apache.pluto.portalImpl.portlet.test.ResourceBundleTest</class>
+    <class>org.apache.pluto.testsuite.test.ResourceBundleTest</class>
     <display-uri>/jsp/test_results.jsp</display-uri>
     <init-param>
         <name>resource-bundle</name>

Modified: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/web.xml?rev=227271&r1=227270&r2=227271&view=diff
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/web.xml (original)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/WEB-INF/web.xml Wed Aug
 3 14:43:40 2005
@@ -55,12 +55,12 @@
 
     <servlet>
     	<servlet-name>extAppScopedTest</servlet-name>
-        <servlet-class>org.apache.pluto.portalImpl.portlet.test.ExternalAppScopedAttributeTestCompanionServlet</servlet-class>
+        <servlet-class>org.apache.pluto.testsuite.test.ExternalAppScopedAttributeTestCompanionServlet</servlet-class>
     </servlet>
 
     <servlet>
         <servlet-name>includeTest</servlet-name>
-        <servlet-class>org.apache.pluto.portalImpl.portlet.test.DispatcherRenderParameterTestServlet</servlet-class>
+        <servlet-class>org.apache.pluto.testsuite.test.DispatcherRenderParameterTestServlet</servlet-class>
     </servlet>
 
 

Modified: portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/jsp/navigation.inc
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/jsp/navigation.inc?rev=227271&r1=227270&r2=227271&view=diff
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/jsp/navigation.inc (original)
+++ portals/pluto/branches/pluto-1.1/pluto-testsuite/src/main/webapp/jsp/navigation.inc Wed
Aug  3 14:43:40 2005
@@ -1,5 +1,5 @@
-<%@ page import="java.util.Map,
-                 org.apache.pluto.portalImpl.portlet.TestConfig"%>
+<%@ page import="java.util.Map"%>
+<%@ page import="org.apache.pluto.testsuite.TestConfig"%>
  <%--
 Copyright 2004 The Apache Software Foundation
 Licensed  under the  Apache License,  Version 2.0  (the "License");

Modified: portals/pluto/branches/pluto-1.1/pom.xml
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pom.xml?rev=227271&r1=227270&r2=227271&view=diff
==============================================================================
--- portals/pluto/branches/pluto-1.1/pom.xml (original)
+++ portals/pluto/branches/pluto-1.1/pom.xml Wed Aug  3 14:43:40 2005
@@ -53,6 +53,14 @@
       <id>website</id>
       <url>scp://minotaur.apache.org/www/portals.apache.org/pluto/</url>
     </site>
+    <repository>
+      <id>snapshots</id>
+      <name>Snapshot Repository</name>
+	  <url>scp://daviddewolf.com/www/daviddewolf.com/m2/</url>
+	  <snapshotPolicy>always</snapshotPolicy>
+	  <layout>default</layout>
+	  <checksumPolicy>warn</checksumPolicy>
+    </repository>
   </distributionManagement>
 
   <repositories>



Mime
View raw message