1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 00:17:11 -07:00

Refactor.

This commit is contained in:
Cedric Beust 2017-03-21 16:49:26 -07:00
parent 64df5ea8df
commit f486bfbd93

View file

@ -69,8 +69,10 @@ class TestNgRunner : GenericTestRunner() {
val testngDependencyVersion = Versions.toLongVersion(testngDependency) val testngDependencyVersion = Versions.toLongVersion(testngDependency)
val result = val result =
if (testngDependencyVersion >= VERSION_6_10) { if (testngDependencyVersion >= VERSION_6_10) {
context.logger.log(project.name, 1, "Modern TestNG, displaying colors")
displayPrettyColors(project, context, classpath) displayPrettyColors(project, context, classpath)
} else { } else {
context.logger.log(project.name, 1, "Older TestNG ($testngDependencyVersion), using the old runner")
super.runTests(project, context, classpath, configName) super.runTests(project, context, classpath, configName)
} }
return result return result
@ -80,13 +82,15 @@ class TestNgRunner : GenericTestRunner() {
: Boolean { : Boolean {
val port = 2345 val port = 2345
val jf = context.dependencyManager.create("org.testng.testng-remote:testng-remote:1.3.0") val dep = with(context.dependencyManager) {
val tr = context.dependencyManager.create("org.testng.testng-remote:testng-remote6_10:1.3.0") val jf = create("org.testng.testng-remote:testng-remote:1.3.0")
val testng = context.dependencyManager.create("org.testng:testng:6.10") val tr = create("org.testng.testng-remote:testng-remote6_10:1.3.0")
val dep1 = context.dependencyManager.transitiveClosure(listOf(jf, tr, testng)) val testng = create("org.testng:testng:6.10")
transitiveClosure(listOf(jf, tr, testng))
}
val v = Versions.toLongVersion("6.10") val v = Versions.toLongVersion("6.10")
val cp = (classpath + dep1).map { it.jarFile.get() } val cp = (classpath + dep).map { it.jarFile.get() }
.joinToString(File.pathSeparator) .joinToString(File.pathSeparator)
val passedArgs = listOf( val passedArgs = listOf(
"-classpath", "-classpath",