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.classes.test1;
16:
17: import junit.framework.TestCase;
18:
19: import org.apache.log4j.Logger;
20: import org.ztemplates.actions.ZMatch;
21: import org.ztemplates.classpath.ZClassRepository;
22: import org.ztemplates.classpath.ZIClassRepository;
23:
24: public class ClassesTest extends TestCase {
25: static Logger log = Logger.getLogger(ClassesTest.class);
26:
27: protected void setUp() throws Exception {
28: super .setUp();
29: }
30:
31: protected void tearDown() throws Exception {
32: super .tearDown();
33: }
34:
35: public void test1() throws Exception {
36: ZIClassRepository classRepo = new ZClassRepository(
37: ClassesTest.class.getPackage().getName());
38: assertTrue(classRepo.getClassesAnnotatedWith(ZMatch.class)
39: .contains(Handler1.class));
40: assertTrue(classRepo.getClassesAnnotatedWith(ZMatch.class)
41: .contains(Handler2.class));
42: assertEquals(2, classRepo.getClassesAnnotatedWith(ZMatch.class)
43: .size());
44: }
45: }
|