[ENT-1153]: fix merge

This commit is contained in:
Tudor Malene 2017-11-27 16:55:06 +00:00 committed by tudor.malene@gmail.com
parent e8d833c2fe
commit a982bb2ae6
4 changed files with 7 additions and 6 deletions

View File

@ -46,7 +46,8 @@ data class DevModeOptions(val disableCheckpointChecker: Boolean = false)
data class DatabaseConfig( data class DatabaseConfig(
val initDatabase: Boolean = true, val initDatabase: Boolean = true,
val serverNameTablePrefix: String = "", val serverNameTablePrefix: String = "",
val transactionIsolationLevel: TransactionIsolationLevel = TransactionIsolationLevel.REPEATABLE_READ val transactionIsolationLevel: TransactionIsolationLevel = TransactionIsolationLevel.REPEATABLE_READ,
val schema: String? = null
) )
enum class TransactionIsolationLevel { enum class TransactionIsolationLevel {

View File

@ -58,9 +58,9 @@ class HibernateConfiguration(val schemaService: SchemaService, private val datab
.setProperty("hibernate.format_sql", "true") .setProperty("hibernate.format_sql", "true")
.setProperty("hibernate.connection.isolation", databaseConfig.transactionIsolationLevel.jdbcValue.toString()) .setProperty("hibernate.connection.isolation", databaseConfig.transactionIsolationLevel.jdbcValue.toString())
if (databaseProperties.getProperty("schema") != null) { if (databaseConfig.schema != null) {
// This property helps 'hibernate.hbm2ddl.auto' to work properly when many schemas have similar table names. // This property helps 'hibernate.hbm2ddl.auto' to work properly when many schemas have similar table names.
config.setProperty("hibernate.default_schema", databaseProperties.getProperty("schema")) config.setProperty("hibernate.default_schema", databaseConfig.schema)
} }
schemas.forEach { schema -> schemas.forEach { schema ->

View File

@ -64,7 +64,7 @@ fun testNodeConfiguration(
doReturn(emptyList<User>()).whenever(it).rpcUsers doReturn(emptyList<User>()).whenever(it).rpcUsers
doReturn(null).whenever(it).notary doReturn(null).whenever(it).notary
doReturn(makeTestDataSourceProperties(myLegalName.organisation)).whenever(it).dataSourceProperties doReturn(makeTestDataSourceProperties(myLegalName.organisation)).whenever(it).dataSourceProperties
doReturn(DatabaseConfig(myLegalName.organisation)).whenever(it).database doReturn(DatabaseConfig(serverNameTablePrefix = myLegalName.organisation)).whenever(it).database
doReturn("").whenever(it).emailAddress doReturn("").whenever(it).emailAddress
doReturn("").whenever(it).exportJMXto doReturn("").whenever(it).exportJMXto
doReturn(true).whenever(it).devMode doReturn(true).whenever(it).devMode

View File

@ -27,6 +27,7 @@ import net.corda.node.internal.StartedNode
import net.corda.node.internal.cordapp.CordappLoader import net.corda.node.internal.cordapp.CordappLoader
import net.corda.node.services.api.SchemaService import net.corda.node.services.api.SchemaService
import net.corda.node.services.config.BFTSMaRtConfiguration import net.corda.node.services.config.BFTSMaRtConfiguration
import net.corda.node.services.config.DatabaseConfig
import net.corda.node.services.config.NodeConfiguration import net.corda.node.services.config.NodeConfiguration
import net.corda.node.services.config.NotaryConfig import net.corda.node.services.config.NotaryConfig
import net.corda.node.services.keys.E2ETestKeyManagementService import net.corda.node.services.keys.E2ETestKeyManagementService
@ -40,7 +41,6 @@ import net.corda.node.utilities.CordaPersistence
import net.corda.testing.DUMMY_NOTARY import net.corda.testing.DUMMY_NOTARY
import net.corda.testing.node.MockServices.Companion.MOCK_VERSION_INFO import net.corda.testing.node.MockServices.Companion.MOCK_VERSION_INFO
import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties
import net.corda.testing.node.MockServices.Companion.makeTestDatabaseProperties
import net.corda.testing.setGlobalSerialization import net.corda.testing.setGlobalSerialization
import net.corda.testing.testNodeConfiguration import net.corda.testing.testNodeConfiguration
import org.apache.activemq.artemis.utils.ReusableLatch import org.apache.activemq.artemis.utils.ReusableLatch
@ -364,7 +364,7 @@ class MockNetwork(defaultParameters: MockNetworkParameters = MockNetworkParamete
baseDirectory = baseDirectory(id).createDirectories(), baseDirectory = baseDirectory(id).createDirectories(),
myLegalName = parameters.legalName ?: CordaX500Name(organisation = "Mock Company $id", locality = "London", country = "GB")).also { myLegalName = parameters.legalName ?: CordaX500Name(organisation = "Mock Company $id", locality = "London", country = "GB")).also {
doReturn(makeTestDataSourceProperties("node_$id", "net_$networkId")).whenever(it).dataSourceProperties doReturn(makeTestDataSourceProperties("node_$id", "net_$networkId")).whenever(it).dataSourceProperties
doReturn(makeTestDatabaseProperties("node_$id")).whenever(it).database doReturn(DatabaseConfig()).whenever(it).database
parameters.configOverrides(it) parameters.configOverrides(it)
} }
val node = nodeFactory(MockNodeArgs(config, this, id, parameters.entropyRoot)) val node = nodeFactory(MockNodeArgs(config, this, id, parameters.entropyRoot))