1 package org.apache.turbine.util; 2 3 18 19 import junit.framework.TestSuite; 20 21 import org.apache.commons.configuration.BaseConfiguration; 22 import org.apache.commons.configuration.Configuration; 23 24 import org.apache.turbine.services.ServiceManager; 25 import org.apache.turbine.services.TurbineServices; 26 import org.apache.turbine.test.BaseTestCase; 27 import org.apache.turbine.util.parser.ParserUtils; 28 29 35 public class DynamicURITest extends BaseTestCase 36 { 37 private DynamicURI duri; 38 39 44 public DynamicURITest(String testName) 45 throws Exception 46 { 47 super(testName); 48 49 ServiceManager serviceManager = TurbineServices.getInstance(); 51 serviceManager.setApplicationRoot("."); 52 Configuration cfg = new BaseConfiguration(); 53 cfg.setProperty(ParserUtils.URL_CASE_FOLDING_KEY, 54 ParserUtils.URL_CASE_FOLDING_LOWER_VALUE ); 55 serviceManager.setConfiguration(cfg); 56 57 } 58 59 62 protected void setUp() 63 { 64 ServerData sd = new ServerData("www.testserver.com", 80, "http", 65 "/servlet/turbine", "/context"); 66 duri = new DynamicURI(sd); 67 } 68 69 72 protected void tearDown() 73 { 74 duri = null; 75 } 76 77 82 public static TestSuite suite() 83 { 84 TestSuite suite = new TestSuite(DynamicURITest.class); 85 return suite; 86 } 87 88 public void testAddRemove() 89 { 90 duri.addPathInfo("test","x").removePathInfo("test"); 91 duri.addQueryData("test2","x").removeQueryData("test2"); 92 } 93 94 } 95 | Popular Tags |