Skip to content

Commit

Permalink
#764 detekt issues fix
Browse files Browse the repository at this point in the history
detekt issues fix
  • Loading branch information
adamfilipow92 committed May 8, 2020
1 parent da1fa2a commit dfd80fb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
3 changes: 0 additions & 3 deletions test_runner/src/main/kotlin/ftl/reports/xml/JUnitXml.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import java.io.File
import java.nio.file.Files
import java.nio.file.Path


private val xmlModule = JacksonXmlModule().apply { setDefaultUseWrapper(false) }

private val xmlMapper = XmlMapper(xmlModule)
Expand All @@ -20,7 +19,6 @@ private val xmlMapper = XmlMapper(xmlModule)

internal val xmlPrettyWriter = xmlMapper.writerWithDefaultPrettyPrinter()


private fun xmlText(path: Path): String {
if (!path.toFile().exists()) throw RuntimeException("$path doesn't exist!")
return String(Files.readAllBytes(path))
Expand All @@ -46,7 +44,6 @@ fun parseOneSuiteXml(data: String): JUnitTestResult {

// --


fun parseAllSuitesXml(path: Path): JUnitTestResult {
return parseAllSuitesXml(xmlText(path))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ fun fixHtmlCodes(data: String): String {
}
return fixedStr
}

6 changes: 1 addition & 5 deletions test_runner/src/test/kotlin/ftl/reports/xml/JUnitXmlTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import org.junit.Assert
import java.nio.file.Paths
import org.junit.Test


class JUnitXmlTest {

companion object {
Expand Down Expand Up @@ -442,8 +441,6 @@ junit.framework.Assert.fail(Assert.java:50)</failure>
""".trimIndent()
assertThat(merged).isEqualTo(expected)
}


@Test
fun `parse ftl quirks in all suites`() {

Expand Down Expand Up @@ -491,7 +488,6 @@ junit.framework.Assert.fail(Assert.java:50)</failure>
</testsuite>
""".trimIndent()


val expectedOneSuiteMessage = """
<?xml version='1.0' encoding='UTF-8' ?>
<testsuites>
Expand All @@ -506,6 +502,6 @@ junit.framework.Assert.fail(Assert.java:50)</failure>
""".trimIndent()
val oneSuiteXml = parseOneSuiteXml(crashingOneSuiteMessage).xmlToString().trimIndent()
Assert.assertEquals("One Suite Messages should be the same!", expectedOneSuiteMessage, oneSuiteXml)

}
}

0 comments on commit dfd80fb

Please sign in to comment.