git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271273 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -122,8 +122,8 @@ public final class ClasspathTestCollector extends ProjectComponent | |||||
| Project project = getProject(); | Project project = getProject(); | ||||
| DirectoryScanner ds = new DirectoryScanner(); | DirectoryScanner ds = new DirectoryScanner(); | ||||
| ds.setBasedir(dir); | ds.setBasedir(dir); | ||||
| ds.setIncludes(patterns.getIncludePatterns(getProject())); | |||||
| ds.setExcludes(patterns.getExcludePatterns(getProject())); | |||||
| ds.setIncludes(patterns.getIncludePatterns(project)); | |||||
| ds.setExcludes(patterns.getExcludePatterns(project)); | |||||
| ds.scan(); | ds.scan(); | ||||
| String[] included = ds.getIncludedFiles(); | String[] included = ds.getIncludedFiles(); | ||||
| return testClassNameFromFile(included); | return testClassNameFromFile(included); | ||||
| @@ -81,7 +81,6 @@ public final class JUnitHelper { | |||||
| */ | */ | ||||
| public static String getTestName(String text){ | public static String getTestName(String text){ | ||||
| int p1 = text.indexOf('('); | int p1 = text.indexOf('('); | ||||
| int p2 = text.indexOf(')', p1); | |||||
| return text.substring(0, p1); | return text.substring(0, p1); | ||||
| } | } | ||||
| @@ -118,7 +117,6 @@ public final class JUnitHelper { | |||||
| /** | /** | ||||
| * Extract a test from a given class | * Extract a test from a given class | ||||
| * @param clazz the class to extract a test from. | * @param clazz the class to extract a test from. | ||||
| * @throws Exception a generic exception | |||||
| */ | */ | ||||
| public static Test getTest(Class clazz) { | public static Test getTest(Class clazz) { | ||||
| try { | try { | ||||
| @@ -117,7 +117,6 @@ public class ResultFormatterElement { | |||||
| /** | /** | ||||
| * Setting a comma separated list of filters in the specified order. | * Setting a comma separated list of filters in the specified order. | ||||
| * @see #addFilter(FilterElement) | * @see #addFilter(FilterElement) | ||||
| * @see FilterAttribute | |||||
| */ | */ | ||||
| public void setFilters(String filters) { | public void setFilters(String filters) { | ||||
| StringTokenizer st = new StringTokenizer(filters, ","); | StringTokenizer st = new StringTokenizer(filters, ","); | ||||
| @@ -127,7 +127,7 @@ public class FilterStackFormatter extends FilterFormatter { | |||||
| } | } | ||||
| /** | /** | ||||
| * Check whether or not the line should be accepted. | * Check whether or not the line should be accepted. | ||||
| * @param the line to be check for acceptance. | |||||
| * @param line the line to be check for acceptance. | |||||
| * @return <tt>true</tt> if the line is accepted, <tt>false</tt> if not. | * @return <tt>true</tt> if the line is accepted, <tt>false</tt> if not. | ||||
| */ | */ | ||||
| protected boolean accept(String line) { | protected boolean accept(String line) { | ||||
| @@ -211,6 +211,11 @@ public class XMLFormatter extends BaseStreamFormatter { | |||||
| String name = JUnitHelper.getTestName(evt.getName()); | String name = JUnitHelper.getTestName(evt.getName()); | ||||
| test.setAttribute(ATTR_NAME, name); | test.setAttribute(ATTR_NAME, name); | ||||
| String suiteName = JUnitHelper.getSuiteName(evt.getName()); | String suiteName = JUnitHelper.getSuiteName(evt.getName()); | ||||
| if ( !suiteName.equals(lastSuiteElement.getAttribute("name")) ){ | |||||
| throw new BuildException("Received testcase from test " | |||||
| + suiteName + " and was expecting " | |||||
| + lastSuiteElement.getAttribute("name")); | |||||
| } | |||||
| lastSuiteElement.appendChild(test); | lastSuiteElement.appendChild(test); | ||||
| lastTestElement = test; | lastTestElement = test; | ||||
| lastTestEvent = evt; | lastTestEvent = evt; | ||||