[ENT-1153] fix merge - revert feature for database integration test (Enterprise feature)

This commit is contained in:
szymonsztuka 2017-11-29 10:51:49 +00:00
parent 7d75d95dc2
commit c32c21bc48
4 changed files with 6 additions and 7 deletions

View File

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

View File

@ -18,7 +18,6 @@ import net.corda.core.utilities.getOrThrow
import net.corda.core.utilities.seconds
import net.corda.node.services.api.StartedNodeServices
import net.corda.node.services.config.CertChainPolicyConfig
import net.corda.node.services.config.DatabaseConfig
import net.corda.node.services.config.NodeConfiguration
import net.corda.node.services.config.VerifierType
import net.corda.nodeapi.User

View File

@ -27,7 +27,6 @@ import net.corda.node.internal.StartedNode
import net.corda.node.internal.cordapp.CordappLoader
import net.corda.node.services.api.SchemaService
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.NotaryConfig
import net.corda.node.services.keys.E2ETestKeyManagementService

View File

@ -109,8 +109,10 @@ open class MockServices(
* @param nodeName Reflects the "instance" of the in-memory database or database username/schema.
*/
@JvmStatic
fun makeTestDatabaseProperties(nodeName: String? = null): DatabaseConfig =
DatabaseConfig(nodeOrganizationName = nodeName)
fun makeTestDatabaseProperties(nodeName: String? = null): DatabaseConfig {
val config = readDatabaseConfig(nodeName)
return DatabaseConfig(schema = if (config.hasPath("database.schema")) config.getString("database.schema") else "")
}
/**
* Creates an instance of [InMemoryIdentityService] with [MOCK_IDENTITIES].
@ -145,7 +147,7 @@ open class MockServices(
initialIdentityName: CordaX500Name): Pair<CordaPersistence, MockServices> {
val cordappLoader = CordappLoader.createWithTestPackages(cordappPackages)
val dataSourceProps = makeTestDataSourceProperties()
val database = configureDatabase(dataSourceProps, DatabaseConfig(), identityService, NodeSchemaService(cordappLoader))
val database = configureDatabase(dataSourceProps, makeTestDatabaseProperties(), identityService, NodeSchemaService(cordappLoader))
val mockService = database.transaction {
object : MockServices(cordappLoader, initialIdentityName = initialIdentityName, keys = *(keys.toTypedArray())) {
override val identityService get() = identityService