1 20 package org.apache.cactus.sample.servlet.unit; 21 22 import org.apache.cactus.ServletTestCase; 23 import org.apache.cactus.WebRequest; 24 25 31 public class TestSetURLSpecific extends ServletTestCase 32 { 33 41 public void beginSimulatedURLGetRequestURLWhenNull(WebRequest theRequest) 42 { 43 theRequest.setURL("jakarta.apache.org", "", "/test/test.jsp", null, 44 null); 45 } 46 47 52 public void testSimulatedURLGetRequestURLWhenNull() 53 { 54 assertEquals("http://jakarta.apache.org:80/test/test.jsp", 55 request.getRequestURL().toString()); 56 } 57 58 60 68 public void beginSimulatedURLGetRequestURLWhenNotNull( 69 WebRequest theRequest) 70 { 71 theRequest.setURL("jakarta.apache.org", "/catalog", "/lawn", 72 "/index.html", null); 73 } 74 75 80 public void testSimulatedURLGetRequestURLWhenNotNull() 81 { 82 assertEquals("http://jakarta.apache.org:80/catalog/lawn/index.html", 83 request.getRequestURL().toString()); 84 } 85 } 86 | Popular Tags |