1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.pipeline;
18
19 import java.util.HashMap;
20 import java.util.Map;
21
22 import junit.framework.TestCase;
23
24 import org.apache.jetspeed.engine.Engine;
25 import org.apache.jetspeed.pipeline.valve.Valve;
26 import org.apache.jetspeed.testhelpers.SpringEngineHelper;
27
28 /***
29 * TestPipeline
30 *
31 * @author <a href="taylor@apache.org">David Sean Taylor</a>
32 * @version $Id: TestPipeline.java 544402 2007-06-05 06:20:00Z taylor $
33 */
34 public class TestPipeline extends TestCase
35 {
36 private Engine engine;
37 private SpringEngineHelper engineHelper;
38
39 /***
40 * Tests
41 *
42 * @throws Exception
43 */
44 public void testPipeline() throws Exception
45 {
46 assertNotNull(engine);
47 Pipeline pipeline = engine.getPipeline();
48 assertNotNull(pipeline);
49 Valve[] valves = pipeline.getValves();
50 assertEquals("CapabilityValveImpl", valves[0].toString());
51 assertEquals("PortalURLValveImpl", valves[1].toString());
52 assertEquals("SecurityValve", valves[2].toString());
53 assertEquals("LocalizationValve", valves[3].toString());
54 assertEquals("PasswordCredentialValve", valves[4].toString());
55 assertEquals("LoginValidationValve", valves[5].toString());
56 assertEquals("ProfilerValve", valves[6].toString());
57 assertEquals("ContainerValve", valves[7].toString());
58 assertEquals("ActionValveImpl", valves[8].toString());
59 assertEquals("ResourceValveImpl", valves[9].toString());
60 assertEquals("DecorationValve", valves[10].toString());
61 assertEquals("HeaderAggregatorValve", valves[11].toString());
62 assertEquals("AggregatorValve", valves[12].toString());
63 assertEquals("CleanupValveImpl", valves[13].toString());
64
65
66 assertNotNull(engine.getPipeline("action-pipeline"));
67 assertNotNull(engine.getPipeline("portlet-pipeline"));
68 }
69
70 protected void setUp() throws Exception
71 {
72 Map context = new HashMap();
73 engineHelper = new SpringEngineHelper(context);
74 engineHelper.setUp();
75 this.engine = (Engine)context.get(SpringEngineHelper.ENGINE_ATTR);
76 }
77
78 protected void tearDown() throws Exception
79 {
80 engineHelper.tearDown();
81 }
82 }