1   package org.portletbridge.portlet;
2   
3   import junit.framework.TestCase;
4   
5   public class PseudoRenderResponseTest extends TestCase {
6   
7       public PseudoRenderResponseTest(String arg0) {
8           super(arg0);
9       }
10  
11      protected void setUp() throws Exception {
12          super.setUp();
13      }
14  
15      protected void tearDown() throws Exception {
16          super.tearDown();
17      }
18  
19      /*
20       * Test method for 'org.portletbridge.portlet.PseudoRenderResponse.PseudoRenderResponse(String, String, String)'
21       */
22      public void testPseudoRenderResponseEnd() {
23          PseudoRenderResponse response = new PseudoRenderResponse("namespace", "blah?id=1234", "1234");
24          assertEquals("blah?id=", response.getStart());
25          assertEquals("", response.getEnd());
26      }
27  
28      public void testPseudoRenderResponseStart() {
29          PseudoRenderResponse response = new PseudoRenderResponse("namespace", "1234&blah", "1234");
30          assertEquals("", response.getStart());
31          assertEquals("&blah", response.getEnd());
32      }
33  
34      public void testPseudoRenderResponseExact() {
35          PseudoRenderResponse response = new PseudoRenderResponse("namespace", "1234", "1234");
36          assertEquals("", response.getStart());
37          assertEquals("", response.getEnd());
38      }
39  
40      public void testPseudoRenderResponseShorter() {
41          PseudoRenderResponse response = new PseudoRenderResponse("namespace", "1", "1234");
42          assertEquals("", response.getStart());
43          assertEquals("", response.getEnd());
44      }
45  
46      public void testPseudoRenderResponseMiddle() {
47          PseudoRenderResponse response = new PseudoRenderResponse("namespace", "blah?id=1234&somethingelse", "1234");
48          assertEquals("blah?id=", response.getStart());
49          assertEquals("&somethingelse", response.getEnd());
50      }
51  
52      public void testPseudoRenderResponseNone() {
53          PseudoRenderResponse response = new PseudoRenderResponse("namespace", "blah?id=1234", "12345");
54          assertEquals("", response.getStart());
55          assertEquals("", response.getEnd());
56      }
57  
58  }