CORDA-792 - Standalone Shell - fix test on Windows (#2757)

Fix test which uses Paths.get() and doesn't match on Windows.
This commit is contained in:
szymonsztuka 2018-03-07 17:14:32 +00:00 committed by GitHub
parent 84e930d52a
commit 17eb30965d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ import java.io.File
class StandaloneShellArgsParserTest { class StandaloneShellArgsParserTest {
private val CONFIG_FILE = File(javaClass.classLoader.getResource("config.conf")!!.file) private val CONFIG_FILE = File(StandaloneShellArgsParserTest::class.java.getResource("/config.conf").toURI())
@Test @Test
fun args_to_cmd_options() { fun args_to_cmd_options() {
@ -33,8 +33,8 @@ class StandaloneShellArgsParserTest {
"--keystore-type", "JKS") "--keystore-type", "JKS")
val expectedOptions = CommandLineOptions(configFile = "/x/y/z/config.conf", val expectedOptions = CommandLineOptions(configFile = "/x/y/z/config.conf",
commandsDirectory = Paths.get("/x/y/commands"), commandsDirectory = Paths.get("/x/y/commands").normalize().toAbsolutePath(),
cordappsDirectory = Paths.get("/x/y/cordapps"), cordappsDirectory = Paths.get("/x/y/cordapps").normalize().toAbsolutePath(),
host = "alocalhost", host = "alocalhost",
port = "1234", port = "1234",
user = "demo", user = "demo",
@ -42,11 +42,11 @@ class StandaloneShellArgsParserTest {
help = true, help = true,
loggingLevel = Level.DEBUG, loggingLevel = Level.DEBUG,
sshdPort = "2223", sshdPort = "2223",
sshdHostKeyDirectory = Paths.get("/x/y/ssh"), sshdHostKeyDirectory = Paths.get("/x/y/ssh").normalize().toAbsolutePath(),
keyStorePassword = "pass1", keyStorePassword = "pass1",
trustStorePassword = "pass2", trustStorePassword = "pass2",
keyStoreFile = Paths.get("/x/y/keystore.jks"), keyStoreFile = Paths.get("/x/y/keystore.jks").normalize().toAbsolutePath(),
trustStoreFile = Paths.get("/x/y/truststore.jks"), trustStoreFile = Paths.get("/x/y/truststore.jks").normalize().toAbsolutePath(),
trustStoreType = "dummy", trustStoreType = "dummy",
keyStoreType = "JKS") keyStoreType = "JKS")
@ -125,7 +125,7 @@ class StandaloneShellArgsParserTest {
} }
@Test @Test
fun acmd_options_to_config_from_file() { fun cmd_options_to_config_from_file() {
val options = CommandLineOptions(configFile = CONFIG_FILE.absolutePath, val options = CommandLineOptions(configFile = CONFIG_FILE.absolutePath,
commandsDirectory = null, commandsDirectory = null,