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: * 22.09.2007
13: * @author www.gerdziegler.de
14: */
15: package org.ztemplates.test.actions.urlhandler.callbacks.test2;
16:
17: import java.util.HashMap;
18:
19: import junit.framework.TestCase;
20:
21: import org.apache.log4j.Logger;
22: import org.ztemplates.actions.urlhandler.ZIUrlHandler;
23: import org.ztemplates.actions.urlhandler.tree.ZUrlHandlerFactory;
24: import org.ztemplates.classpath.ZClassRepository;
25: import org.ztemplates.classpath.ZIClassRepository;
26:
27: public class TreePrintTest extends TestCase {
28: static Logger log = Logger.getLogger(TreePrintTest.class);
29:
30: ZIClassRepository classRepo;
31:
32: ZIUrlHandler proc;
33:
34: protected void setUp() throws Exception {
35: super .setUp();
36: classRepo = new ZClassRepository(TreePrintTest.class
37: .getPackage().getName());
38:
39: proc = ZUrlHandlerFactory.create(classRepo,
40: ZUrlHandlerFactory.defaultSecurityService);
41: }
42:
43: protected void tearDown() throws Exception {
44: classRepo = null;
45: proc = null;
46: super .tearDown();
47: }
48:
49: public void test() throws Exception {
50: Handler obj = (Handler) proc.process("/base/nested/katzeklo",
51: new HashMap<String, String[]>());
52: assertEquals(NestedHandlerImpl.class, obj.getNested()
53: .getClass());
54: }
55: }
|