| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
package net.sf.antcontrib.property; |
| 17 |
|
| 18 |
import org.apache.tools.ant.BuildFileTest; |
| 19 |
|
| 20 |
|
| 21 |
|
| 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 |
} |