I�ve added the capability to specify a class which the <modified> selector
should load as cache|algorithm|comparator. Test passed.
BUT
I have to add "-lib build\testcases" for running the tests, otherwise
the selector wont find a mock class which resides in the test package.
A first view into the build.xml seems to add the test classes (and sources)
to the classpath, but it doesnt ...
Has someone an idea?
Jan
src/main/.../selectors/modfiedselector
ModifiedSelector.java: Object rv =
Class.forName(classname).newInstance();
src/testcases/.../selectors/
ModifiedSelectorTest.java:
String algo =
getAlgoName("org.apache.tools.ant.types.selectors.MockAlgorithm");
...
private String getAlgoName(String classname) {
ModifiedSelector sel = new ModifiedSelector();
sel.setAlgorithmClass(classname);
// let the selector do its checks
sel.validate();
String s1 = sel.toString();
int posStart = s1.indexOf("algorithm=") + 10;
int posEnd = s1.indexOf(" comparator=");
String algo = s1.substring(posStart, posEnd);
...
return algo;
}
MockAlgorithm.java
MockCache.java
MockComparator.java
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]