KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tools > ant > taskdefs > CallTargetTest


1 /*
2  * Copyright 2003-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 package org.apache.tools.ant.taskdefs;
19
20 import java.util.Vector JavaDoc;
21
22 import org.apache.tools.ant.BuildFileTest;
23 import org.apache.tools.ant.Project;
24 import org.apache.tools.ant.util.JavaEnvUtils;
25
26 /**
27  */

28 public class CallTargetTest extends BuildFileTest {
29
30     public CallTargetTest(String JavaDoc name) {
31         super(name);
32     }
33
34     public void setUp() {
35         configureProject("src/etc/testcases/taskdefs/calltarget.xml");
36     }
37
38     // see bugrep 21724 (references not passing through with antcall)
39
public void testInheritRefFileSet() {
40         expectLogContaining("testinheritreffileset", "calltarget.xml");
41     }
42
43     // see bugrep 21724 (references not passing through with antcall)
44
public void testInheritFilterset() {
45         project.executeTarget("testinheritreffilterset");
46     }
47
48     // see bugrep 11418 (In repeated calls to the same target,
49
// params will not be passed in)
50
public void testMultiCall() {
51         Vector JavaDoc v = new Vector JavaDoc();
52         v.add("call-multi");
53         v.add("call-multi");
54         project.executeTargets(v);
55         assertLogContaining("multi is SETmulti is SET");
56     }
57
58     public void testBlankTarget() {
59         expectBuildException("blank-target", "target name must not be empty");
60     }
61
62     public void testMultipleTargets() {
63         expectLog("multiple-targets", "tadadctbdbtc");
64     }
65
66     public void testMultipleTargets2() {
67         expectLog("multiple-targets-2", "dadctb");
68     }
69
70     public void tearDown() {
71         project.executeTarget("cleanup");
72     }
73 }
74
Popular Tags