PropertyExpansionTestpublic class PropertyExpansionTest extends BuildFileTest class to look at how we expand properties |
Constructors Summary |
---|
public PropertyExpansionTest(String name)
super(name);
|
Methods Summary |
---|
private void | assertExpandsTo(java.lang.String source, java.lang.String expected)little helper method to validate stuff
String actual=project.replaceProperties(source);
assertEquals(source,expected,actual);
| public void | oldtestQuirkyLegacyBehavior()old things we dont want; not a test no more
assertExpandsTo("Class$subclass","Classsubclass");
assertExpandsTo("$$$-","$-");
assertExpandsTo("a$b","ab");
assertExpandsTo("$}}","}}");
| public void | setUp()we bind to an existing test file because we are too lazy to write our
own, and we don't really care what it is
configureProject("src/etc/testcases/core/immutable.xml");
| public void | testDollarPassthru()new things we want
assertExpandsTo("$-","$-");
assertExpandsTo("Class$subclass","Class$subclass");
assertExpandsTo("$$$-","$$-");
assertExpandsTo("$$$$$","$$$");
assertExpandsTo("${unassigned.property}","${unassigned.property}");
assertExpandsTo("a$b","a$b");
assertExpandsTo("$}}","$}}");
| public void | testPropertyExpansion()run through the test cases of expansion
assertExpandsTo("","");
assertExpandsTo("$","$");
assertExpandsTo("$$-","$-");
assertExpandsTo("$$","$");
project.setProperty("expanded","EXPANDED");
assertExpandsTo("a${expanded}b","aEXPANDEDb");
assertExpandsTo("${expanded}${expanded}","EXPANDEDEXPANDED");
assertExpandsTo("$$$","$$");
assertExpandsTo("$$$$-","$$-");
assertExpandsTo("","");
assertExpandsTo("Class$$subclass","Class$subclass");
|
|