Debian Codegraph @

test/src/net/sf/antcontrib/property/PropertySelectorTest.java

raw symbols SCIP
1 /*
2 * Copyright (c) 2001-2005 Ant-Contrib project. All rights reserved.
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 package net.sf.antcontrib.property;
17
18 import org.apache.tools.ant.BuildFileTest;
19
20 /**
21 * Testcase for <propertyselector>.
22 */
23 public class PropertySelectorTest extends BuildFileTest {
24
25 public PropertySelectorTest(String name) {
26 super(name);
27 }
28
29 public void setUp() {
30 configureProject("test/resources/property/propertyselector.xml");
31 }
32
33 public void testDefaultGrouping() {
34 simpleTest("select.test.grouping.0",
35 "module.Module1.id", "module.Module2.id");
36 }
37
38 public void testDefaultGrouping1() {
39 simpleTest("select.test.grouping.1",
40 "Module1", "Module2");
41 }
42
43 private void simpleTest(String target, String expected1, String expected2)
44 {
45 executeTarget(target);
46 String order1 = expected1 + "," + expected2;
47 String order2 = expected2 + "," + expected1;
48 int index1 = getLog().indexOf(order1);
49 int index2 = getLog().indexOf(order2);
50 assertTrue("Neither '" + order1 + "' nor '" + order2
51 + "' was found in '" + getLog() + "'",
52 index1 > -1 || index2 > -1);
53 }
54
55 }