Methods Summary |
---|
protected void | assertPropertyContains(java.lang.String property, java.lang.String contains)assert that a property contains a string
String result = getProperty(property);
assertTrue("expected " + contains + " in " + result,
result != null && result.indexOf(contains) >= 0);
|
private void | assertPropertyEndsWith(java.lang.String property, java.lang.String ending)assert that a property ends with
String result = getProperty(property);
String substring = result.substring(result.length() - ending.length());
assertEquals(ending, substring);
|
protected java.lang.String | getProperty(java.lang.String property)get a property from the project
return project.getProperty(property);
|
public void | setUp()
configureProject("src/etc/testcases/taskdefs/makeurl.xml");
|
public void | testEmpty()
expectBuildExceptionContaining("testEmpty", "missing property", "property");
|
public void | testFileset()
executeTarget("testFileset");
assertPropertyContains("testFileset", ".xml ");
String result = getProperty("testFileset");
assertPropertyEndsWith("testFileset", ".xml");
|
public void | testFilesetSeparator()
executeTarget("testFilesetSeparator");
assertPropertyContains("testFilesetSeparator", ".xml\",\"");
assertPropertyEndsWith("testFilesetSeparator", ".xml");
|
public void | testIllegalChars()
executeTarget("testIllegalChars");
assertPropertyContains("testIllegalChars", "file:");
assertPropertyContains("testIllegalChars", "fo%20o%25");
|
public void | testIllegalCombinations()
executeTarget("testIllegalCombinations");
assertPropertyContains("testIllegalCombinations", "/foo");
assertPropertyContains("testIllegalCombinations", ".xml");
|
public void | testNoFile()
expectBuildExceptionContaining("testNoFile", "missing file", "file");
|
public void | testNoProperty()
expectBuildExceptionContaining("testNoProperty", "missing property", "property");
|
public void | testPath()
executeTarget("testPath");
assertPropertyContains("testPath", "makeurl.xml");
|
public void | testRoundTrip()test that we can round trip by opening a url that exists
executeTarget("testRoundTrip");
assertPropertyContains("testRoundTrip", "file:");
String property = getProperty("testRoundTrip");
URL url = new URL(property);
InputStream instream = url.openStream();
instream.close();
|
public void | testValidation()
expectBuildExceptionContaining("testValidation", MakeUrl.ERROR_MISSING_FILE, "file");
|
public void | testWorks()
executeTarget("testWorks");
assertPropertyContains("testWorks", "file:");
assertPropertyContains("testWorks", "/foo");
|