01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18:
19: package org.apache.tools.ant.taskdefs;
20:
21: import org.apache.tools.ant.BuildFileTest;
22:
23: /**
24: */
25: public class AptTest extends BuildFileTest {
26: public AptTest(String name) {
27: super (name);
28: }
29:
30: public void setUp() {
31: configureProject("src/etc/testcases/taskdefs/apt.xml");
32: }
33:
34: /**
35: * Tears down the fixture, for example, close a network connection. This
36: * method is called after a test is executed.
37: */
38: protected void tearDown() throws Exception {
39: executeTarget("clean");
40: }
41:
42: public void testApt() {
43: executeTarget("testApt");
44: }
45:
46: public void testAptFork() {
47: executeTarget("testAptFork");
48: }
49:
50: public void testAptForkFalse() {
51: executeTarget("testAptForkFalse");
52: assertLogContaining(Apt.WARNING_IGNORING_FORK);
53: }
54:
55: public void testListAnnotationTypes() {
56: executeTarget("testListAnnotationTypes");
57: assertLogContaining("Set of annotations found:");
58: assertLogContaining("Distributed");
59: }
60:
61: public void testAptNewFactory() {
62: executeTarget("testAptNewFactory");
63: assertProcessed();
64: }
65:
66: public void testAptNewFactoryFork() {
67: executeTarget("testAptNewFactoryFork");
68: assertProcessed();
69: }
70:
71: private void assertProcessed() {
72: assertLogContaining("DistributedAnnotationProcessor-is-go");
73: assertLogContaining("[-Abuild.dir=");
74: assertLogContaining("visiting DistributedAnnotationFactory");
75: }
76: }
|