01: /*
02: * Copyright 2007 Gerd Ziegler (www.gerdziegler.de)
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: * http://www.apache.org/licenses/LICENSE-2.0
07: * Unless required by applicable law or agreed to in writing,
08: * software distributed under the License is distributed on an
09: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
10: * either express or implied. See the License for the specific
11: * language governing permissions and limitations under the License.
12: * 20.09.2007
13: * @author www.gerdziegler.de
14: */
15: package org.ztemplates.test.actions.urlhandler.match.handler.tail;
16:
17: import junit.framework.TestCase;
18:
19: import org.apache.log4j.Logger;
20: import org.ztemplates.actions.urlhandler.tree.match.ZMatchTree;
21: import org.ztemplates.actions.urlhandler.tree.match.ZMatchedUrl;
22: import org.ztemplates.classpath.ZClassRepository;
23: import org.ztemplates.classpath.ZIClassRepository;
24:
25: public class TailParseTreeTest extends TestCase {
26: static Logger log = Logger.getLogger(TailParseTreeTest.class);
27:
28: ZIClassRepository classRepo;
29:
30: ZMatchTree han;
31:
32: protected void setUp() throws Exception {
33: super .setUp();
34: classRepo = new ZClassRepository(TailParseTreeTest.class
35: .getPackage().getName());
36: han = new ZMatchTree(classRepo);
37: }
38:
39: protected void tearDown() throws Exception {
40: classRepo = null;
41: han = null;
42: super .tearDown();
43: }
44:
45: public void testTail1() throws Exception {
46: ZMatchedUrl proc = han.match("/path6/123");
47: assertNotNull(proc);
48: }
49:
50: public void testTail2() throws Exception {
51: ZMatchedUrl proc = han.match("/path6/123/456");
52: assertNotNull(proc);
53: }
54:
55: public void testTail3() throws Exception {
56: ZMatchedUrl proc = han.match("/path6123/456/sdfsdf");
57: assertNotNull(proc);
58: }
59:
60: public void testTail4() throws Exception {
61: ZMatchedUrl proc = han.match("/path7/123/456/sdfsdf");
62: assertNotNull(proc);
63: }
64:
65: public void testTail5() throws Exception {
66: ZMatchedUrl proc = han.match("/path7123/456/sdfsdf");
67: assertNull(proc);
68: }
69: }
|