01: package servletunit.struts;
02:
03: import junit.framework.TestCase;
04:
05: public class TestPathFunctions extends TestCase {
06:
07: public void testStripSessionId() {
08: String path = "/my/path;jsessionid=123456789";
09: path = Common.stripJSessionID(path);
10: assertEquals("/my/path", path);
11: }
12:
13: public void testStripLongSessionId() {
14: String path = "/my/path;jsessionid=99999999999999999999999999999999999999999999999999999999999";
15: path = Common.stripJSessionID(path);
16: assertEquals("/my/path", path);
17: }
18:
19: public void testStripSessionIdWithQueryString() {
20: String path = "/my/path;jsessionid=123456789?param=\"true\"";
21: path = Common.stripJSessionID(path);
22: assertEquals("/my/path?param=\"true\"", path);
23: }
24: }
|