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 7, 2020
1 parent f182c8c commit 6be0d1f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
4 changes: 1 addition & 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,15 +11,14 @@ 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)
.registerModules(KotlinModule())
.configure(FAIL_ON_UNKNOWN_PROPERTIES, false)

internal val xmlPrettyWriter = xmlMapper.writerWithDefaultPrettyPrinter()


private fun xmlText(path: Path): String {
if (!path.toFile().exists()) throw RuntimeException("$path doesn't exist!")
return Files.readString(path)
Expand All @@ -45,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 @@ -11,4 +11,4 @@ fun fixHtmlCodes(data: String): String {
fixedStr = fixedStr.replace(isoControlCode, "")
}
return fixedStr
}
}
6 changes: 0 additions & 6 deletions test_runner/src/test/kotlin/ftl/reports/xml/JUnitXmlTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import ftl.test.util.TestHelper.normalizeLineEnding
import java.nio.file.Paths
import org.junit.Test


class JUnitXmlTest {

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


@Test
fun `parse ftl quirks`() {
val crashingAllSuitesMessage = """
Expand Down Expand Up @@ -470,8 +467,5 @@ junit.framework.Assert.fail(Assert.java:50)</failure>

parseAllSuitesXml(crashingAllSuitesMessage)
parseOneSuiteXml(crashingOneSuiteMessage)

}

}

0 comments on commit 6be0d1f

Please sign in to comment.