From 433a9ab5c3d62472fb875a9f436c17dc62f80a62 Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Mon, 26 Jun 2017 10:12:48 +0100 Subject: [PATCH] DemoBench operates exclusively on localhost, so no need for public IP. (#919) --- .../src/main/kotlin/net/corda/demobench/model/NodeConfig.kt | 3 ++- .../test/kotlin/net/corda/demobench/model/NodeConfigTest.kt | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/demobench/src/main/kotlin/net/corda/demobench/model/NodeConfig.kt b/tools/demobench/src/main/kotlin/net/corda/demobench/model/NodeConfig.kt index 14ce84779f..64406da824 100644 --- a/tools/demobench/src/main/kotlin/net/corda/demobench/model/NodeConfig.kt +++ b/tools/demobench/src/main/kotlin/net/corda/demobench/model/NodeConfig.kt @@ -56,11 +56,12 @@ class NodeConfig( .withValue("rpcUsers", valueFor(users.map(User::toMap).toList())) .withValue("h2port", valueFor(h2Port)) .withValue("useTestClock", valueFor(true)) + .withValue("detectPublicIp", valueFor(false)) fun toText(): String = toFileConfig().root().render(renderOptions) fun moveTo(baseDir: Path) = NodeConfig( - baseDir, legalName, p2pPort, rpcPort, webPort, h2Port, extraServices, users, networkMap + baseDir, legalName, p2pPort, rpcPort, webPort, h2Port, extraServices, users, networkMap ) fun install(plugins: Collection) { diff --git a/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt b/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt index e5db3e1233..6d9b04d3e5 100644 --- a/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt +++ b/tools/demobench/src/test/kotlin/net/corda/demobench/model/NodeConfigTest.kt @@ -142,6 +142,7 @@ class NodeConfigTest { users = listOf(user("jenny")) ) assertEquals(prettyPrint("{" + + "\"detectPublicIp\":false," + "\"extraAdvertisedServiceIds\":[\"my.service\"]," + "\"h2port\":30001," + "\"myLegalName\":\"CN=My Name,OU=Corda QA Department,O=R3 CEV,L=New York,C=US\"," @@ -169,6 +170,7 @@ class NodeConfigTest { config.networkMap = NetworkMapConfig(DUMMY_NOTARY.name, 12345) assertEquals(prettyPrint("{" + + "\"detectPublicIp\":false," + "\"extraAdvertisedServiceIds\":[\"my.service\"]," + "\"h2port\":30001," + "\"myLegalName\":\"CN=My Name,OU=Corda QA Department,O=R3 CEV,L=New York,C=US\"," @@ -210,6 +212,7 @@ class NodeConfigTest { assertEquals(NetworkMapInfo(localPort(12345), DUMMY_NOTARY.name), fullConfig.networkMapService) assertTrue((fullConfig.dataSourceProperties["dataSource.url"] as String).contains("AUTO_SERVER_PORT=30001")) assertTrue(fullConfig.useTestClock) + assertFalse(fullConfig.detectPublicIp) } @Test