From: Evgeny Mandrikov Date: Tue, 6 Nov 2012 15:54:08 +0000 (+0100) Subject: SONAR-3934 Extract sonar-surefire-plugin into Sonar Java X-Git-Tag: 3.4~381 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=888c891faab4146cd47cf2c9da2dc01686f082e8;p=sonarqube.git SONAR-3934 Extract sonar-surefire-plugin into Sonar Java --- diff --git a/plugins/sonar-surefire-plugin/infinitest.args b/plugins/sonar-surefire-plugin/infinitest.args deleted file mode 100644 index ed9f41dadc7..00000000000 --- a/plugins/sonar-surefire-plugin/infinitest.args +++ /dev/null @@ -1 +0,0 @@ --Djava.awt.headless=true \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/pom.xml b/plugins/sonar-surefire-plugin/pom.xml deleted file mode 100644 index 2fdd294d08f..00000000000 --- a/plugins/sonar-surefire-plugin/pom.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - 4.0.0 - - - org.codehaus.sonar - sonar - 3.4-SNAPSHOT - ../.. - - - org.codehaus.sonar.plugins - sonar-surefire-plugin - sonar-plugin - - Sonar :: Plugins :: Surefire - - - - org.codehaus.sonar - sonar-plugin-api - provided - - - org.apache.maven - maven-project - provided - - - - org.codehaus.sonar - sonar-testing-harness - test - - - - - - - ${basedir}/src/main/resources - - - ${basedir}/src/test/resources - - - - - org.codehaus.sonar - sonar-packaging-maven-plugin - - surefire - Surefire - org.sonar.plugins.surefire.SurefirePlugin - - Surefire.]]> - - - - - org.apache.maven.plugins - maven-surefire-plugin - - classes - 3 - true - - - - - diff --git a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/SurefirePlugin.java b/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/SurefirePlugin.java deleted file mode 100644 index b4eb8cc5e5d..00000000000 --- a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/SurefirePlugin.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire; - -import com.google.common.collect.ImmutableList; -import org.sonar.api.CoreProperties; -import org.sonar.api.Properties; -import org.sonar.api.Property; -import org.sonar.api.SonarPlugin; - -import java.util.List; - -@Properties({ - @Property( - key = CoreProperties.SUREFIRE_REPORTS_PATH_PROPERTY, - name = "Report path", - description = "Path (absolute or relative) to XML report files.", - project = true, - global = false) -}) -public final class SurefirePlugin extends SonarPlugin { - - public List> getExtensions() { - return ImmutableList.of(SurefireSensor.class); - } - -} diff --git a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/SurefireSensor.java b/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/SurefireSensor.java deleted file mode 100644 index a6978f5d6a4..00000000000 --- a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/SurefireSensor.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire; - -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.sonar.api.batch.CoverageExtension; -import org.sonar.api.batch.DependsUpon; -import org.sonar.api.batch.Sensor; -import org.sonar.api.batch.SensorContext; -import org.sonar.api.resources.Java; -import org.sonar.api.resources.JavaFile; -import org.sonar.api.resources.Project; -import org.sonar.api.resources.Resource; -import org.sonar.plugins.surefire.api.AbstractSurefireParser; -import org.sonar.plugins.surefire.api.SurefireUtils; - -import java.io.File; - -public class SurefireSensor implements Sensor { - - private static Logger logger = LoggerFactory.getLogger(SurefireSensor.class); - - @DependsUpon - public Class dependsUponCoverageSensors() { - return CoverageExtension.class; - } - - public boolean shouldExecuteOnProject(Project project) { - return project.getAnalysisType().isDynamic(true) && Java.KEY.equals(project.getLanguageKey()); - } - - public void analyse(Project project, SensorContext context) { - File dir = SurefireUtils.getReportsDirectory(project); - collect(project, context, dir); - } - - protected void collect(Project project, SensorContext context, File reportsDir) { - logger.info("parsing {}", reportsDir); - new AbstractSurefireParser() { - @Override - protected Resource getUnitTestResource(String classKey) { - if (!StringUtils.contains(classKey, "$")) { - // temporary hack waiting for http://jira.codehaus.org/browse/SONAR-1865 - return new JavaFile(classKey, true); - } - return null; - } - }.collect(project, context, reportsDir); - } - - @Override - public String toString() { - return getClass().getSimpleName(); - } -} diff --git a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/api/AbstractSurefireParser.java b/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/api/AbstractSurefireParser.java deleted file mode 100644 index 4e6248f024e..00000000000 --- a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/api/AbstractSurefireParser.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.api; - -import java.io.File; -import java.io.FilenameFilter; -import java.util.Map; - -import javax.xml.stream.XMLStreamException; - -import org.apache.commons.lang.StringUtils; -import org.sonar.api.batch.SensorContext; -import org.sonar.api.measures.CoreMetrics; -import org.sonar.api.measures.Measure; -import org.sonar.api.measures.Metric; -import org.sonar.api.resources.Project; -import org.sonar.api.resources.Resource; -import org.sonar.api.utils.ParsingUtils; -import org.sonar.api.utils.SonarException; -import org.sonar.api.utils.StaxParser; -import org.sonar.plugins.surefire.data.SurefireStaxHandler; -import org.sonar.plugins.surefire.data.UnitTestClassReport; -import org.sonar.plugins.surefire.data.UnitTestIndex; - -/** - * @since 2.4 - */ -public abstract class AbstractSurefireParser { - - public void collect(Project project, SensorContext context, File reportsDir) { - File[] xmlFiles = getReports(reportsDir); - - if (xmlFiles.length == 0) { - // See http://jira.codehaus.org/browse/SONAR-2371 - if (project.getModules().isEmpty()) { - context.saveMeasure(CoreMetrics.TESTS, 0.0); - } - } else { - parseFiles(context, xmlFiles); - } - } - - private File[] getReports(File dir) { - if (dir == null || !dir.isDirectory() || !dir.exists()) { - return new File[0]; - } - File[] unitTestResultFiles = findXMLFilesStartingWith(dir, "TEST-"); - if (unitTestResultFiles.length == 0) { - // maybe there's only a test suite result file - unitTestResultFiles = findXMLFilesStartingWith(dir, "TESTS-"); - } - return unitTestResultFiles; - } - - private File[] findXMLFilesStartingWith(File dir, final String fileNameStart) { - return dir.listFiles(new FilenameFilter() { - public boolean accept(File dir, String name) { - return name.startsWith(fileNameStart) && name.endsWith(".xml"); - } - }); - } - - private void parseFiles(SensorContext context, File[] reports) { - UnitTestIndex index = new UnitTestIndex(); - parseFiles(reports, index); - sanitize(index); - save(index, context); - } - - private void parseFiles(File[] reports, UnitTestIndex index) { - SurefireStaxHandler staxParser = new SurefireStaxHandler(index); - StaxParser parser = new StaxParser(staxParser, false); - for (File report : reports) { - try { - parser.parse(report); - } catch (XMLStreamException e) { - throw new SonarException("Fail to parse the Surefire report: " + report, e); - } - } - } - - private void sanitize(UnitTestIndex index) { - for (String classname : index.getClassnames()) { - if (StringUtils.contains(classname, "$")) { - // Surefire reports classes whereas sonar supports files - String parentClassName = StringUtils.substringBefore(classname, "$"); - index.merge(classname, parentClassName); - } - } - } - - private void save(UnitTestIndex index, SensorContext context) { - for (Map.Entry entry : index.getIndexByClassname().entrySet()) { - UnitTestClassReport report = entry.getValue(); - if (report.getTests() > 0) { - Resource resource = getUnitTestResource(entry.getKey()); - double testsCount = report.getTests() - report.getSkipped(); - saveMeasure(context, resource, CoreMetrics.SKIPPED_TESTS, report.getSkipped()); - saveMeasure(context, resource, CoreMetrics.TESTS, testsCount); - saveMeasure(context, resource, CoreMetrics.TEST_ERRORS, report.getErrors()); - saveMeasure(context, resource, CoreMetrics.TEST_FAILURES, report.getFailures()); - saveMeasure(context, resource, CoreMetrics.TEST_EXECUTION_TIME, report.getDurationMilliseconds()); - double passedTests = testsCount - report.getErrors() - report.getFailures(); - if (testsCount > 0) { - double percentage = passedTests * 100d / testsCount; - saveMeasure(context, resource, CoreMetrics.TEST_SUCCESS_DENSITY, ParsingUtils.scaleValue(percentage)); - } - saveResults(context, resource, report); - } - } - } - - private void saveMeasure(SensorContext context, Resource resource, Metric metric, double value) { - if (!Double.isNaN(value)) { - context.saveMeasure(resource, metric, value); - } - } - - private void saveResults(SensorContext context, Resource resource, UnitTestClassReport report) { - context.saveMeasure(resource, new Measure(CoreMetrics.TEST_DATA, report.toXml())); - } - - protected abstract Resource getUnitTestResource(String classKey); - -} diff --git a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/api/SurefireUtils.java b/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/api/SurefireUtils.java deleted file mode 100644 index e5b27a2eda3..00000000000 --- a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/api/SurefireUtils.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.api; - -import org.sonar.api.CoreProperties; -import org.sonar.api.batch.maven.MavenPlugin; -import org.sonar.api.batch.maven.MavenSurefireUtils; -import org.sonar.api.resources.Project; - -import java.io.File; - -/** - * @since 2.4 - */ -public final class SurefireUtils { - - public static File getReportsDirectory(Project project) { - File dir = getReportsDirectoryFromProperty(project); - if (dir == null) { - dir = getReportsDirectoryFromPluginConfiguration(project); - } - if (dir == null) { - dir = getReportsDirectoryFromDefaultConfiguration(project); - } - return dir; - } - - private static File getReportsDirectoryFromProperty(Project project) { - String path = (String) project.getProperty(CoreProperties.SUREFIRE_REPORTS_PATH_PROPERTY); - if (path != null) { - return project.getFileSystem().resolvePath(path); - } - return null; - } - - private static File getReportsDirectoryFromPluginConfiguration(Project project) { - MavenPlugin plugin = MavenPlugin.getPlugin(project.getPom(), MavenSurefireUtils.GROUP_ID, MavenSurefireUtils.ARTIFACT_ID); - if (plugin != null) { - String path = plugin.getParameter("reportsDirectory"); - if (path != null) { - return project.getFileSystem().resolvePath(path); - } - } - return null; - } - - private static File getReportsDirectoryFromDefaultConfiguration(Project project) { - return new File(project.getFileSystem().getBuildDir(), "surefire-reports"); - } - - private SurefireUtils() { - } - -} diff --git a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/SurefireStaxHandler.java b/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/SurefireStaxHandler.java deleted file mode 100644 index fc2ed5ba723..00000000000 --- a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/SurefireStaxHandler.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.data; - -import java.text.ParseException; -import java.util.Locale; - -import javax.xml.stream.XMLStreamException; - -import org.apache.commons.lang.StringUtils; -import org.codehaus.staxmate.in.ElementFilter; -import org.codehaus.staxmate.in.SMEvent; -import org.codehaus.staxmate.in.SMHierarchicCursor; -import org.codehaus.staxmate.in.SMInputCursor; -import org.sonar.api.utils.ParsingUtils; -import org.sonar.api.utils.StaxParser.XmlStreamHandler; - -public class SurefireStaxHandler implements XmlStreamHandler { - - private UnitTestIndex index; - - public SurefireStaxHandler(UnitTestIndex index) { - this.index = index; - } - - public void stream(SMHierarchicCursor rootCursor) throws XMLStreamException { - SMInputCursor testSuite = rootCursor.constructDescendantCursor(new ElementFilter("testsuite")); - SMEvent testSuiteEvent; - while ((testSuiteEvent = testSuite.getNext()) != null) { - if (testSuiteEvent.compareTo(SMEvent.START_ELEMENT) == 0) { - String testSuiteClassName = testSuite.getAttrValue("name"); - if (StringUtils.contains(testSuiteClassName, "$")) { - // test suites for inner classes are ignored - return; - } - SMInputCursor testCase = testSuite.childCursor(new ElementFilter("testcase")); - SMEvent event; - while ((event = testCase.getNext()) != null) { - if (event.compareTo(SMEvent.START_ELEMENT) == 0) { - String testClassName = getClassname(testCase, testSuiteClassName); - UnitTestClassReport classReport = index.index(testClassName); - parseTestCase(testCase, classReport); - } - } - } - } - } - - private String getClassname(SMInputCursor testCaseCursor, String defaultClassname) throws XMLStreamException { - String testClassName = testCaseCursor.getAttrValue("classname"); - return StringUtils.defaultIfBlank(testClassName, defaultClassname); - } - - private void parseTestCase(SMInputCursor testCaseCursor, UnitTestClassReport report) throws XMLStreamException { - report.add(parseTestResult(testCaseCursor)); - } - - private void setStackAndMessage(UnitTestResult result, SMInputCursor stackAndMessageCursor) throws XMLStreamException { - result.setMessage(stackAndMessageCursor.getAttrValue("message")); - String stack = stackAndMessageCursor.collectDescendantText(); - result.setStackTrace(stack); - } - - private UnitTestResult parseTestResult(SMInputCursor testCaseCursor) throws XMLStreamException { - UnitTestResult detail = new UnitTestResult(); - String name = getTestCaseName(testCaseCursor); - detail.setName(name); - - String status = UnitTestResult.STATUS_OK; - long duration = getTimeAttributeInMS(testCaseCursor); - - SMInputCursor childNode = testCaseCursor.descendantElementCursor(); - if (childNode.getNext() != null) { - String elementName = childNode.getLocalName(); - if ("skipped".equals(elementName)) { - status = UnitTestResult.STATUS_SKIPPED; - // bug with surefire reporting wrong time for skipped tests - duration = 0L; - - } else if ("failure".equals(elementName)) { - status = UnitTestResult.STATUS_FAILURE; - setStackAndMessage(detail, childNode); - - } else if ("error".equals(elementName)) { - status = UnitTestResult.STATUS_ERROR; - setStackAndMessage(detail, childNode); - } - } - while (childNode.getNext() != null) { - // make sure we loop till the end of the elements cursor - } - detail.setDurationMilliseconds(duration); - detail.setStatus(status); - return detail; - } - - private long getTimeAttributeInMS(SMInputCursor testCaseCursor) throws XMLStreamException { - // hardcoded to Locale.ENGLISH see http://jira.codehaus.org/browse/SONAR-602 - try { - Double time = ParsingUtils.parseNumber(testCaseCursor.getAttrValue("time"), Locale.ENGLISH); - return !Double.isNaN(time) ? new Double(ParsingUtils.scaleValue(time * 1000, 3)).longValue() : 0L; - } catch (ParseException e) { - throw new XMLStreamException(e); - } - } - - private String getTestCaseName(SMInputCursor testCaseCursor) throws XMLStreamException { - String classname = testCaseCursor.getAttrValue("classname"); - String name = testCaseCursor.getAttrValue("name"); - if (StringUtils.contains(classname, "$")) { - return StringUtils.substringAfter(classname, "$") + "/" + name; - } - return name; - } - -} diff --git a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/UnitTestClassReport.java b/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/UnitTestClassReport.java deleted file mode 100644 index b271addd76e..00000000000 --- a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/UnitTestClassReport.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.data; - -import com.google.common.collect.Lists; - -import java.util.Collections; -import java.util.List; - -public final class UnitTestClassReport { - private long errors = 0L, failures = 0L, skipped = 0L, tests = 0L, durationMilliseconds = 0L; - private List results = null; - - public UnitTestClassReport add(UnitTestClassReport other) { - for (UnitTestResult otherResult : other.getResults()) { - add(otherResult); - } - return this; - } - - public UnitTestClassReport add(UnitTestResult result) { - initResults(); - results.add(result); - if (result.getStatus().equals(UnitTestResult.STATUS_SKIPPED)) { - skipped += 1; - - } else if (result.getStatus().equals(UnitTestResult.STATUS_FAILURE)) { - failures += 1; - - } else if (result.getStatus().equals(UnitTestResult.STATUS_ERROR)) { - errors += 1; - } - tests += 1; - durationMilliseconds += result.getDurationMilliseconds(); - return this; - } - - private void initResults() { - if (results == null) { - results = Lists.newArrayList(); - } - } - - public long getErrors() { - return errors; - } - - public long getFailures() { - return failures; - } - - public long getSkipped() { - return skipped; - } - - public long getTests() { - return tests; - } - - public long getDurationMilliseconds() { - return durationMilliseconds; - } - - public List getResults() { - if (results==null) { - return Collections.emptyList(); - } - return results; - } - - public String toXml() { - StringBuilder sb = new StringBuilder(256); - sb.append(""); - for (UnitTestResult result : results) { - result.appendXml(sb); - } - sb.append(""); - return sb.toString(); - } -} diff --git a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/UnitTestIndex.java b/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/UnitTestIndex.java deleted file mode 100644 index de5d45d2b6f..00000000000 --- a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/UnitTestIndex.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.data; - -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; - -import java.util.*; - -/** - * @since 2.8 - */ -public class UnitTestIndex { - - private Map indexByClassname; - - public UnitTestIndex() { - this.indexByClassname = Maps.newHashMap(); - } - - public UnitTestClassReport index(String classname) { - UnitTestClassReport classReport = indexByClassname.get(classname); - if (classReport == null) { - classReport = new UnitTestClassReport(); - indexByClassname.put(classname, classReport); - } - return classReport; - } - - public UnitTestClassReport get(String classname) { - return indexByClassname.get(classname); - } - - public Set getClassnames() { - return Sets.newHashSet(indexByClassname.keySet()); - } - - public Map getIndexByClassname() { - return indexByClassname; - } - - public int size() { - return indexByClassname.size(); - } - - public UnitTestClassReport merge(String classname, String intoClassname) { - UnitTestClassReport from = indexByClassname.get(classname); - if (from!=null) { - UnitTestClassReport to = index(intoClassname); - to.add(from); - indexByClassname.remove(classname); - return to; - } - return null; - } - - public void remove(String classname) { - indexByClassname.remove(classname); - } - - -} diff --git a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/UnitTestResult.java b/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/UnitTestResult.java deleted file mode 100644 index 17b8f8a26f2..00000000000 --- a/plugins/sonar-surefire-plugin/src/main/java/org/sonar/plugins/surefire/data/UnitTestResult.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.data; - -import org.apache.commons.lang.StringEscapeUtils; - -public final class UnitTestResult { - public static final String STATUS_OK = "ok"; - public static final String STATUS_ERROR = "error"; - public static final String STATUS_FAILURE = "failure"; - public static final String STATUS_SKIPPED = "skipped"; - - private String name, status, stackTrace, message; - private long durationMilliseconds = 0L; - - public String getName() { - return name; - } - - public UnitTestResult setName(String name) { - this.name = name; - return this; - } - - public String getStatus() { - return status; - } - - public UnitTestResult setStatus(String status) { - this.status = status; - return this; - } - - public UnitTestResult setStackTrace(String stackTrace) { - this.stackTrace = stackTrace; - return this; - } - - public String getMessage() { - return message; - } - - public UnitTestResult setMessage(String message) { - this.message = message; - return this; - } - - public long getDurationMilliseconds() { - return durationMilliseconds; - } - - public UnitTestResult setDurationMilliseconds(long l) { - this.durationMilliseconds = l; - return this; - } - - public boolean isErrorOrFailure() { - return STATUS_ERROR.equals(status) || STATUS_FAILURE.equals(status); - } - - public boolean isError() { - return STATUS_ERROR.equals(status); - } - - public String toXml() { - StringBuilder sb = new StringBuilder(); - return appendXml(sb).toString(); - } - public StringBuilder appendXml(StringBuilder sb) { - sb - .append("") - .append(isError() ? "") - .append("") - .append(isError() ? "" : "") - .append(""); - } else { - sb.append("/>"); - } - return sb; - } - -} diff --git a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/SurefirePluginTest.java b/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/SurefirePluginTest.java deleted file mode 100644 index 3df14f0b9ce..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/SurefirePluginTest.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire; - -import org.junit.Test; - -import static org.hamcrest.Matchers.greaterThan; -import static org.junit.Assert.assertThat; - -public class SurefirePluginTest { - - @Test - public void shouldGetExtensions() { - assertThat(new SurefirePlugin().getExtensions().size(), greaterThan(0)); - } -} diff --git a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/SurefireSensorTest.java b/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/SurefireSensorTest.java deleted file mode 100644 index e641d4a38b8..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/SurefireSensorTest.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire; - -import org.apache.commons.lang.ObjectUtils; -import org.custommonkey.xmlunit.DetailedDiff; -import org.custommonkey.xmlunit.Diff; -import org.custommonkey.xmlunit.XMLUnit; -import org.hamcrest.BaseMatcher; -import org.hamcrest.Description; -import org.junit.Test; -import org.sonar.api.batch.SensorContext; -import org.sonar.api.measures.CoreMetrics; -import org.sonar.api.measures.Measure; -import org.sonar.api.measures.Metric; -import org.sonar.api.resources.Java; -import org.sonar.api.resources.JavaFile; -import org.sonar.api.resources.Project; -import org.sonar.api.resources.Qualifiers; -import org.sonar.api.resources.Resource; -import org.sonar.api.resources.Scopes; -import org.sonar.api.test.IsMeasure; -import org.sonar.api.test.IsResource; -import org.sonar.api.test.MavenTestUtils; - -import java.io.File; -import java.io.FileReader; -import java.io.StringReader; -import java.net.URISyntaxException; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyDouble; -import static org.mockito.Matchers.argThat; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -public class SurefireSensorTest { - - @Test - public void shouldNotAnalyseIfStaticAnalysis() { - Project project = mock(Project.class); - when(project.getLanguageKey()).thenReturn(Java.KEY); - when(project.getAnalysisType()).thenReturn(Project.AnalysisType.STATIC); - assertFalse(new SurefireSensor().shouldExecuteOnProject(project)); - } - - @Test - public void shouldAnalyseIfReuseDynamicReports() { - Project project = mock(Project.class); - when(project.getLanguageKey()).thenReturn(Java.KEY); - when(project.getAnalysisType()).thenReturn(Project.AnalysisType.REUSE_REPORTS); - assertThat(new SurefireSensor().shouldExecuteOnProject(project), is(true)); - } - - @Test - public void shouldNotFailIfReportsNotFound() { - Project project = MavenTestUtils.loadProjectFromPom(getClass(), "shouldNotFailIfReportsNotFound/pom.xml"); - new SurefireSensor().collect(project, mock(SensorContext.class), new File("unknown")); - } - - private SensorContext mockContext() { - SensorContext context = mock(SensorContext.class); - when(context.isIndexed(any(Resource.class), eq(false))).thenReturn(true); - return context; - } - - @Test - public void shouldHandleTestSuiteDetails() throws URISyntaxException { - SensorContext context = mockContext(); - new SurefireSensor().collect(new Project("key"), context, new File(getClass().getResource( - "/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/").toURI())); - - // 3 classes, 6 measures by class - verify(context, times(3)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.UNIT_TEST_FILE)), - eq(CoreMetrics.SKIPPED_TESTS), anyDouble()); - verify(context, times(3)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.UNIT_TEST_FILE)), - eq(CoreMetrics.TESTS), anyDouble()); - verify(context, times(18)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.UNIT_TEST_FILE)), - any(Metric.class), anyDouble()); - verify(context, times(3)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.UNIT_TEST_FILE)), - argThat(new IsMeasure(CoreMetrics.TEST_DATA))); - - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest", true)), eq(CoreMetrics.TESTS), eq(4d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest", true)), eq(CoreMetrics.TEST_EXECUTION_TIME), - eq(111d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest", true)), eq(CoreMetrics.TEST_FAILURES), eq(1d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest", true)), eq(CoreMetrics.TEST_ERRORS), eq(1d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest", true)), eq(CoreMetrics.SKIPPED_TESTS), eq(0d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest", true)), - argThat(getTestDetailsMatcher("shouldHandleTestSuiteDetails/ExtensionsFinderTest-expected-result.xml"))); - - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest2", true)), eq(CoreMetrics.TESTS), eq(2d)); - verify(context) - .saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest2", true)), eq(CoreMetrics.TEST_EXECUTION_TIME), eq(2d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest2", true)), eq(CoreMetrics.TEST_FAILURES), eq(0d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest2", true)), eq(CoreMetrics.TEST_ERRORS), eq(0d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest2", true)), eq(CoreMetrics.SKIPPED_TESTS), eq(0d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest2", true)), - argThat(getTestDetailsMatcher("shouldHandleTestSuiteDetails/ExtensionsFinderTest2-expected-result.xml"))); - - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest3", true)), eq(CoreMetrics.TESTS), eq(1d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest3", true)), eq(CoreMetrics.TEST_EXECUTION_TIME), - eq(16d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest3", true)), eq(CoreMetrics.TEST_FAILURES), eq(0d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest3", true)), eq(CoreMetrics.TEST_ERRORS), eq(0d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest3", true)), eq(CoreMetrics.SKIPPED_TESTS), eq(1d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest3", true)), - argThat(getTestDetailsMatcher("shouldHandleTestSuiteDetails/ExtensionsFinderTest3-expected-result.xml"))); - } - - @Test - public void shouldSaveErrorsAndFailuresInXML() throws URISyntaxException { - SensorContext context = mockContext(); - new SurefireSensor().collect(new Project("key"), context, new File(getClass().getResource( - "/org/sonar/plugins/surefire/SurefireSensorTest/shouldSaveErrorsAndFailuresInXML/").toURI())); - - // 1 classes, 6 measures by class - verify(context, times(1)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.UNIT_TEST_FILE)), - eq(CoreMetrics.SKIPPED_TESTS), anyDouble()); - - verify(context, times(1)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.UNIT_TEST_FILE)), - eq(CoreMetrics.TESTS), anyDouble()); - verify(context, times(6)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.UNIT_TEST_FILE)), - any(Metric.class), anyDouble()); - verify(context, times(1)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.UNIT_TEST_FILE)), - argThat(new IsMeasure(CoreMetrics.TEST_DATA))); - - verify(context).saveMeasure(eq(new JavaFile("org.sonar.core.ExtensionsFinderTest", true)), - argThat(getTestDetailsMatcher("shouldSaveErrorsAndFailuresInXML/expected-test-details.xml"))); - } - - @Test - public void shouldManageClassesWithDefaultPackage() throws URISyntaxException { - SensorContext context = mockContext(); - new SurefireSensor().collect(new Project("key"), context, new File(getClass().getResource( - "/org/sonar/plugins/surefire/SurefireSensorTest/shouldManageClassesWithDefaultPackage/").toURI())); - - verify(context).saveMeasure(new JavaFile("NoPackagesTest", true), CoreMetrics.TESTS, 2d); - } - - @Test - public void successRatioIsZeroWhenAllTestsFail() throws URISyntaxException { - SensorContext context = mockContext(); - new SurefireSensor().collect(new Project("key"), context, new File(getClass().getResource( - "/org/sonar/plugins/surefire/SurefireSensorTest/successRatioIsZeroWhenAllTestsFail/").toURI())); - - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.TESTS), eq(2d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.TEST_FAILURES), eq(1d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.TEST_ERRORS), eq(1d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.TEST_SUCCESS_DENSITY), eq(0d)); - } - - @Test - public void measuresShouldNotIncludeSkippedTests() throws URISyntaxException { - SensorContext context = mockContext(); - new SurefireSensor().collect(new Project("key"), context, new File(getClass().getResource( - "/org/sonar/plugins/surefire/SurefireSensorTest/measuresShouldNotIncludeSkippedTests/").toURI())); - - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.TESTS), eq(2d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.TEST_FAILURES), eq(1d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.TEST_ERRORS), eq(0d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.SKIPPED_TESTS), eq(1d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.TEST_SUCCESS_DENSITY), eq(50d)); - } - - @Test - public void noSuccessRatioIfNoTests() throws URISyntaxException { - SensorContext context = mockContext(); - new SurefireSensor().collect(new Project("key"), context, new File(getClass().getResource( - "/org/sonar/plugins/surefire/SurefireSensorTest/noSuccessRatioIfNoTests/").toURI())); - - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.TESTS), eq(0d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.TEST_FAILURES), eq(0d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.TEST_ERRORS), eq(0d)); - verify(context).saveMeasure(eq(new JavaFile("org.sonar.Foo", true)), eq(CoreMetrics.SKIPPED_TESTS), eq(2d)); - verify(context, never()).saveMeasure(eq(new JavaFile("org.sonar.Foo")), eq(CoreMetrics.TEST_SUCCESS_DENSITY), anyDouble()); - } - - @Test - public void ignoreSuiteAsInnerClass() throws URISyntaxException { - SensorContext context = mockContext(); - new SurefireSensor().collect(new Project("key"), context, new File(getClass().getResource( - "/org/sonar/plugins/surefire/SurefireSensorTest/ignoreSuiteAsInnerClass/").toURI())); - - // ignore TestHandler$Input.xml - verify(context).saveMeasure(eq(new JavaFile("org.apache.shindig.protocol.TestHandler")), eq(CoreMetrics.TESTS), eq(0.0)); - verify(context).saveMeasure(eq(new JavaFile("org.apache.shindig.protocol.TestHandler")), eq(CoreMetrics.SKIPPED_TESTS), eq(1.0)); - } - - private BaseMatcher getTestDetailsMatcher(final String xmlBaseFile) { - return new BaseMatcher() { - - private Diff diff; - - public boolean matches(Object obj) { - try { - if (!ObjectUtils.equals(CoreMetrics.TEST_DATA, ((Measure) obj).getMetric())) { - return false; - } - - File expectedXML = new File(getClass().getResource("/org/sonar/plugins/surefire/SurefireSensorTest/" + xmlBaseFile).toURI()); - XMLUnit.setIgnoreWhitespace(true); - XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); - XMLUnit.setNormalize(true); - XMLUnit.setNormalizeWhitespace(true); - diff = XMLUnit.compareXML(new FileReader(expectedXML), new StringReader(((Measure) obj).getData())); - return diff.similar(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - public void describeTo(Description d) { - DetailedDiff dd = new DetailedDiff(diff); - d.appendText("XML differences in " + xmlBaseFile + ": " + dd.getAllDifferences()); - } - }; - } -} diff --git a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/api/AbstractSurefireParserTest.java b/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/api/AbstractSurefireParserTest.java deleted file mode 100644 index 7853b8d76b5..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/api/AbstractSurefireParserTest.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.api; - -import org.junit.Test; -import org.mockito.ArgumentMatcher; -import org.sonar.api.batch.SensorContext; -import org.sonar.api.measures.CoreMetrics; -import org.sonar.api.measures.Metric; -import org.sonar.api.resources.File; -import org.sonar.api.resources.Project; -import org.sonar.api.resources.Qualifiers; -import org.sonar.api.resources.Resource; -import org.sonar.api.resources.Scopes; -import org.sonar.api.test.IsMeasure; -import org.sonar.api.test.IsResource; - -import java.net.URISyntaxException; -import java.util.Arrays; - -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.anyDouble; -import static org.mockito.Matchers.argThat; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -public class AbstractSurefireParserTest { - - @Test - public void shouldAggregateReports() throws URISyntaxException { - AbstractSurefireParser parser = newParser(); - SensorContext context = mockContext(); - - parser.collect(new Project("foo"), context, getDir("multipleReports")); - - // Only 6 tests measures should be stored, no more: the TESTS-AllTests.xml must not be read as there's 1 file result per unit test - // (SONAR-2841). - verify(context, times(6)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.FILE)), eq(CoreMetrics.TESTS), anyDouble()); - verify(context, times(6)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.FILE)), eq(CoreMetrics.TEST_ERRORS), anyDouble()); - verify(context, times(6)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.FILE)), argThat(new IsMeasure(CoreMetrics.TEST_DATA))); - } - - // SONAR-2841: if there's only a test suite report, then it should be read. - @Test - public void shouldUseTestSuiteReportIfAlone() throws URISyntaxException { - AbstractSurefireParser parser = newParser(); - SensorContext context = mockContext(); - - parser.collect(new Project("foo"), context, getDir("onlyTestSuiteReport")); - - verify(context, times(2)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.FILE)), eq(CoreMetrics.TESTS), anyDouble()); - verify(context, times(2)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.FILE)), eq(CoreMetrics.TEST_ERRORS), anyDouble()); - verify(context, times(2)).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.FILE)), argThat(new IsMeasure(CoreMetrics.TEST_DATA))); - } - - /** - * See http://jira.codehaus.org/browse/SONAR-2371 - */ - @Test - public void shouldInsertZeroWhenNoReports() throws URISyntaxException { - AbstractSurefireParser parser = newParser(); - SensorContext context = mockContext(); - Project project = mock(Project.class); - - parser.collect(project, context, getDir("noReports")); - - verify(context).saveMeasure(CoreMetrics.TESTS, 0.0); - } - - /** - * See http://jira.codehaus.org/browse/SONAR-2371 - */ - @Test - public void shouldNotInsertZeroWhenNoReports() throws URISyntaxException { - AbstractSurefireParser parser = newParser(); - SensorContext context = mockContext(); - Project project = mock(Project.class); - when(project.getModules()).thenReturn(Arrays.asList(new Project("foo"))); - - parser.collect(project, context, getDir("noReports")); - - verify(context, never()).saveMeasure(CoreMetrics.TESTS, 0.0); - } - - @Test - public void shouldNotInsertZeroOnFiles() throws URISyntaxException { - AbstractSurefireParser parser = newParser(); - SensorContext context = mockContext(); - - parser.collect(new Project("foo"), context, getDir("noTests")); - - verify(context, never()).saveMeasure(any(Resource.class), any(Metric.class), anyDouble()); - } - - @Test - public void shouldMergeInnerClasses() throws URISyntaxException { - AbstractSurefireParser parser = newParser(); - - SensorContext context = mock(SensorContext.class); - when(context.isIndexed(argThat(new ArgumentMatcher() { - @Override - public boolean matches(Object o) { - return !((Resource) o).getName().contains("$"); - } - }), eq(false))).thenReturn(true); - - parser.collect(new Project("foo"), context, getDir("innerClasses")); - - verify(context) - .saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.FILE, "org.apache.commons.collections.bidimap.AbstractTestBidiMap")), eq(CoreMetrics.TESTS), eq(7.0)); - verify(context).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.FILE, "org.apache.commons.collections.bidimap.AbstractTestBidiMap")), eq(CoreMetrics.TEST_ERRORS), - eq(1.0)); - verify(context, never()).saveMeasure(argThat(new IsResource(Scopes.FILE, Qualifiers.FILE, "org.apache.commons.collections.bidimap.AbstractTestBidiMap$TestBidiMapEntrySet")), - any(Metric.class), anyDouble()); - } - - @Test - public void shouldMergeNestedInnerClasses() throws URISyntaxException { - AbstractSurefireParser parser = newParser(); - - SensorContext context = mockContext(); - parser.collect(new Project("foo"), context, getDir("nestedInnerClasses")); - - verify(context).saveMeasure( - argThat(new IsResource(Scopes.FILE, Qualifiers.FILE, "org.sonar.plugins.surefire.NestedInnerTest")), - eq(CoreMetrics.TESTS), - eq(3.0)); - } - - private AbstractSurefireParser newParser() { - return new AbstractSurefireParser() { - @Override - protected Resource getUnitTestResource(String classKey) { - return new File(classKey); - } - }; - } - - private java.io.File getDir(String dirname) throws URISyntaxException { - return new java.io.File(getClass().getResource("/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/" + dirname).toURI()); - } - - private SensorContext mockContext() { - SensorContext context = mock(SensorContext.class); - when(context.isIndexed(any(Resource.class), eq(false))).thenReturn(true); - return context; - } -} diff --git a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/api/SurefireUtilsTest.java b/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/api/SurefireUtilsTest.java deleted file mode 100644 index 0be6b989efa..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/api/SurefireUtilsTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.api; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - -import org.junit.Test; -import org.sonar.api.resources.Project; -import org.sonar.api.test.MavenTestUtils; - -public class SurefireUtilsTest { - - @Test - public void shouldGetReportsFromProperty() { - Project project = MavenTestUtils.loadProjectFromPom(getClass(), "shouldGetReportsFromProperty/pom.xml"); - assertThat(SurefireUtils.getReportsDirectory(project).exists(), is(true)); - assertThat(SurefireUtils.getReportsDirectory(project).isDirectory(), is(true)); - } - - @Test - public void shouldGetReportsFromPluginConfiguration() { - Project project = MavenTestUtils.loadProjectFromPom(getClass(), "shouldGetReportsFromPluginConfiguration/pom.xml"); - assertThat(SurefireUtils.getReportsDirectory(project).exists(), is(true)); - assertThat(SurefireUtils.getReportsDirectory(project).isDirectory(), is(true)); - } - -} diff --git a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest.java b/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest.java deleted file mode 100644 index e99590d2712..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.data; - -import org.junit.Before; -import org.junit.Test; -import org.sonar.api.utils.StaxParser; -import org.sonar.test.TestUtils; - -import javax.xml.stream.XMLStreamException; -import java.io.File; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.Matchers.startsWith; -import static org.junit.Assert.assertThat; - -public class SurefireStaxHandlerTest { - - private UnitTestIndex index; - - @Before - public void setUp() { - index = new UnitTestIndex(); - } - - @Test - public void shouldLoadInnerClasses() throws XMLStreamException { - parse("innerClasses.xml"); - - UnitTestClassReport publicClass = index.get("org.apache.commons.collections.bidimap.AbstractTestBidiMap"); - assertThat(publicClass.getTests(), is(2L)); - - UnitTestClassReport innerClass1 = index.get("org.apache.commons.collections.bidimap.AbstractTestBidiMap$TestBidiMapEntrySet"); - assertThat(innerClass1.getTests(), is(2L)); - - UnitTestClassReport innerClass2 = index.get("org.apache.commons.collections.bidimap.AbstractTestBidiMap$TestInverseBidiMap"); - assertThat(innerClass2.getTests(), is(3L)); - assertThat(innerClass2.getDurationMilliseconds(), is(30 + 1L)); - assertThat(innerClass2.getErrors(), is(1L)); - } - - @Test - public void shouldSuiteAsInnerClass() throws XMLStreamException { - parse("suiteInnerClass.xml"); - assertThat(index.size(), is(0)); - } - - @Test - public void shouldHaveSkippedTests() throws XMLStreamException { - parse("skippedTests.xml"); - UnitTestClassReport report = index.get("org.sonar.Foo"); - assertThat(report.getTests(), is(3L)); - assertThat(report.getSkipped(), is(1L)); - } - - @Test - public void shouldHaveZeroTests() throws XMLStreamException { - parse("zeroTests.xml"); - assertThat(index.size(), is(0)); - } - - @Test - public void shouldHaveTestOnRootPackage() throws XMLStreamException { - parse("rootPackage.xml"); - assertThat(index.size(), is(1)); - UnitTestClassReport report = index.get("NoPackagesTest"); - assertThat(report.getTests(), is(2L)); - } - - @Test - public void shouldHaveErrorsAndFailures() throws XMLStreamException { - parse("errorsAndFailures.xml"); - UnitTestClassReport report = index.get("org.sonar.Foo"); - assertThat(report.getErrors(), is(1L)); - assertThat(report.getFailures(), is(1L)); - assertThat(report.getResults().size(), is(2)); - - // failure - UnitTestResult failure = report.getResults().get(0); - assertThat(failure.getDurationMilliseconds(), is(5L)); - assertThat(failure.getStatus(), is(UnitTestResult.STATUS_FAILURE)); - assertThat(failure.getName(), is("testOne")); - assertThat(failure.getMessage(), startsWith("expected")); - - // error - UnitTestResult error = report.getResults().get(1); - assertThat(error.getDurationMilliseconds(), is(0L)); - assertThat(error.getStatus(), is(UnitTestResult.STATUS_ERROR)); - assertThat(error.getName(), is("testTwo")); - } - - @Test - public void shouldSupportMultipleSuitesInSameReport() throws XMLStreamException { - parse("multipleSuites.xml"); - - assertThat(index.get("org.sonar.JavaNCSSCollectorTest").getTests(), is(11L)); - assertThat(index.get("org.sonar.SecondTest").getTests(), is(4L)); - } - - private void parse(String path) throws XMLStreamException { - File xml = TestUtils.getResource(getClass(), path); - SurefireStaxHandler staxParser = new SurefireStaxHandler(index); - StaxParser parser = new StaxParser(staxParser, false); - parser.parse(xml); - } -} diff --git a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/UnitTestClassReportTest.java b/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/UnitTestClassReportTest.java deleted file mode 100644 index ecc845de074..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/UnitTestClassReportTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.data; - -import org.junit.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - -public class UnitTestClassReportTest { - @Test - public void shouldExportToXml() { - UnitTestClassReport report = new UnitTestClassReport(); - report.add(new UnitTestResult().setStatus(UnitTestResult.STATUS_ERROR).setDurationMilliseconds(500L)); - report.add(new UnitTestResult().setStatus(UnitTestResult.STATUS_OK).setDurationMilliseconds(200L)); - - String xml = report.toXml(); - - assertThat(xml, is("")); - } - - @Test - public void shouldIncrementCounters() { - UnitTestClassReport report = new UnitTestClassReport(); - report.add(new UnitTestResult().setStatus(UnitTestResult.STATUS_ERROR).setDurationMilliseconds(500L)); - report.add(new UnitTestResult().setStatus(UnitTestResult.STATUS_OK).setDurationMilliseconds(200L)); - report.add(new UnitTestResult().setStatus(UnitTestResult.STATUS_SKIPPED)); - - assertThat(report.getResults().size(), is(3)); - assertThat(report.getSkipped(), is(1L)); - assertThat(report.getTests(), is(3L)); - assertThat(report.getDurationMilliseconds(), is(500L + 200L)); - assertThat(report.getErrors(), is(1L)); - assertThat(report.getFailures(), is(0L)); - } - - @Test - public void shouldHaveEmptyReport() { - UnitTestClassReport report = new UnitTestClassReport(); - assertThat(report.getResults().size(), is(0)); - assertThat(report.getSkipped(), is(0L)); - assertThat(report.getTests(), is(0L)); - assertThat(report.getDurationMilliseconds(), is(0L)); - assertThat(report.getErrors(), is(0L)); - assertThat(report.getFailures(), is(0L)); - } -} diff --git a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/UnitTestIndexTest.java b/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/UnitTestIndexTest.java deleted file mode 100644 index 3ca1ce7332a..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/UnitTestIndexTest.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.data; - -import org.junit.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.Assert.assertSame; - -public class UnitTestIndexTest { - - @Test - public void shouldIndexNewClassname() { - UnitTestIndex index = new UnitTestIndex(); - - UnitTestClassReport report = index.index("org.sonar.Foo"); - - assertThat(report.getTests(), is(0L)); - assertThat(index.size(), is(1)); - assertSame(index.get("org.sonar.Foo"), report); - } - - @Test - public void shouldNotReIndex() { - UnitTestIndex index = new UnitTestIndex(); - - UnitTestClassReport report1 = index.index("org.sonar.Foo"); - UnitTestClassReport report2 = index.index("org.sonar.Foo"); - - assertSame(report1, report2); - assertThat(report1.getTests(), is(0L)); - assertThat(index.size(), is(1)); - assertSame(index.get("org.sonar.Foo"), report1); - } - - @Test - public void shouldRemoveClassname() { - UnitTestIndex index = new UnitTestIndex(); - - index.index("org.sonar.Foo"); - index.remove("org.sonar.Foo"); - - assertThat(index.size(), is(0)); - assertThat(index.get("org.sonar.Foo"), nullValue()); - } - - @Test - public void shouldMergeClasses() { - UnitTestIndex index = new UnitTestIndex(); - UnitTestClassReport innerClass = index.index("org.sonar.Foo$Bar"); - innerClass.add(new UnitTestResult().setStatus(UnitTestResult.STATUS_ERROR).setDurationMilliseconds(500L)); - innerClass.add(new UnitTestResult().setStatus(UnitTestResult.STATUS_OK).setDurationMilliseconds(200L)); - UnitTestClassReport publicClass = index.index("org.sonar.Foo"); - publicClass.add(new UnitTestResult().setStatus(UnitTestResult.STATUS_ERROR).setDurationMilliseconds(1000L)); - publicClass.add(new UnitTestResult().setStatus(UnitTestResult.STATUS_FAILURE).setDurationMilliseconds(350L)); - - index.merge("org.sonar.Foo$Bar", "org.sonar.Foo"); - - assertThat(index.size(), is(1)); - UnitTestClassReport report = index.get("org.sonar.Foo"); - assertThat(report.getTests(), is(4L)); - assertThat(report.getFailures(), is(1L)); - assertThat(report.getErrors(), is(2L)); - assertThat(report.getSkipped(), is(0L)); - assertThat(report.getResults().size(), is(4)); - assertThat(report.getDurationMilliseconds(), is(500L + 200L + 1000L + 350L)); - } - - @Test - public void shouldRenameClassWhenMergingToNewClass() { - UnitTestIndex index = new UnitTestIndex(); - UnitTestClassReport innerClass = index.index("org.sonar.Foo$Bar"); - innerClass.add(new UnitTestResult().setStatus(UnitTestResult.STATUS_ERROR).setDurationMilliseconds(500L)); - innerClass.add(new UnitTestResult().setStatus(UnitTestResult.STATUS_OK).setDurationMilliseconds(200L)); - - index.merge("org.sonar.Foo$Bar", "org.sonar.Foo"); - - assertThat(index.size(), is(1)); - UnitTestClassReport report = index.get("org.sonar.Foo"); - assertThat(report.getTests(), is(2L)); - assertThat(report.getFailures(), is(0L)); - assertThat(report.getErrors(), is(1L)); - assertThat(report.getSkipped(), is(0L)); - assertThat(report.getResults().size(), is(2)); - assertThat(report.getDurationMilliseconds(), is(500L + 200L)); - } - - @Test - public void shouldNotFailWhenMergingUnknownClass() { - UnitTestIndex index = new UnitTestIndex(); - - index.merge("org.sonar.Foo$Bar", "org.sonar.Foo"); - - assertThat(index.size(), is(0)); - } -} diff --git a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/UnitTestResultTest.java b/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/UnitTestResultTest.java deleted file mode 100644 index d99027631ee..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/java/org/sonar/plugins/surefire/data/UnitTestResultTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Sonar, open source software quality management tool. - * Copyright (C) 2008-2012 SonarSource - * mailto:contact AT sonarsource DOT com - * - * Sonar is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * Sonar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with Sonar; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 - */ -package org.sonar.plugins.surefire.data; - -import org.junit.Test; - -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; - -public class UnitTestResultTest { - - @Test - public void shouldBeError() { - UnitTestResult result = new UnitTestResult().setStatus(UnitTestResult.STATUS_ERROR); - assertThat(result.getStatus(), is(UnitTestResult.STATUS_ERROR)); - assertThat(result.isError(), is(true)); - assertThat(result.isErrorOrFailure(), is(true)); - } - - @Test - public void shouldBeFailure() { - UnitTestResult result = new UnitTestResult().setStatus(UnitTestResult.STATUS_FAILURE); - assertThat(result.getStatus(), is(UnitTestResult.STATUS_FAILURE)); - assertThat(result.isError(), is(false)); - assertThat(result.isErrorOrFailure(), is(true)); - } - - @Test - public void shouldBeSuccess() { - UnitTestResult result = new UnitTestResult().setStatus(UnitTestResult.STATUS_OK); - assertThat(result.getStatus(), is(UnitTestResult.STATUS_OK)); - assertThat(result.isError(), is(false)); - assertThat(result.isErrorOrFailure(), is(false)); - } - - @Test - public void shouldExportSuccessToXml() { - UnitTestResult result = new UnitTestResult().setStatus(UnitTestResult.STATUS_OK); - result.setDurationMilliseconds(520L); - result.setName("testOne"); - - assertThat(result.toXml(), is("")); - } - - @Test - public void shouldExportErrorToXml() { - UnitTestResult result = new UnitTestResult().setStatus(UnitTestResult.STATUS_ERROR); - result.setDurationMilliseconds(580L); - result.setName("testOne"); - result.setStackTrace("java.lang.RuntimeException"); - result.setMessage("expected xxx"); - - assertThat(result.toXml(), is("")); - } -} diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/doNotSaveInnerClasses/TEST-org.apache.commons.collections.TestAllPackages.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/doNotSaveInnerClasses/TEST-org.apache.commons.collections.TestAllPackages.xml deleted file mode 100644 index e3f5933ba48..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/doNotSaveInnerClasses/TEST-org.apache.commons.collections.TestAllPackages.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - java.io.InvalidClassException: - org.apache.commons.collections.FastArrayList; - local class incompatible: stream classdesc serialVersionUID = 1566341225434603896, local class serialVersionUID = - 7918928878747177577 - at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562) - at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583) - at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) - at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732) - at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) - at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) - at org.apache.commons.collections.AbstractTestObject.readExternalFormFromStream(AbstractTestObject.java:326) - at org.apache.commons.collections.AbstractTestObject.readExternalFormFromDisk(AbstractTestObject.java:301) - at org.apache.commons.collections.list.AbstractTestList.testEmptyListCompatibility(AbstractTestList.java:1077) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:597) - at junit.framework.TestCase.runTest(TestCase.java:154) - at junit.framework.TestCase.runBare(TestCase.java:127) - at junit.framework.TestResult$1.protect(TestResult.java:106) - at junit.framework.TestResult.runProtected(TestResult.java:124) - at junit.framework.TestResult.run(TestResult.java:109) - at junit.framework.TestCase.run(TestCase.java:118) - at junit.framework.TestSuite.runTest(TestSuite.java:208) - at junit.framework.TestSuite.run(TestSuite.java:203) - at junit.framework.TestSuite.runTest(TestSuite.java:208) - at junit.framework.TestSuite.run(TestSuite.java:203) - at junit.framework.TestSuite.runTest(TestSuite.java:208) - at junit.framework.TestSuite.run(TestSuite.java:203) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:597) - at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:597) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/ignoreSuiteAsInnerClass/TEST-org.apache.shindig.protocol.TestHandler$Input.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/ignoreSuiteAsInnerClass/TEST-org.apache.shindig.protocol.TestHandler$Input.xml deleted file mode 100644 index 9984c04df8d..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/ignoreSuiteAsInnerClass/TEST-org.apache.shindig.protocol.TestHandler$Input.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/ignoreSuiteAsInnerClass/TEST-org.apache.shindig.protocol.TestHandler.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/ignoreSuiteAsInnerClass/TEST-org.apache.shindig.protocol.TestHandler.xml deleted file mode 100644 index 253127cfd29..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/ignoreSuiteAsInnerClass/TEST-org.apache.shindig.protocol.TestHandler.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.SonarMojoTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.SonarMojoTest.xml deleted file mode 100644 index c11af664afb..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.SonarMojoTest.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.CheckstyleCollectorTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.CheckstyleCollectorTest.xml deleted file mode 100644 index 71e443db9e4..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.CheckstyleCollectorTest.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.CloverCollectorTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.CloverCollectorTest.xml deleted file mode 100644 index f803b695a45..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.CloverCollectorTest.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.JDependsCollectorTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.JDependsCollectorTest.xml deleted file mode 100644 index 0fc45fcaaf6..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.JDependsCollectorTest.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.JavaNCSSCollectorTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.JavaNCSSCollectorTest.xml deleted file mode 100644 index 693f3fa3bf8..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.JavaNCSSCollectorTest.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.MetricsCollectorRegistryTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.MetricsCollectorRegistryTest.xml deleted file mode 100644 index dc3b31ac1da..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/many-results/TEST-ch.hortis.sonar.mvn.mc.MetricsCollectorRegistryTest.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/measuresShouldNotIncludeSkippedTests/TEST-FooTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/measuresShouldNotIncludeSkippedTests/TEST-FooTest.xml deleted file mode 100644 index 7268a352cdc..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/measuresShouldNotIncludeSkippedTests/TEST-FooTest.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - java.lang.AssertionError: - expected:<2> but was:<1> - at org.junit.Assert.fail(Assert.java:74) - at org.junit.Assert.failNotEquals(Assert.java:448) - at org.junit.Assert.assertEquals(Assert.java:102) - at org.junit.Assert.assertEquals(Assert.java:323) - at org.junit.Assert.assertEquals(Assert.java:319) - at org.sonar.core.ExtensionsFinderTest.shouldFindJdbcDrivers(ExtensionsFinderTest.java:45) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) - at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) - at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) - at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) - at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) - at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) - at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) - at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) - at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) - at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) - at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) - at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) - at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/noSuccessRatioIfNoTests/TEST-FooTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/noSuccessRatioIfNoTests/TEST-FooTest.xml deleted file mode 100644 index f4e91d51451..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/noSuccessRatioIfNoTests/TEST-FooTest.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/roundingTests/TEST-Rounding.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/roundingTests/TEST-Rounding.xml deleted file mode 100644 index c46ab7a9deb..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/roundingTests/TEST-Rounding.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleMultipleSuitesInSameFile/TESTS-MutlipleSuites.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleMultipleSuitesInSameFile/TESTS-MutlipleSuites.xml deleted file mode 100644 index e5bd8c0cdf2..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleMultipleSuitesInSameFile/TESTS-MutlipleSuites.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/ExtensionsFinderTest-expected-result.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/ExtensionsFinderTest-expected-result.xml deleted file mode 100644 index b99f02c18ba..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/ExtensionsFinderTest-expected-result.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/ExtensionsFinderTest2-expected-result.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/ExtensionsFinderTest2-expected-result.xml deleted file mode 100644 index e424345714c..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/ExtensionsFinderTest2-expected-result.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/ExtensionsFinderTest3-expected-result.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/ExtensionsFinderTest3-expected-result.xml deleted file mode 100644 index d4f2edf0e3d..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/ExtensionsFinderTest3-expected-result.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/TEST-org.sonar.core.ExtensionsFinderTestSuite.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/TEST-org.sonar.core.ExtensionsFinderTestSuite.xml deleted file mode 100644 index 01787470d98..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldHandleTestSuiteDetails/TEST-org.sonar.core.ExtensionsFinderTestSuite.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - java.lang.AssertionError: - expected:<2> but was:<1> - at org.junit.Assert.fail(Assert.java:74) - at org.junit.Assert.failNotEquals(Assert.java:448) - at org.junit.Assert.assertEquals(Assert.java:102) - at org.junit.Assert.assertEquals(Assert.java:323) - at org.junit.Assert.assertEquals(Assert.java:319) - at org.sonar.core.ExtensionsFinderTest.shouldFindJdbcDrivers(ExtensionsFinderTest.java:45) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) - at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) - at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) - at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) - at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) - at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) - at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) - at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) - at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) - at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) - at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) - at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) - at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) - - - - - java.lang.RuntimeException: TEST - at org.sonar.core.ExtensionsFinderTest.shouldFindPlugins(ExtensionsFinderTest.java:57) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) - at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) - at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) - at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) - at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) - at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) - at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) - at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) - at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) - at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) - at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) - at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) - at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldManageClassesWithDefaultPackage/TEST-NoPackagesTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldManageClassesWithDefaultPackage/TEST-NoPackagesTest.xml deleted file mode 100644 index d3bb90a58f8..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldManageClassesWithDefaultPackage/TEST-NoPackagesTest.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldNotFailIfReportsNotFound/pom.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldNotFailIfReportsNotFound/pom.xml deleted file mode 100644 index 76a22ad8289..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldNotFailIfReportsNotFound/pom.xml +++ /dev/null @@ -1,12 +0,0 @@ - - 4.0.0 - fake.group - fake.artifactId - jar - 1.0-SNAPSHOT - - - unknown - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldSaveErrorsAndFailuresInXML/TEST-org.sonar.core.ExtensionsFinderTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldSaveErrorsAndFailuresInXML/TEST-org.sonar.core.ExtensionsFinderTest.xml deleted file mode 100644 index 5210e86889e..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldSaveErrorsAndFailuresInXML/TEST-org.sonar.core.ExtensionsFinderTest.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - java.lang.AssertionError: - expected:<2> but was:<1> - at org.junit.Assert.fail(Assert.java:74) - at org.junit.Assert.failNotEquals(Assert.java:448) - at org.junit.Assert.assertEquals(Assert.java:102) - at org.junit.Assert.assertEquals(Assert.java:323) - at org.junit.Assert.assertEquals(Assert.java:319) - at org.sonar.core.ExtensionsFinderTest.shouldFindJdbcDrivers(ExtensionsFinderTest.java:45) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) - at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) - at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) - at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) - at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) - at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) - at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) - at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) - at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) - at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) - at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) - at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) - at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) - - - - - java.lang.RuntimeException: TEST - at org.sonar.core.ExtensionsFinderTest.shouldFindPlugins(ExtensionsFinderTest.java:57) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) - at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) - at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) - at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) - at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) - at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) - at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) - at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) - at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) - at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) - at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) - at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) - at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldSaveErrorsAndFailuresInXML/expected-test-details.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldSaveErrorsAndFailuresInXML/expected-test-details.xml deleted file mode 100644 index 1eb84eff018..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/shouldSaveErrorsAndFailuresInXML/expected-test-details.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/successRatioIsZeroWhenAllTestsFail/TEST-FooTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/successRatioIsZeroWhenAllTestsFail/TEST-FooTest.xml deleted file mode 100644 index 950b8474621..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/SurefireSensorTest/successRatioIsZeroWhenAllTestsFail/TEST-FooTest.xml +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - java.lang.AssertionError: - expected:<2> but was:<1> - at org.junit.Assert.fail(Assert.java:74) - at org.junit.Assert.failNotEquals(Assert.java:448) - at org.junit.Assert.assertEquals(Assert.java:102) - at org.junit.Assert.assertEquals(Assert.java:323) - at org.junit.Assert.assertEquals(Assert.java:319) - at org.sonar.core.ExtensionsFinderTest.shouldFindJdbcDrivers(ExtensionsFinderTest.java:45) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) - at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) - at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) - at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) - at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) - at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) - at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) - at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) - at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) - at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) - at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) - at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) - at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) - - - - java.lang.RuntimeException: TEST - at org.sonar.core.ExtensionsFinderTest.shouldFindPlugins(ExtensionsFinderTest.java:57) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) - at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) - at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) - at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) - at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) - at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) - at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) - at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) - at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) - at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) - at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) - at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) - at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/groovyAndJavaTests/TEST-groovy.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/groovyAndJavaTests/TEST-groovy.xml deleted file mode 100644 index 42a888e131a..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/groovyAndJavaTests/TEST-groovy.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/groovyAndJavaTests/TEST-java.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/groovyAndJavaTests/TEST-java.xml deleted file mode 100644 index 2d6bb0c72a3..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/groovyAndJavaTests/TEST-java.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/innerClasses/TEST-org.apache.commons.collections.TestAllPackages.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/innerClasses/TEST-org.apache.commons.collections.TestAllPackages.xml deleted file mode 100644 index e3f5933ba48..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/innerClasses/TEST-org.apache.commons.collections.TestAllPackages.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - java.io.InvalidClassException: - org.apache.commons.collections.FastArrayList; - local class incompatible: stream classdesc serialVersionUID = 1566341225434603896, local class serialVersionUID = - 7918928878747177577 - at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562) - at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583) - at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) - at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732) - at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) - at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) - at org.apache.commons.collections.AbstractTestObject.readExternalFormFromStream(AbstractTestObject.java:326) - at org.apache.commons.collections.AbstractTestObject.readExternalFormFromDisk(AbstractTestObject.java:301) - at org.apache.commons.collections.list.AbstractTestList.testEmptyListCompatibility(AbstractTestList.java:1077) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:597) - at junit.framework.TestCase.runTest(TestCase.java:154) - at junit.framework.TestCase.runBare(TestCase.java:127) - at junit.framework.TestResult$1.protect(TestResult.java:106) - at junit.framework.TestResult.runProtected(TestResult.java:124) - at junit.framework.TestResult.run(TestResult.java:109) - at junit.framework.TestCase.run(TestCase.java:118) - at junit.framework.TestSuite.runTest(TestSuite.java:208) - at junit.framework.TestSuite.run(TestSuite.java:203) - at junit.framework.TestSuite.runTest(TestSuite.java:208) - at junit.framework.TestSuite.run(TestSuite.java:203) - at junit.framework.TestSuite.runTest(TestSuite.java:208) - at junit.framework.TestSuite.run(TestSuite.java:203) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:597) - at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:597) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.SonarMojoTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.SonarMojoTest.xml deleted file mode 100644 index c11af664afb..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.SonarMojoTest.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.CheckstyleCollectorTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.CheckstyleCollectorTest.xml deleted file mode 100644 index 71e443db9e4..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.CheckstyleCollectorTest.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.CloverCollectorTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.CloverCollectorTest.xml deleted file mode 100644 index f803b695a45..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.CloverCollectorTest.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.JDependsCollectorTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.JDependsCollectorTest.xml deleted file mode 100644 index 0fc45fcaaf6..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.JDependsCollectorTest.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.JavaNCSSCollectorTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.JavaNCSSCollectorTest.xml deleted file mode 100644 index 693f3fa3bf8..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.JavaNCSSCollectorTest.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.MetricsCollectorRegistryTest.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.MetricsCollectorRegistryTest.xml deleted file mode 100644 index dc3b31ac1da..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TEST-ch.hortis.sonar.mvn.mc.MetricsCollectorRegistryTest.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TESTS-AllTests.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TESTS-AllTests.xml deleted file mode 100644 index 86a1c26abe0..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/multipleReports/TESTS-AllTests.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/nestedInnerClasses/TEST-org.sonar.plugins.surefire.NestedTest$Inner1$Run.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/nestedInnerClasses/TEST-org.sonar.plugins.surefire.NestedTest$Inner1$Run.xml deleted file mode 100644 index b3357bd1f87..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/nestedInnerClasses/TEST-org.sonar.plugins.surefire.NestedTest$Inner1$Run.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/nestedInnerClasses/TEST-org.sonar.plugins.surefire.NestedTest$Inner2$Run.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/nestedInnerClasses/TEST-org.sonar.plugins.surefire.NestedTest$Inner2$Run.xml deleted file mode 100644 index 677686a7aa3..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/nestedInnerClasses/TEST-org.sonar.plugins.surefire.NestedTest$Inner2$Run.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/noReports/hack b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/noReports/hack deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/noTests/TEST-noTests.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/noTests/TEST-noTests.xml deleted file mode 100644 index fb55bf567aa..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/noTests/TEST-noTests.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/onlyTestSuiteReport/TESTS-AllTests.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/onlyTestSuiteReport/TESTS-AllTests.xml deleted file mode 100644 index e5bd8c0cdf2..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/AbstractSurefireParserTest/onlyTestSuiteReport/TESTS-AllTests.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromPluginConfiguration/build/junit/hack.txt b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromPluginConfiguration/build/junit/hack.txt deleted file mode 100644 index b1fdc56ae6f..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromPluginConfiguration/build/junit/hack.txt +++ /dev/null @@ -1 +0,0 @@ -hack for maven in order the directory target/surefire to be included in unit tests classpath \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromPluginConfiguration/pom.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromPluginConfiguration/pom.xml deleted file mode 100644 index 4e3df754a65..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromPluginConfiguration/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ - - 4.0.0 - fake.group - fake.artifactId - jar - 1.0-SNAPSHOT - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.4 - - build/junit - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromProperty/pom.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromProperty/pom.xml deleted file mode 100644 index 948c4a831e3..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromProperty/pom.xml +++ /dev/null @@ -1,12 +0,0 @@ - - 4.0.0 - fake.group - fake.artifactId - jar - 1.0-SNAPSHOT - - - target/surefire - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromProperty/target/surefire/hack.txt b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromProperty/target/surefire/hack.txt deleted file mode 100644 index b1fdc56ae6f..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/api/SurefireUtilsTest/shouldGetReportsFromProperty/target/surefire/hack.txt +++ /dev/null @@ -1 +0,0 @@ -hack for maven in order the directory target/surefire to be included in unit tests classpath \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/errorsAndFailures.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/errorsAndFailures.xml deleted file mode 100644 index 950b8474621..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/errorsAndFailures.xml +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - java.lang.AssertionError: - expected:<2> but was:<1> - at org.junit.Assert.fail(Assert.java:74) - at org.junit.Assert.failNotEquals(Assert.java:448) - at org.junit.Assert.assertEquals(Assert.java:102) - at org.junit.Assert.assertEquals(Assert.java:323) - at org.junit.Assert.assertEquals(Assert.java:319) - at org.sonar.core.ExtensionsFinderTest.shouldFindJdbcDrivers(ExtensionsFinderTest.java:45) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) - at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) - at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) - at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) - at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) - at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) - at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) - at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) - at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) - at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) - at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) - at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) - at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) - - - - java.lang.RuntimeException: TEST - at org.sonar.core.ExtensionsFinderTest.shouldFindPlugins(ExtensionsFinderTest.java:57) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) - at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) - at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) - at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) - at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) - at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) - at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) - at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) - at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) - at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) - at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) - at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) - at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/innerClasses.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/innerClasses.xml deleted file mode 100644 index e3f5933ba48..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/innerClasses.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - java.io.InvalidClassException: - org.apache.commons.collections.FastArrayList; - local class incompatible: stream classdesc serialVersionUID = 1566341225434603896, local class serialVersionUID = - 7918928878747177577 - at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562) - at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583) - at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) - at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732) - at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) - at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) - at org.apache.commons.collections.AbstractTestObject.readExternalFormFromStream(AbstractTestObject.java:326) - at org.apache.commons.collections.AbstractTestObject.readExternalFormFromDisk(AbstractTestObject.java:301) - at org.apache.commons.collections.list.AbstractTestList.testEmptyListCompatibility(AbstractTestList.java:1077) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:597) - at junit.framework.TestCase.runTest(TestCase.java:154) - at junit.framework.TestCase.runBare(TestCase.java:127) - at junit.framework.TestResult$1.protect(TestResult.java:106) - at junit.framework.TestResult.runProtected(TestResult.java:124) - at junit.framework.TestResult.run(TestResult.java:109) - at junit.framework.TestCase.run(TestCase.java:118) - at junit.framework.TestSuite.runTest(TestSuite.java:208) - at junit.framework.TestSuite.run(TestSuite.java:203) - at junit.framework.TestSuite.runTest(TestSuite.java:208) - at junit.framework.TestSuite.run(TestSuite.java:203) - at junit.framework.TestSuite.runTest(TestSuite.java:208) - at junit.framework.TestSuite.run(TestSuite.java:203) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:597) - at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:597) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/multipleSuites.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/multipleSuites.xml deleted file mode 100644 index e5bd8c0cdf2..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/multipleSuites.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/rootPackage.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/rootPackage.xml deleted file mode 100644 index d3bb90a58f8..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/rootPackage.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/skippedTests.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/skippedTests.xml deleted file mode 100644 index 7268a352cdc..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/skippedTests.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - java.lang.AssertionError: - expected:<2> but was:<1> - at org.junit.Assert.fail(Assert.java:74) - at org.junit.Assert.failNotEquals(Assert.java:448) - at org.junit.Assert.assertEquals(Assert.java:102) - at org.junit.Assert.assertEquals(Assert.java:323) - at org.junit.Assert.assertEquals(Assert.java:319) - at org.sonar.core.ExtensionsFinderTest.shouldFindJdbcDrivers(ExtensionsFinderTest.java:45) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59) - at org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98) - at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79) - at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87) - at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77) - at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42) - at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88) - at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51) - at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44) - at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27) - at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37) - at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42) - at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) - at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) - at org.apache.maven.surefire.Surefire.run(Surefire.java:177) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:338) - at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:997) - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/suiteInnerClass.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/suiteInnerClass.xml deleted file mode 100644 index 9984c04df8d..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/suiteInnerClass.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/zeroTests.xml b/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/zeroTests.xml deleted file mode 100644 index fb55bf567aa..00000000000 --- a/plugins/sonar-surefire-plugin/src/test/resources/org/sonar/plugins/surefire/data/SurefireStaxHandlerTest/zeroTests.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6ba7634f8d9..5a2596a7ace 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,6 @@ plugins/sonar-core-plugin plugins/sonar-dbcleaner-plugin plugins/sonar-cobertura-plugin - plugins/sonar-surefire-plugin plugins/sonar-findbugs-plugin plugins/sonar-cpd-plugin plugins/sonar-design-plugin @@ -626,6 +625,11 @@ sonar-checkstyle-plugin ${sonarJava.version} + + org.codehaus.sonar-plugins.java + sonar-surefire-plugin + ${sonarJava.version} + asm asm-all diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml index 2fc7443213f..9425fc70f28 100644 --- a/sonar-application/pom.xml +++ b/sonar-application/pom.xml @@ -115,9 +115,8 @@ runtime - org.codehaus.sonar.plugins + org.codehaus.sonar-plugins.java sonar-surefire-plugin - ${project.version} runtime diff --git a/sonar-server/pom.xml b/sonar-server/pom.xml index 2714c84e605..481d68de489 100644 --- a/sonar-server/pom.xml +++ b/sonar-server/pom.xml @@ -447,9 +447,9 @@ provided - org.codehaus.sonar.plugins + org.codehaus.sonar-plugins.java sonar-surefire-plugin - ${project.version} + ${sonarJava.version} sonar-plugin provided