Refactor BFTNotaryServicetest and MySQLNotaryServiceTest to allow running database integration tests. (#211)

* BFTNotaryServiceTests.kt - instantiate MockServices before each test, not at the class level - to allow database integration test clean database before each test.
* MySQLNotaryServiceTests.kt - use H2 datasource for the notary in database integration tests (and as it was before during standard integration tests)
* Revert Enterprise way of makeTestDataSourceProperties MockNode.kt.
* Minor attempt to refactor Enterprise only parts of reading database config and make it less error prone during OS->Enterprise merge.
This commit is contained in:
szymonsztuka
2017-12-21 13:24:13 +00:00
committed by GitHub
parent 4b42600f6a
commit 269a4ba79d
5 changed files with 68 additions and 54 deletions

View File

@ -6,12 +6,9 @@ import net.corda.core.utilities.contextLogger
import net.corda.core.utilities.toHexString
import org.hibernate.SessionFactory
import org.hibernate.boot.MetadataSources
import org.hibernate.boot.model.naming.Identifier
import org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
import org.hibernate.boot.registry.BootstrapServiceRegistryBuilder
import org.hibernate.cfg.Configuration
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment
import org.hibernate.service.UnknownUnwrapTypeException
import org.hibernate.type.AbstractSingleColumnStandardBasicType
import org.hibernate.type.descriptor.java.PrimitiveByteArrayTypeDescriptor