diff --git a/main/src/main/scala/sbt/plugins/JUnitXmlReportPlugin.scala b/main/src/main/scala/sbt/plugins/JUnitXmlReportPlugin.scala index 6537c9e2e..39baa07a6 100644 --- a/main/src/main/scala/sbt/plugins/JUnitXmlReportPlugin.scala +++ b/main/src/main/scala/sbt/plugins/JUnitXmlReportPlugin.scala @@ -33,8 +33,8 @@ object JUnitXmlReportPlugin extends AutoPlugin { Seq( testListeners += new JUnitXmlTestsListener( target.value.getAbsolutePath, - streams.value.log, - SysProp.legacyTestReport + SysProp.legacyTestReport, + streams.value.log ) ) } diff --git a/sbt/src/sbt-test/tests/junit-xml-report/build.sbt b/sbt/src/sbt-test/tests/junit-xml-report/build.sbt index 1d864c81b..a2f002d50 100644 --- a/sbt/src/sbt-test/tests/junit-xml-report/build.sbt +++ b/sbt/src/sbt-test/tests/junit-xml-report/build.sbt @@ -5,11 +5,11 @@ import Defaults._ val checkReport = taskKey[Unit]("Check the test reports") val checkNoReport = taskKey[Unit]("Check that no reports are present") -val oneSecondReportFile = "target/test-reports/a.pkg.OneSecondTest.xml" -val failingReportFile = "target/test-reports/another.pkg.FailingTest.xml" +val oneSecondReportFile = "target/test-reports/TEST-a.pkg.OneSecondTest.xml" +val failingReportFile = "target/test-reports/TEST-another.pkg.FailingTest.xml" -val flatSuiteReportFile = "target/test-reports/my.scalatest.MyFlatSuite.xml" -val nestedSuitesReportFile = "target/test-reports/my.scalatest.MyNestedSuites.xml" +val flatSuiteReportFile = "target/test-reports/TEST-my.scalatest.MyFlatSuite.xml" +val nestedSuitesReportFile = "target/test-reports/TEST-my.scalatest.MyNestedSuites.xml" val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" val junitinterface = "com.novocode" % "junit-interface" % "0.11" diff --git a/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala b/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala index c92765186..d8e0bfa2b 100644 --- a/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala +++ b/testing/src/main/scala/sbt/JUnitXmlTestsListener.scala @@ -33,10 +33,11 @@ import sbt.protocol.testing.TestResult * report format. * @param outputDir path to the dir in which a folder with results is generated */ -class JUnitXmlTestsListener(val outputDir: String, logger: Logger, legacyTestReport: Boolean) +class JUnitXmlTestsListener(val outputDir: String, legacyTestReport: Boolean, logger: Logger) extends TestsListener { - // This constructor is for binary compatibility with older versions of sbt. - def this(outputDir: String) = this(outputDir, null, false) + // These constructors are for binary compatibility with older versions of sbt. + def this(outputDir: String, logger: Logger) = this(outputDir, false, logger) + def this(outputDir: String) = this(outputDir, false, null) /**Current hostname so we know which machine executed the tests*/ val hostname: String = {