Make logging available in IntelliJ between gradle clean and assemble (#929)

* Enforce absence of node from client rpc smokeTest classpath
This commit is contained in:
Andrzej Cichocki
2017-06-28 09:54:09 +01:00
committed by GitHub
parent 77e1d54c43
commit 0aadc037ef
15 changed files with 96 additions and 66 deletions

View File

@ -0,0 +1,27 @@
package net.corda.kotlin.rpc
import net.corda.core.div
import org.junit.Test
import java.io.File
import java.nio.file.Path
import java.nio.file.Paths
import kotlin.test.assertFalse
import kotlin.test.assertTrue
class ValidateClasspathTest {
@Test
fun `node not on classpath`() {
val paths = System.getProperty("java.class.path").split(File.pathSeparatorChar).map { Paths.get(it) }
// First find core so that if node is there, it's in the form we expect:
assertFalse(paths.filter { it.contains("core" / "build") }.isEmpty())
assertTrue(paths.filter { it.contains("node" / "build") }.isEmpty())
}
}
private fun Path.contains(that: Path): Boolean {
val size = that.nameCount
(0..nameCount - size).forEach {
if (subpath(it, it + size) == that) return true
}
return false
}