portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddew...@apache.org
Subject svn commit: rev 54818 - in portals/pluto/trunk/testsuite/src: java/org/apache/pluto/portalImpl/portlet/test webapp/WEB-INF webapp/WEB-INF/classes
Date Fri, 15 Oct 2004 02:20:48 GMT
Author: ddewolf
Date: Thu Oct 14 19:20:46 2004
New Revision: 54818

Modified:
   portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/test/SecurityMappingTest.java
   portals/pluto/trunk/testsuite/src/webapp/WEB-INF/classes/expectedResults.properties
   portals/pluto/trunk/testsuite/src/webapp/WEB-INF/testsuite-config.xml
Log:
Updated testsuite to enhance the Security Mapping Test.
 - Include the test in the test configuration
 - Allow configuration of what roles to use for the tests

Modified: portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/test/SecurityMappingTest.java
==============================================================================
--- portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/test/SecurityMappingTest.java
(original)
+++ portals/pluto/trunk/testsuite/src/java/org/apache/pluto/portalImpl/portlet/test/SecurityMappingTest.java
Thu Oct 14 19:20:46 2004
@@ -16,12 +16,15 @@
 package org.apache.pluto.portalImpl.portlet.test;
 
 import java.util.Map;
+import java.util.Properties;
 
 import javax.portlet.PortletContext;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletRequest;
 
+import org.apache.pluto.testsuite.ExpectedResults;
+
 /**
  * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
  */
@@ -44,12 +47,15 @@
             return res;
         }
 
-        if(req.isUserInRole("plutoTestRole")) {
+        Properties props = ExpectedResults.getExpectedProperties();
+        String role = props.getProperty("expected.security.role.mapped");
+
+        if(req.isUserInRole(role)) {
             res.setReturnCode(TestResult.PASSED);
         }
         else {
             res.setReturnCode(TestResult.WARNING);
-            res.setReturnCode("User is not in the expected 'tomcat' role.  This may be due
to misconfiuration.");
+            res.setReturnCode("User is not in the expected '"+role+"' role.  This may be
due to misconfiuration.");
         }
 
         return res;
@@ -63,12 +69,15 @@
             return res;
         }
 
-        if(req.isUserInRole("tomcat")) {
+        Properties props = ExpectedResults.getExpectedProperties();
+        String role = props.getProperty("expected.security.role");
+
+        if(req.isUserInRole(role)) {
             res.setReturnCode(TestResult.PASSED);
         }
         else {
             res.setReturnCode(TestResult.WARNING);
-            res.setReturnCode("User is not in the expected 'tomcat' role.  This may be due
to misconfiuration.");
+            res.setReturnCode("User is not in the expected '"+role+"' role.  This may be
due to misconfiuration.");
         }
 
         return res;

Modified: portals/pluto/trunk/testsuite/src/webapp/WEB-INF/classes/expectedResults.properties
==============================================================================
--- portals/pluto/trunk/testsuite/src/webapp/WEB-INF/classes/expectedResults.properties	(original)
+++ portals/pluto/trunk/testsuite/src/webapp/WEB-INF/classes/expectedResults.properties	Thu
Oct 14 19:20:46 2004
@@ -27,3 +27,6 @@
 
 expected.version.major=1
 expected.version.minor=0
+
+expected.security.role=tomcat
+expected.security.role.mapped=plutoTestRole

Modified: portals/pluto/trunk/testsuite/src/webapp/WEB-INF/testsuite-config.xml
==============================================================================
--- portals/pluto/trunk/testsuite/src/webapp/WEB-INF/testsuite-config.xml	(original)
+++ portals/pluto/trunk/testsuite/src/webapp/WEB-INF/testsuite-config.xml	Thu Oct 14 19:20:46
2004
@@ -67,5 +67,10 @@
     <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>
+    <display-uri>/jsp/test_results.jsp</display-uri>
+  </testsuite-config> 
 
-</testportlet-config>
\ No newline at end of file
+</testportlet-config>

Mime
View raw message