mirror of
https://github.com/corda/corda.git
synced 2024-12-19 04:57:58 +00:00
Fix node crash when the plugins dir is empty
This commit is contained in:
parent
6d1462f8eb
commit
8cb7c5eab1
@ -325,6 +325,8 @@ abstract class AbstractNode(open val configuration: NodeConfiguration,
|
||||
it.filter { it.isRegularFile() && it.toString().endsWith(".jar") }.toArray()
|
||||
}
|
||||
|
||||
if (pluginJars.isEmpty()) return emptyList()
|
||||
|
||||
val scanResult = FastClasspathScanner().overrideClasspath(*pluginJars).scan() // This will only scan the plugin jars and nothing else
|
||||
|
||||
fun loadFlowClass(className: String): Class<out FlowLogic<*>>? {
|
||||
|
22
node/src/test/kotlin/net/corda/node/internal/NodeTest.kt
Normal file
22
node/src/test/kotlin/net/corda/node/internal/NodeTest.kt
Normal file
@ -0,0 +1,22 @@
|
||||
package net.corda.node.internal
|
||||
|
||||
import net.corda.core.createDirectories
|
||||
import net.corda.core.crypto.commonName
|
||||
import net.corda.core.div
|
||||
import net.corda.core.getOrThrow
|
||||
import net.corda.core.utilities.ALICE
|
||||
import net.corda.testing.node.NodeBasedTest
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.junit.Test
|
||||
|
||||
class NodeTest : NodeBasedTest() {
|
||||
@Test
|
||||
fun `empty plugins directory`() {
|
||||
val baseDirectory = tempFolder.root.toPath() / ALICE.name.commonName
|
||||
(baseDirectory / "plugins").createDirectories()
|
||||
val node = startNode(ALICE.name).getOrThrow()
|
||||
// Make sure we created the plugins dir in the correct place
|
||||
assertThat(baseDirectory).isEqualTo(node.configuration.baseDirectory)
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user