KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tools > ant > TaskContainerTest


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;
19
20 public class TaskContainerTest extends BuildFileTest {
21
22     public TaskContainerTest(String JavaDoc name) {
23         super(name);
24     }
25
26     public void setUp() {
27         configureProject("src/etc/testcases/core/taskcontainer.xml");
28     }
29
30     public void tearDown() {
31         executeTarget("cleanup");
32     }
33
34     public void testPropertyExpansion() {
35         executeTarget("testPropertyExpansion");
36         assertTrue("attribute worked",
37                    getLog().indexOf("As attribute: it worked") > -1);
38         assertTrue("nested text worked",
39                    getLog().indexOf("As nested text: it worked") > -1);
40     }
41
42     public void testTaskdef() {
43         executeTarget("testTaskdef");
44         assertTrue("attribute worked",
45                    getLog().indexOf("As attribute: it worked") > -1);
46         assertTrue("nested text worked",
47                    getLog().indexOf("As nested text: it worked") > -1);
48         assertTrue("nested text worked",
49                    getLog().indexOf("As nested task: it worked") > -1);
50     }
51
52     public void testCaseInsensitive() {
53         executeTarget("testCaseInsensitive");
54         assertTrue("works outside of container",
55                    getLog().indexOf("hello ") > -1);
56         assertTrue("works inside of container",
57                    getLog().indexOf("world") > -1);
58     }
59
60 }
61
Popular Tags