portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r598497 - /portals/jetspeed-2/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/pipeline/TestPipeline.java
Date Tue, 27 Nov 2007 02:54:07 GMT
Author: ate
Date: Mon Nov 26 18:54:06 2007
New Revision: 598497

URL: http://svn.apache.org/viewvc?rev=598497&view=rev
Log:
Fixing TestPipeline testcase which was broken (once again) because a new Valve was added to
pipelines.xml.
Now fixed for good: replacing positional valve checks (which really didn't make much sense)
with map based lookup checks.

Modified:
    portals/jetspeed-2/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/pipeline/TestPipeline.java

Modified: portals/jetspeed-2/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/pipeline/TestPipeline.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/pipeline/TestPipeline.java?rev=598497&r1=598496&r2=598497&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/pipeline/TestPipeline.java
(original)
+++ portals/jetspeed-2/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/pipeline/TestPipeline.java
Mon Nov 26 18:54:06 2007
@@ -47,20 +47,25 @@
         Pipeline pipeline = engine.getPipeline();
         assertNotNull(pipeline);
         Valve[] valves = pipeline.getValves();
-        assertEquals("CapabilityValveImpl", valves[0].toString());
-        assertEquals("PortalURLValveImpl", valves[1].toString());
-        assertEquals("SecurityValve", valves[2].toString());
-        assertEquals("LocalizationValve", valves[3].toString());
-        assertEquals("PasswordCredentialValve", valves[4].toString());
-        assertEquals("LoginValidationValve", valves[5].toString());
-        assertEquals("ProfilerValve", valves[6].toString());
-        assertEquals("ContainerValve", valves[7].toString());
-        assertEquals("ActionValveImpl", valves[8].toString());
-        assertEquals("ResourceValveImpl", valves[9].toString());
-        assertEquals("DecorationValve", valves[10].toString());
-        assertEquals("HeaderAggregatorValve", valves[11].toString());
-        assertEquals("AggregatorValve", valves[12].toString());
-        assertEquals("CleanupValveImpl", valves[13].toString());
+        HashMap valvesMap = new HashMap(valves.length);
+        for (int i = 0; i < valves.length; i++)
+        {
+            valvesMap.put(valves[i].toString(), valves[i]);
+        }
+        assertNotNull("CapabilityValveImpl", valvesMap.get("CapabilityValveImpl"));
+        assertNotNull("PortalURLValveImpl", valvesMap.get("PortalURLValveImpl"));
+        assertNotNull("SecurityValve", valvesMap.get("SecurityValve"));
+        assertNotNull("LocalizationValve", valvesMap.get("LocalizationValve"));
+        assertNotNull("PasswordCredentialValve", valvesMap.get("PasswordCredentialValve"));
+        assertNotNull("LoginValidationValve", valvesMap.get("LoginValidationValve"));
+        assertNotNull("ProfilerValve", valvesMap.get("ProfilerValve"));
+        assertNotNull("ContainerValve", valvesMap.get("ContainerValve"));
+        assertNotNull("ActionValveImpl", valvesMap.get("ActionValveImpl"));
+        assertNotNull("ResourceValveImpl", valvesMap.get("ResourceValveImpl"));
+        assertNotNull("DecorationValve", valvesMap.get("DecorationValve"));
+        assertNotNull("HeaderAggregatorValve", valvesMap.get("HeaderAggregatorValve"));
+        assertNotNull("AggregatorValve", valvesMap.get("AggregatorValve"));
+        assertNotNull("CleanupValveImpl", valvesMap.get("CleanupValveImpl"));
         
         
         assertNotNull(engine.getPipeline("action-pipeline"));



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


Mime
View raw message