1 20 package org.apache.cactus.sample.servlet.unit; 21 22 import java.util.Map ; 23 24 import org.apache.cactus.ServletTestCase; 25 import org.apache.cactus.WebRequest; 26 27 32 public class TestHttpRequestSpecific extends ServletTestCase 33 { 34 40 public void beginGetParameterMap(WebRequest theRequest) 41 { 42 theRequest.addParameter("multivalue", "value 1"); 43 theRequest.addParameter("multivalue", "value 2"); 44 } 45 46 49 public void testGetParameterMap() 50 { 51 Map parameters = request.getParameterMap(); 52 assertTrue(parameters.containsKey("multivalue")); 53 String [] values = (String []) parameters.get("multivalue"); 54 assertEquals(2, values.length); 55 assertEquals("value 1", values[0]); 56 assertEquals("value 2", values[1]); 57 } 58 59 61 65 public void testRequestURL() 66 { 67 StringBuffer realURL = request.getOriginalRequest().getRequestURL(); 68 StringBuffer wrappedURL = request.getRequestURL(); 69 70 assertEquals(realURL.toString(), wrappedURL.toString()); 71 } 72 73 } 74 | Popular Tags |