mirror of
https://github.com/corda/corda.git
synced 2024-12-20 21:43:14 +00:00
Minor: auto-format of module: tools, verifier
This commit is contained in:
parent
cda04b0e7b
commit
4d6d4c167e
@ -1,11 +1,8 @@
|
||||
package net.corda.demobench.config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.logging.LogManager;
|
||||
import java.io.*;
|
||||
import java.nio.file.*;
|
||||
import java.util.logging.*;
|
||||
|
||||
/**
|
||||
* Configuration class for JUL / TornadoFX.
|
||||
|
@ -1,11 +1,10 @@
|
||||
package net.corda.demobench
|
||||
|
||||
import java.io.InputStreamReader
|
||||
import java.nio.charset.StandardCharsets.UTF_8
|
||||
import javafx.scene.image.Image
|
||||
import net.corda.demobench.views.DemoBenchView
|
||||
import tornadofx.App
|
||||
import tornadofx.addStageIcon
|
||||
import tornadofx.*
|
||||
import java.io.InputStreamReader
|
||||
import java.nio.charset.StandardCharsets.UTF_8
|
||||
|
||||
/**
|
||||
* README!
|
||||
|
@ -1,11 +1,11 @@
|
||||
package net.corda.demobench.explorer
|
||||
|
||||
import java.io.IOException
|
||||
import java.util.concurrent.Executors
|
||||
import net.corda.core.utilities.loggerFor
|
||||
import net.corda.demobench.readErrorLines
|
||||
import net.corda.demobench.model.NodeConfig
|
||||
import net.corda.demobench.model.forceDirectory
|
||||
import net.corda.demobench.readErrorLines
|
||||
import java.io.IOException
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
class Explorer internal constructor(private val explorerController: ExplorerController) : AutoCloseable {
|
||||
private companion object {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package net.corda.demobench.explorer
|
||||
|
||||
import net.corda.demobench.model.JVMConfig
|
||||
import tornadofx.Controller
|
||||
import tornadofx.*
|
||||
|
||||
class ExplorerController : Controller() {
|
||||
|
||||
|
@ -2,9 +2,10 @@ package net.corda.demobench.model
|
||||
|
||||
import com.google.common.net.HostAndPort
|
||||
import com.typesafe.config.Config
|
||||
import tornadofx.*
|
||||
import java.io.IOException
|
||||
import java.nio.file.*
|
||||
import tornadofx.Controller
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
|
||||
class InstallFactory : Controller() {
|
||||
|
||||
@ -54,7 +55,7 @@ class InstallFactory : Controller() {
|
||||
return this.getStringList(path)
|
||||
.filter { !it.isNullOrEmpty() }
|
||||
.map { svc ->
|
||||
require(svc in services, { "Unknown service '$svc'." } )
|
||||
require(svc in services, { "Unknown service '$svc'." })
|
||||
svc
|
||||
}.toList()
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
package net.corda.demobench.model
|
||||
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.Paths
|
||||
import javafx.scene.control.Alert
|
||||
import javafx.scene.control.Alert.AlertType.ERROR
|
||||
import javafx.stage.Stage
|
||||
import tornadofx.Controller
|
||||
import tornadofx.*
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.Paths
|
||||
|
||||
class JVMConfig : Controller() {
|
||||
|
||||
|
@ -47,9 +47,10 @@ class NodeConfig(
|
||||
.withValue("nearestCity", valueFor(nearestCity))
|
||||
.withValue("extraAdvertisedServiceIds", valueFor(extraServices))
|
||||
.withFallback(optional("networkMapService", networkMap, {
|
||||
c, n -> c.withValue("address", addressValueFor(n.p2pPort))
|
||||
c, n ->
|
||||
c.withValue("address", addressValueFor(n.p2pPort))
|
||||
.withValue("legalName", valueFor(n.legalName))
|
||||
} ))
|
||||
}))
|
||||
.withValue("webAddress", addressValueFor(webPort))
|
||||
.withValue("rpcAddress", addressValueFor(rpcPort))
|
||||
.withValue("rpcUsers", valueFor(users.map(User::toMap).toList()))
|
||||
|
@ -1,5 +1,8 @@
|
||||
package net.corda.demobench.model
|
||||
|
||||
import net.corda.demobench.plugin.PluginController
|
||||
import net.corda.demobench.pty.R3Pty
|
||||
import tornadofx.*
|
||||
import java.io.IOException
|
||||
import java.lang.management.ManagementFactory
|
||||
import java.net.ServerSocket
|
||||
@ -9,9 +12,6 @@ import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import java.util.logging.Level
|
||||
import net.corda.demobench.plugin.PluginController
|
||||
import net.corda.demobench.pty.R3Pty
|
||||
import tornadofx.Controller
|
||||
|
||||
class NodeController(check: atRuntime = ::checkExists) : Controller() {
|
||||
companion object {
|
||||
|
@ -1,9 +1,9 @@
|
||||
package net.corda.demobench.model
|
||||
|
||||
import tornadofx.observable
|
||||
import javafx.beans.property.SimpleIntegerProperty
|
||||
import javafx.beans.property.SimpleListProperty
|
||||
import javafx.beans.property.SimpleStringProperty
|
||||
import tornadofx.*
|
||||
|
||||
class NodeData {
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package net.corda.demobench.model
|
||||
|
||||
import tornadofx.ItemViewModel
|
||||
import tornadofx.*
|
||||
|
||||
class NodeDataModel : ItemViewModel<NodeData>(NodeData()) {
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
package net.corda.demobench.model
|
||||
|
||||
import tornadofx.*
|
||||
import java.io.IOException
|
||||
import java.io.InputStreamReader
|
||||
import java.net.URL
|
||||
import java.util.*
|
||||
import java.util.logging.Level
|
||||
import tornadofx.Controller
|
||||
|
||||
class ServiceController(resourceName: String = "/services.conf") : Controller() {
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
@file:JvmName("User")
|
||||
|
||||
package net.corda.demobench.model
|
||||
|
||||
import net.corda.nodeapi.User
|
||||
|
@ -1,13 +1,13 @@
|
||||
package net.corda.demobench.plugin
|
||||
|
||||
import java.io.IOException
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.util.stream.Stream
|
||||
import net.corda.demobench.model.HasPlugins
|
||||
import net.corda.demobench.model.JVMConfig
|
||||
import net.corda.demobench.model.NodeConfig
|
||||
import tornadofx.*
|
||||
import java.io.IOException
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.util.stream.Stream
|
||||
|
||||
class PluginController : Controller() {
|
||||
|
||||
@ -22,7 +22,7 @@ class PluginController : Controller() {
|
||||
fun populate(config: NodeConfig) {
|
||||
// Nodes cannot issue cash unless they contain the "Bank of Corda" plugin.
|
||||
if (config.isCashIssuer && bankOfCorda.isFile) {
|
||||
bankOfCorda.copyTo(config.pluginDir.resolve(bankOfCorda.name).toFile(), overwrite=true)
|
||||
bankOfCorda.copyTo(config.pluginDir.resolve(bankOfCorda.name).toFile(), overwrite = true)
|
||||
log.info("Installed 'Bank of Corda' plugin")
|
||||
}
|
||||
}
|
||||
|
@ -2,22 +2,27 @@ package net.corda.demobench.profile
|
||||
|
||||
import com.typesafe.config.Config
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import javafx.stage.FileChooser
|
||||
import javafx.stage.FileChooser.ExtensionFilter
|
||||
import net.corda.demobench.model.InstallConfig
|
||||
import net.corda.demobench.model.InstallFactory
|
||||
import net.corda.demobench.model.JVMConfig
|
||||
import net.corda.demobench.model.NodeController
|
||||
import net.corda.demobench.plugin.PluginController
|
||||
import net.corda.demobench.plugin.inPluginsDir
|
||||
import net.corda.demobench.plugin.isPlugin
|
||||
import tornadofx.*
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.net.URI
|
||||
import java.nio.charset.StandardCharsets.UTF_8
|
||||
import java.nio.file.*
|
||||
import java.nio.file.FileSystems
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.util.*
|
||||
import java.util.function.BiPredicate
|
||||
import java.util.logging.Level
|
||||
import java.util.stream.StreamSupport
|
||||
import javafx.stage.FileChooser
|
||||
import javafx.stage.FileChooser.ExtensionFilter
|
||||
import net.corda.demobench.model.*
|
||||
import net.corda.demobench.plugin.PluginController
|
||||
import net.corda.demobench.plugin.inPluginsDir
|
||||
import net.corda.demobench.plugin.isPlugin
|
||||
import tornadofx.Controller
|
||||
|
||||
class ProfileController : Controller() {
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
package net.corda.demobench.pty
|
||||
|
||||
import com.jediterm.terminal.ui.*
|
||||
import com.jediterm.terminal.ui.JediTermWidget
|
||||
import com.jediterm.terminal.ui.UIUtil
|
||||
import com.jediterm.terminal.ui.settings.SettingsProvider
|
||||
import com.pty4j.PtyProcess
|
||||
import net.corda.core.utilities.loggerFor
|
||||
|
||||
import java.awt.*
|
||||
import java.awt.Dimension
|
||||
import java.io.IOException
|
||||
import java.nio.charset.StandardCharsets.UTF_8
|
||||
import java.util.concurrent.Executors
|
||||
|
@ -1,14 +1,14 @@
|
||||
package net.corda.demobench.rpc
|
||||
|
||||
import com.google.common.net.HostAndPort
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit.SECONDS
|
||||
import net.corda.client.rpc.CordaRPCClient
|
||||
import net.corda.core.messaging.CordaRPCOps
|
||||
import net.corda.core.utilities.loggerFor
|
||||
import net.corda.demobench.model.NodeConfig
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit.SECONDS
|
||||
|
||||
class NodeRPC(config: NodeConfig, start: () -> Unit, invoke: (CordaRPCOps) -> Unit): AutoCloseable {
|
||||
class NodeRPC(config: NodeConfig, start: () -> Unit, invoke: (CordaRPCOps) -> Unit) : AutoCloseable {
|
||||
|
||||
private companion object {
|
||||
val log = loggerFor<NodeRPC>()
|
||||
@ -33,7 +33,7 @@ class NodeRPC(config: NodeConfig, start: () -> Unit, invoke: (CordaRPCOps) -> Un
|
||||
start()
|
||||
|
||||
// Schedule a new task that will refresh the display once per second.
|
||||
timer.schedule(object: TimerTask() {
|
||||
timer.schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
invoke(ops)
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class PropertyLabel() : HBox() {
|
||||
val nameLabel = Label()
|
||||
val valueLabel = Label()
|
||||
|
||||
var name : String
|
||||
var name: String
|
||||
get() = nameLabel.text
|
||||
set(value) {
|
||||
nameLabel.text = value
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.corda.demobench.views
|
||||
|
||||
import java.util.*
|
||||
import javafx.application.Platform
|
||||
import javafx.scene.Parent
|
||||
import javafx.scene.control.Button
|
||||
@ -13,6 +12,7 @@ import net.corda.demobench.profile.ProfileController
|
||||
import net.corda.demobench.ui.CloseableTab
|
||||
import org.controlsfx.dialog.ExceptionDialog
|
||||
import tornadofx.*
|
||||
import java.util.*
|
||||
|
||||
class DemoBenchView : View("Corda DemoBench") {
|
||||
|
||||
|
@ -1,8 +1,5 @@
|
||||
package net.corda.demobench.views
|
||||
|
||||
import java.nio.file.Path
|
||||
import java.text.DecimalFormat
|
||||
import java.util.*
|
||||
import javafx.application.Platform
|
||||
import javafx.scene.control.SelectionMode.MULTIPLE
|
||||
import javafx.scene.input.KeyCode
|
||||
@ -12,6 +9,9 @@ import javafx.util.converter.NumberStringConverter
|
||||
import net.corda.demobench.model.*
|
||||
import net.corda.demobench.ui.CloseableTab
|
||||
import tornadofx.*
|
||||
import java.nio.file.Path
|
||||
import java.text.DecimalFormat
|
||||
import java.util.*
|
||||
|
||||
class NodeTabView : Fragment() {
|
||||
override val root = stackpane {}
|
||||
|
@ -3,9 +3,6 @@ package net.corda.demobench.views
|
||||
import com.jediterm.terminal.TerminalColor
|
||||
import com.jediterm.terminal.TextStyle
|
||||
import com.jediterm.terminal.ui.settings.DefaultSettingsProvider
|
||||
import java.awt.Dimension
|
||||
import java.util.logging.Level
|
||||
import javax.swing.SwingUtilities
|
||||
import javafx.application.Platform
|
||||
import javafx.embed.swing.SwingNode
|
||||
import javafx.scene.control.Button
|
||||
@ -13,13 +10,18 @@ import javafx.scene.control.Label
|
||||
import javafx.scene.layout.VBox
|
||||
import net.corda.client.rpc.notUsed
|
||||
import net.corda.demobench.explorer.ExplorerController
|
||||
import net.corda.demobench.model.*
|
||||
import net.corda.demobench.model.NodeConfig
|
||||
import net.corda.demobench.model.NodeController
|
||||
import net.corda.demobench.model.NodeState
|
||||
import net.corda.demobench.pty.R3Pty
|
||||
import net.corda.demobench.rpc.NodeRPC
|
||||
import net.corda.demobench.ui.PropertyLabel
|
||||
import net.corda.demobench.web.DBViewer
|
||||
import net.corda.demobench.web.WebServerController
|
||||
import tornadofx.Fragment
|
||||
import java.awt.Dimension
|
||||
import java.util.logging.Level
|
||||
import javax.swing.SwingUtilities
|
||||
|
||||
class NodeTerminalView : Fragment() {
|
||||
override val root by fxml<VBox>()
|
||||
|
@ -1,13 +1,13 @@
|
||||
package net.corda.demobench.web
|
||||
|
||||
import net.corda.core.utilities.loggerFor
|
||||
import java.sql.SQLException
|
||||
import java.util.concurrent.Executors
|
||||
import kotlin.reflect.jvm.jvmName
|
||||
import org.h2.Driver
|
||||
import org.h2.server.web.LocalWebServer
|
||||
import org.h2.tools.Server
|
||||
import org.h2.util.JdbcUtils
|
||||
import java.sql.SQLException
|
||||
import java.util.concurrent.Executors
|
||||
import kotlin.reflect.jvm.jvmName
|
||||
|
||||
class DBViewer : AutoCloseable {
|
||||
private companion object {
|
||||
|
@ -1,10 +1,10 @@
|
||||
package net.corda.demobench.web
|
||||
|
||||
import net.corda.core.utilities.loggerFor
|
||||
import net.corda.demobench.model.NodeConfig
|
||||
import net.corda.demobench.readErrorLines
|
||||
import java.io.IOException
|
||||
import java.util.concurrent.Executors
|
||||
import net.corda.core.utilities.loggerFor
|
||||
import net.corda.demobench.readErrorLines
|
||||
import net.corda.demobench.model.NodeConfig
|
||||
|
||||
class WebServer internal constructor(private val webServerController: WebServerController) : AutoCloseable {
|
||||
private companion object {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package net.corda.demobench.web
|
||||
|
||||
import net.corda.demobench.model.JVMConfig
|
||||
import tornadofx.Controller
|
||||
import tornadofx.*
|
||||
|
||||
class WebServerController : Controller() {
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
|
||||
<Loggers>
|
||||
<Root level="${sys:defaultLogLevel}">
|
||||
<AppenderRef ref="RollingFile-Appender" />
|
||||
<AppenderRef ref="RollingFile-Appender"/>
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
|
@ -1,3 +1,3 @@
|
||||
# Register SLF4JBridgeHandler as handler for the j.u.l. root logger
|
||||
# See http://www.slf4j.org/legacy.html#jul-to-slf4j
|
||||
handlers = org.slf4j.bridge.SLF4JBridgeHandler
|
||||
handlers=org.slf4j.bridge.SLF4JBridgeHandler
|
||||
|
@ -1,14 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.MenuBar?>
|
||||
<?import javafx.scene.control.Menu?>
|
||||
<?import javafx.scene.control.MenuItem?>
|
||||
<?import javafx.scene.control.TabPane?>
|
||||
<?import javafx.scene.layout.StackPane?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<VBox xmlns="http://javafx.com/javafx/8.0.102" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<MenuBar useSystemMenuBar="true">
|
||||
<Menu text="File">
|
||||
@ -17,10 +11,12 @@
|
||||
</Menu>
|
||||
</MenuBar>
|
||||
<StackPane VBox.vgrow="ALWAYS">
|
||||
<TabPane fx:id="nodeTabPane" minHeight="444.0" minWidth="800.0" prefHeight="613.0" prefWidth="1231.0" tabClosingPolicy="UNAVAILABLE" tabMinHeight="30.0"/>
|
||||
<Button fx:id="addNodeButton" mnemonicParsing="false" styleClass="add-node-button" text="Add Node" StackPane.alignment="TOP_RIGHT">
|
||||
<TabPane fx:id="nodeTabPane" minHeight="444.0" minWidth="800.0" prefHeight="613.0" prefWidth="1231.0"
|
||||
tabClosingPolicy="UNAVAILABLE" tabMinHeight="30.0"/>
|
||||
<Button fx:id="addNodeButton" mnemonicParsing="false" styleClass="add-node-button" text="Add Node"
|
||||
StackPane.alignment="TOP_RIGHT">
|
||||
<StackPane.margin>
|
||||
<Insets right="5.0" top="5.0" />
|
||||
<Insets right="5.0" top="5.0"/>
|
||||
</StackPane.margin>
|
||||
</Button>
|
||||
</StackPane>
|
||||
|
@ -1,26 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import net.corda.demobench.ui.PropertyLabel?>
|
||||
|
||||
<VBox visible="false" prefHeight="953.0" prefWidth="1363.0" xmlns="http://javafx.com/javafx/8.0.102" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import net.corda.demobench.ui.*?>
|
||||
<VBox visible="false" prefHeight="953.0" prefWidth="1363.0" xmlns="http://javafx.com/javafx/8.0.102"
|
||||
xmlns:fx="http://javafx.com/fxml/1">
|
||||
<HBox prefHeight="95.0" prefWidth="800.0" spacing="15.0" styleClass="header">
|
||||
<VBox prefHeight="66.0" prefWidth="296.0" spacing="20.0">
|
||||
<Label fx:id="nodeName" style="-fx-font-size: 40; -fx-text-fill: red;" />
|
||||
<PropertyLabel fx:id="p2pPort" name="P2P port: " />
|
||||
<Label fx:id="nodeName" style="-fx-font-size: 40; -fx-text-fill: red;"/>
|
||||
<PropertyLabel fx:id="p2pPort" name="P2P port: "/>
|
||||
</VBox>
|
||||
<VBox prefHeight="93.0" prefWidth="267.0">
|
||||
<PropertyLabel fx:id="states" name="States in vault: " />
|
||||
<PropertyLabel fx:id="transactions" name="Known transactions: " />
|
||||
<PropertyLabel fx:id="balance" name="Balance: " />
|
||||
<PropertyLabel fx:id="states" name="States in vault: "/>
|
||||
<PropertyLabel fx:id="transactions" name="Known transactions: "/>
|
||||
<PropertyLabel fx:id="balance" name="Balance: "/>
|
||||
</VBox>
|
||||
<Pane prefHeight="200.0" prefWidth="200.0" HBox.hgrow="ALWAYS" />
|
||||
<Button fx:id="viewDatabaseButton" disable="true" mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0" styleClass="big-button" text="View Database" textAlignment="CENTER" />
|
||||
<Button fx:id="launchWebButton" disable="true" mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0" styleClass="big-button" text="Launch Web Server" textAlignment="CENTER" />
|
||||
<Button fx:id="launchExplorerButton" disable="true" mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0" styleClass="big-button" text="Launch Explorer" textAlignment="CENTER" />
|
||||
<Pane prefHeight="200.0" prefWidth="200.0" HBox.hgrow="ALWAYS"/>
|
||||
<Button fx:id="viewDatabaseButton" disable="true" mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0"
|
||||
styleClass="big-button" text="View Database" textAlignment="CENTER"/>
|
||||
<Button fx:id="launchWebButton" disable="true" mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0"
|
||||
styleClass="big-button" text="Launch Web Server" textAlignment="CENTER"/>
|
||||
<Button fx:id="launchExplorerButton" disable="true" mnemonicParsing="false" prefHeight="92.0" prefWidth="115.0"
|
||||
styleClass="big-button" text="Launch Explorer" textAlignment="CENTER"/>
|
||||
</HBox>
|
||||
</VBox>
|
||||
|
@ -1,11 +1,12 @@
|
||||
package net.corda.demobench.model
|
||||
|
||||
import com.jediterm.terminal.ui.UIUtil
|
||||
import org.junit.Test
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.Paths
|
||||
import kotlin.test.*
|
||||
import org.junit.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class JVMConfigTest {
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package net.corda.demobench.model
|
||||
|
||||
import kotlin.test.*
|
||||
import org.junit.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class NetworkMapConfigTest {
|
||||
|
||||
|
@ -31,19 +31,19 @@ class NodeConfigTest {
|
||||
@Test
|
||||
fun `test node directory`() {
|
||||
val config = createConfig(legalName = "My Name")
|
||||
assertEquals(baseDir/"myname", config.nodeDir)
|
||||
assertEquals(baseDir / "myname", config.nodeDir)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test explorer directory`() {
|
||||
val config = createConfig(legalName = "My Name")
|
||||
assertEquals(baseDir/"myname-explorer", config.explorerDir)
|
||||
assertEquals(baseDir / "myname-explorer", config.explorerDir)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `test plugin directory`() {
|
||||
val config = createConfig(legalName = "My Name")
|
||||
assertEquals(baseDir/"myname"/"plugins", config.pluginDir)
|
||||
assertEquals(baseDir / "myname" / "plugins", config.pluginDir)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -231,11 +231,11 @@ class NodeConfigTest {
|
||||
fun `test moving`() {
|
||||
val config = createConfig(legalName = "My Name")
|
||||
|
||||
val elsewhere = baseDir/"elsewhere"
|
||||
val elsewhere = baseDir / "elsewhere"
|
||||
val moved = config.moveTo(elsewhere)
|
||||
assertEquals(elsewhere/"myname", moved.nodeDir)
|
||||
assertEquals(elsewhere/"myname-explorer", moved.explorerDir)
|
||||
assertEquals(elsewhere/"myname"/"plugins", moved.pluginDir)
|
||||
assertEquals(elsewhere / "myname", moved.nodeDir)
|
||||
assertEquals(elsewhere / "myname-explorer", moved.explorerDir)
|
||||
assertEquals(elsewhere / "myname" / "plugins", moved.pluginDir)
|
||||
}
|
||||
|
||||
private fun createConfig(
|
||||
|
@ -1,15 +1,15 @@
|
||||
package net.corda.demobench.model
|
||||
|
||||
import net.corda.nodeapi.User
|
||||
import org.junit.Test
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.Paths
|
||||
import kotlin.test.*
|
||||
import org.junit.Test
|
||||
|
||||
class NodeControllerTest {
|
||||
|
||||
private val baseDir: Path = Paths.get(".").toAbsolutePath()
|
||||
private val controller = NodeController({_,_ ->})
|
||||
private val controller = NodeController({ _, _ -> })
|
||||
|
||||
@Test
|
||||
fun `test unique nodes after validate`() {
|
||||
|
@ -1,7 +1,9 @@
|
||||
package net.corda.demobench.model
|
||||
|
||||
import kotlin.test.*
|
||||
import org.junit.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertNotNull
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class ServiceControllerTest {
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
<Appenders>
|
||||
<Console name="Console-Appender" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%date %highlight{%level %c{1}.%M - %msg%n}{INFO=white,WARN=red,FATAL=bright red}" />
|
||||
<PatternLayout pattern="%date %highlight{%level %c{1}.%M - %msg%n}{INFO=white,WARN=red,FATAL=bright red}"/>
|
||||
</Console>
|
||||
</Appenders>
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
import java.io.File;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.*;
|
||||
import java.nio.file.*;
|
||||
import java.util.*;
|
||||
|
||||
public class ExplorerCaplet extends Capsule {
|
||||
|
||||
|
@ -12,12 +12,12 @@ val Positivity.sign: String get() = when (this) {
|
||||
Positivity.Negative -> "-"
|
||||
}
|
||||
|
||||
data class AmountDiff<T: Any>(
|
||||
data class AmountDiff<T : Any>(
|
||||
val positivity: Positivity,
|
||||
val amount: Amount<T>
|
||||
) {
|
||||
companion object {
|
||||
fun <T: Any> fromLong(quantity: Long, token: T) =
|
||||
fun <T : Any> fromLong(quantity: Long, token: T) =
|
||||
AmountDiff(
|
||||
positivity = if (quantity < 0) Positivity.Negative else Positivity.Positive,
|
||||
amount = Amount(Math.abs(quantity), token)
|
||||
|
@ -4,9 +4,7 @@ import de.jensd.fx.glyphs.fontawesome.FontAwesomeIcon
|
||||
import javafx.beans.property.SimpleObjectProperty
|
||||
import javafx.collections.ObservableList
|
||||
import javafx.scene.Node
|
||||
import tornadofx.View
|
||||
import tornadofx.find
|
||||
import tornadofx.observable
|
||||
import tornadofx.*
|
||||
|
||||
class CordaViewModel {
|
||||
val selectedView = SimpleObjectProperty<CordaView>()
|
||||
|
@ -1,14 +1,14 @@
|
||||
package net.corda.explorer.model
|
||||
|
||||
import javafx.collections.ObservableList
|
||||
import net.corda.client.jfx.utils.ChosenList
|
||||
import net.corda.client.jfx.utils.map
|
||||
import net.corda.client.jfx.model.NetworkIdentityModel
|
||||
import net.corda.client.jfx.model.observableList
|
||||
import net.corda.client.jfx.model.observableValue
|
||||
import net.corda.client.jfx.utils.ChosenList
|
||||
import net.corda.client.jfx.utils.map
|
||||
import net.corda.core.contracts.currency
|
||||
import net.corda.core.node.NodeInfo
|
||||
import tornadofx.observable
|
||||
import tornadofx.*
|
||||
|
||||
val ISSUER_SERVICE_TYPE = Regex("corda.issuer.(USD|GBP|CHF)")
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
package net.corda.explorer.model
|
||||
|
||||
import javafx.beans.value.ObservableValue
|
||||
import net.corda.client.jfx.utils.AmountBindings
|
||||
import net.corda.client.jfx.model.ExchangeRate
|
||||
import net.corda.client.jfx.model.ExchangeRateModel
|
||||
import net.corda.client.jfx.model.observableValue
|
||||
import net.corda.client.jfx.utils.AmountBindings
|
||||
import net.corda.core.contracts.Amount
|
||||
import net.corda.core.contracts.CHF
|
||||
import net.corda.core.contracts.GBP
|
||||
import net.corda.core.contracts.USD
|
||||
import org.fxmisc.easybind.EasyBind
|
||||
import tornadofx.observable
|
||||
import tornadofx.*
|
||||
import java.util.*
|
||||
|
||||
class ReportingCurrencyModel {
|
||||
|
@ -8,7 +8,7 @@ import net.corda.core.contracts.currency
|
||||
import net.corda.core.createDirectories
|
||||
import net.corda.core.div
|
||||
import net.corda.core.exists
|
||||
import tornadofx.Component
|
||||
import tornadofx.*
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.Paths
|
||||
|
@ -1,10 +1,10 @@
|
||||
package net.corda.explorer.plugin
|
||||
|
||||
import net.corda.flows.IssuerFlow
|
||||
import net.corda.core.contracts.Amount
|
||||
import net.corda.core.crypto.Party
|
||||
import net.corda.core.node.CordaPluginRegistry
|
||||
import net.corda.core.serialization.OpaqueBytes
|
||||
import net.corda.flows.IssuerFlow
|
||||
import java.util.function.Function
|
||||
|
||||
class ExplorerPlugin : CordaPluginRegistry() {
|
||||
|
@ -90,4 +90,5 @@ fun <A, B> Collection<A>.cross(other: Collection<B>) = this.flatMap { a -> other
|
||||
|
||||
// TODO: This is a temporary fix for the UI to show the correct issuer identity, this will break when we start randomizing keys. More work is needed here when the identity work is done.
|
||||
fun StateAndRef<Cash.State>.resolveIssuer(): ObservableValue<Party?> = state.data.amount.token.issuer.party.resolveIssuer()
|
||||
|
||||
fun AnonymousParty.resolveIssuer(): ObservableValue<Party?> = Models.get(NetworkIdentityModel::class, javaClass.kotlin).lookup(owningKey).map { it?.legalIdentity }
|
||||
|
@ -16,8 +16,7 @@ import javafx.scene.input.MouseButton
|
||||
import javafx.scene.input.MouseEvent
|
||||
import net.corda.client.jfx.utils.ChosenList
|
||||
import net.corda.client.jfx.utils.map
|
||||
import tornadofx.UIComponent
|
||||
import tornadofx.observable
|
||||
import tornadofx.*
|
||||
|
||||
/**
|
||||
* Generic search bar filters [ObservableList] with provided filterCriteria.
|
||||
|
@ -158,15 +158,15 @@
|
||||
-fx-background-color: -color-4;
|
||||
}
|
||||
|
||||
.certificateButton.button, .certificateButton.button:hover{
|
||||
.certificateButton.button, .certificateButton.button:hover {
|
||||
-fx-background-color: transparent;
|
||||
}
|
||||
|
||||
.certificateIcon{
|
||||
.certificateIcon {
|
||||
-fx-fill: -color-2;
|
||||
}
|
||||
|
||||
.certificateIcon:hover{
|
||||
.certificateIcon:hover {
|
||||
-fx-fill: -color-3;
|
||||
}
|
||||
|
||||
@ -253,6 +253,7 @@
|
||||
#setting-edit-label:hover .text, #setting-edit-label:hover .glyph-icon {
|
||||
-fx-fill: -color-4;
|
||||
}
|
||||
|
||||
/* Styles for firing bullets between nodes in Network view. */
|
||||
.bullet {
|
||||
-fx-fill: black;
|
||||
|
@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?>
|
||||
<DialogPane styleClass="login" stylesheets="@../css/corda.css" xmlns="http://javafx.com/javafx/8.0.112-ea"
|
||||
xmlns:fx="http://javafx.com/fxml/1">
|
||||
<padding>
|
||||
|
@ -30,7 +30,7 @@ dependencies {
|
||||
}
|
||||
|
||||
run {
|
||||
if (project.hasProperty('loadtest-config') ) {
|
||||
if (project.hasProperty('loadtest-config')) {
|
||||
args project["loadtest-config"]
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import com.jcraft.jsch.*
|
||||
import com.jcraft.jsch.agentproxy.AgentProxy
|
||||
import com.jcraft.jsch.agentproxy.connector.SSHAgentConnector
|
||||
import com.jcraft.jsch.agentproxy.usocket.JNAUSocketFactory
|
||||
import kotlin.streams.toList
|
||||
import net.corda.client.rpc.CordaRPCClient
|
||||
import net.corda.core.messaging.CordaRPCOps
|
||||
import net.corda.node.driver.PortAllocation
|
||||
@ -13,6 +12,7 @@ import org.slf4j.LoggerFactory
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.Closeable
|
||||
import java.util.*
|
||||
import kotlin.streams.toList
|
||||
|
||||
private val log = LoggerFactory.getLogger(ConnectionManager::class.java)
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package net.corda.loadtest
|
||||
|
||||
import net.corda.client.mock.Generator
|
||||
import net.corda.core.div
|
||||
import net.corda.node.driver.PortAllocation
|
||||
import net.corda.node.services.network.NetworkMapService
|
||||
import net.corda.node.services.transactions.ValidatingNotaryService
|
||||
|
@ -214,6 +214,7 @@ fun commandGenerator(partiesToPickFrom: Collection<Party>): Generator<Pair<Comma
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
val partyGenerator: Generator<Party> = Generator.int().combine(publicKeyGenerator) { n, key -> Party("Party$n", key) }
|
||||
|
||||
fun <A> pickOneOrMaybeNew(from: Collection<A>, generator: Generator<A>): Generator<A> {
|
||||
|
@ -44,17 +44,21 @@ import java.util.concurrent.atomic.AtomicInteger
|
||||
interface VerifierExposedDSLInterface : DriverDSLExposedInterface {
|
||||
/** Starts a lightweight verification requestor that implements the Node's Verifier API */
|
||||
fun startVerificationRequestor(name: String): ListenableFuture<VerificationRequestorHandle>
|
||||
|
||||
/** Starts an out of process verifier connected to [address] */
|
||||
fun startVerifier(address: HostAndPort): ListenableFuture<VerifierHandle>
|
||||
|
||||
/**
|
||||
* Waits until [number] verifiers are listening for verification requests coming from the Node. Check
|
||||
* [VerificationRequestorHandle.waitUntilNumberOfVerifiers] for an equivalent for requestors.
|
||||
*/
|
||||
fun NodeHandle.waitUntilNumberOfVerifiers(number: Int)
|
||||
}
|
||||
|
||||
/** Starts a verifier connecting to the specified node */
|
||||
fun VerifierExposedDSLInterface.startVerifier(nodeHandle: NodeHandle) =
|
||||
startVerifier(nodeHandle.configuration.p2pAddress)
|
||||
|
||||
/** Starts a verifier connecting to the specified requestor */
|
||||
fun VerifierExposedDSLInterface.startVerifier(verificationRequestorHandle: VerificationRequestorHandle) =
|
||||
startVerifier(verificationRequestorHandle.p2pAddress)
|
||||
@ -190,6 +194,7 @@ data class VerifierDriverDSL(
|
||||
val securityManager = object : ActiveMQSecurityManager {
|
||||
// We don't need auth, SSL is good enough
|
||||
override fun validateUser(user: String?, password: String?) = true
|
||||
|
||||
override fun validateUserAndRole(user: String?, password: String?, roles: MutableSet<Role>?, checkType: CheckType?) = true
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user