From 6fb2996fd65c650675f36a4658a4dcc8f5891a13 Mon Sep 17 00:00:00 2001 From: Michele Sollecito Date: Fri, 2 Nov 2018 14:01:14 +0000 Subject: [PATCH] [ENT-2678]: PluginRegistrationTest.test plugin registration is failing (fix) (#1535) --- .../kotlin/net/corda/bridge/internal/FirewallStartup.kt | 6 ++---- .../kotlin/net/corda/core/PluginRegistrationTest.kt | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/bridge/src/main/kotlin/net/corda/bridge/internal/FirewallStartup.kt b/bridge/src/main/kotlin/net/corda/bridge/internal/FirewallStartup.kt index cafa8d0bc7..28c27979ad 100644 --- a/bridge/src/main/kotlin/net/corda/bridge/internal/FirewallStartup.kt +++ b/bridge/src/main/kotlin/net/corda/bridge/internal/FirewallStartup.kt @@ -17,7 +17,6 @@ import java.io.RandomAccessFile import java.lang.management.ManagementFactory import java.net.InetAddress import java.nio.file.Path -import java.util.* class FirewallStartup: CordaCliWrapper("corda-firewall", "The Corda Firewall application for handling outbound and inbound connections to Corda.") { companion object { @@ -158,10 +157,9 @@ class FirewallStartup: CordaCliWrapper("corda-firewall", "The Corda Firewall app } override fun initLogging() { - val loggingLevel = loggingLevel.name.toLowerCase(Locale.ENGLISH) - System.setProperty("defaultLogLevel", loggingLevel) // These properties are referenced from the XML config file. + System.setProperty("defaultLogLevel", specifiedLogLevel) // These properties are referenced from the XML config file. if (verbose) { - System.setProperty("consoleLogLevel", loggingLevel) + System.setProperty("consoleLogLevel", specifiedLogLevel) } System.setProperty("log-path", (cmdLineOptions.baseDirectory / LOGS_DIRECTORY_NAME).toString()) SLF4JBridgeHandler.removeHandlersForRootLogger() // The default j.u.l config adds a ConsoleHandler. diff --git a/core/src/smoke-test/kotlin/net/corda/core/PluginRegistrationTest.kt b/core/src/smoke-test/kotlin/net/corda/core/PluginRegistrationTest.kt index d8ea100c44..e8d079219a 100644 --- a/core/src/smoke-test/kotlin/net/corda/core/PluginRegistrationTest.kt +++ b/core/src/smoke-test/kotlin/net/corda/core/PluginRegistrationTest.kt @@ -5,15 +5,13 @@ import net.corda.core.internal.div import net.corda.nodeapi.internal.config.User import net.corda.smoketesting.NodeConfig import net.corda.smoketesting.NodeProcess -import org.assertj.core.api.Assertions.assertThatThrownBy -import org.junit.Ignore +import org.assertj.core.api.Assertions.assertThatCode import org.junit.Rule import org.junit.Test import org.junit.rules.TemporaryFolder import java.io.FileOutputStream import java.util.jar.JarOutputStream - class PluginRegistrationTest { private companion object { val pluginJarFile = PluginRegistrationTest::class.java.getResource("/dummydriver.jar")!!.path @@ -23,7 +21,6 @@ class PluginRegistrationTest { @JvmField val temporaryFolder = TemporaryFolder() - @Ignore @Test fun `test plugin registration` () { // Create node jarDir with an empty jar file in it @@ -39,7 +36,7 @@ class PluginRegistrationTest { jarDirs = listOf(jarDir)) // Check we do not have plugin on classpath - assertThatThrownBy({ Class.forName("net.corda.smoketesting.plugins.DummyJDBCDriver") }) + assertThatCode { Class.forName("net.corda.smoketesting.plugins.DummyJDBCDriver") }.isInstanceOf(ClassNotFoundException::class.java) // Install plugin Jars in node directory, then start the node and close it val consoleOutput = temporaryFolder.newFile("node-stdout.txt")