Project

General

Profile

« Previous | Next » 

Revision 2969d864

Added by Andreas Kohlbecker about 4 years ago

implementing test framework for integration tests and setting up SpecimenTypeDesignationWorkingService tests

View differences:

src/test/resources/unitils-alternativeRunner.properties
4 4
# This configuration
5 5
#
6 6
# 
7
########################################################################
8
#
7
#########################################################################
9 8
# NOTE: this is the unitils.properties file for the cdmlib-persistence module
10 9
# a separate unitils.properties exists for cdmlib-io and for cdmlib-services
11 10
#
......
15 14
#
16 15

  
17 16
### Unitils Modules ###
18
#
19 17
# List of modules that is loaded. Overloading this list is normally not useful, unless you want to add a custom
20 18
# module. Disabling a module can be performed by setting unitils.module.<modulename>.enabled to false.
21 19
# If a module's specific dependencies are not found (e.g. hibernate is not in you classpath), this module is not loaded,
......
34 32
# (recommended) or the local filesystem.
35 33
#
36 34
unitils.configuration.localFileName=unitils-cdmlib-local.properties
35
#
36
updateDataBaseSchema.enabled=true
37
#
38
dataSetStructureGenerator.xsd.dirName=src/test/resources/eu/etaxonomy/cdm/database/schema
39
#
40
# Fully qualified name of the implementation of org.unitils.dbmaintainer.maintainer.script.ScriptSource that is used.
41
# The default value is 'org.unitils.dbmaintainer.maintainer.script.FileScriptSource', which will retrieve the scripts
42
# from the local file system.
43
org.unitils.dbmaintainer.script.ScriptSource.implClassName=org.unitils.dbmaintainer.script.impl.ResourceScriptSource
44

  
45
dbMaintainer.script.locations=dbscripts
46
#dbMaintainer.script.locations=src/test/resources/dbscripts  - requires ScriptSource.implClassName=...DefaultScriptSource
47

  
48
dbMaintainer.dbVersionSource.autoCreateVersionTable=true
49

  
50
dbMaintainer.autoCreateExecutedScriptsTable=true
51

  
52
#
53
# default database configurations for HSQL, H2 and MYSQL:
54
#
55

  
56
# HSQL #
57
#
58
#   NOTE: hsqldb v. <1.9 has a bug (http://sourceforge.net/tracker/?func=detail&atid=378131&aid=1407528&group_id=23316)
59
#         due to which it is not possible to use batch updates, so we need to disable hibernate batching when using
60
#         hsqldb in the app context:
61
#
62
#database.driverClassName=org.hsqldb.jdbcDriver
63
#database.url=jdbc:hsqldb:mem:cdm
64
##database.url=jdbc:hsqldb:file:/home/andreas/.hsqldb/cdm;hsqldb.default_table_type=cached
65
#database.dialect=hsqldb
66
#dbMaintainer.script.fileExtensions=hsqldb.ddl
67
#database.userName=sa
68
#database.password=
69
#database.schemaNames=PUBLIC
70
#org.dbunit.dataset.datatype.IDataTypeFactory.implClassName.hsqldb=org.dbunit.ext.hsqldb.HsqldbDataTypeFactory
37 71

  
38 72
# H2 #
73
#
39 74
database.driverClassName=org.h2.Driver
40 75
database.url=jdbc:h2:mem:cdm
76
#database.url=jdbc:h2:file:~/.h2/cdm
41 77
database.dialect=h2
78
dbMaintainer.script.fileExtensions=h2.sql
42 79
database.userName=sa
43 80
database.password=
44 81
database.schemaNames=PUBLIC
45 82
org.dbunit.dataset.datatype.IDataTypeFactory.implClassName.h2=org.dbunit.ext.h2.H2DataTypeFactory
46
org.unitils.core.dbsupport.DbSupport.implClassName.h2=eu.etaxonomy.cdm.database.H2DbSupport
83
#org.dbunit.dataset.datatype.IDataTypeFactory.implClassName=org.dbunit.ext.h2.H2DataTypeFactory
84
#maybe we can replace this by org.unitils.core.dbsupport.H2DbSupport
85
org.unitils.core.dbsupport.DbSupport.implClassName.h2=eu.etaxonomy.cdm.database.H2DbSupport  
47 86
database.storedIndentifierCase.h2=auto
87
database.identifierQuoteString.h2=auto
48 88

  
49
#Since Hibernate 5 (or earlier > 4.1.10) using the Proxy does not correctly release 
50
#the connections to the pool after transaction finishes.
51
dataSource.wrapInTransactionalProxy=false
52

  
89
#
90
# MySQL #
91
# cannot be used
92
# 1. you need another ddl or sql file to generate the schema
93
# 2. our DataSet xml files and the dataset.dtd contain upper-case table names like
94
#    'TERMVOCABULARY_REPRESENTATION_AUD'  but hibernate expects CamelCase with mysql !!!!
95
#    maybe we can workaround this by implementing a custom EJB3NamingStrategy like
96
#    UppercaseTableNamingStrategy it must be set in the persitence.xml which returns table names
97
#    always in uppercase, but this again causes problems with the @Tabel annotations which must
98
#    exactly match the table names in the database. This means in order to use mysql for tests we would
99
#    have to change the table names in all of our DataSet files.
100
#
101
#database.driverClassName=com.mysql.jdbc.Driver
102
#database.url=jdbc:mysql://127.0.0.1:3306/test
103
#database.userName=edit
104
#database.password=wp5
105
#database.dialect=mysql
106
#database.schemaNames=test
107
#dbMaintainer.script.fileExtensions=mysql.sql
108
#org.dbmaintain.dbsupport.DbSupport.implClassName.mysql=org.dbmaintain.dbsupport.impl.MySqlDbSupport
109
#org.dbunit.dataset.datatype.IDataTypeFactory.implClassName.mysqldb=org.dbunit.ext.mysql.MySqlDataTypeFactory
53 110

  
54 111

  
112
#### Transaction mode ###
113
#
114
# If set to commit or rollback, each test is run in a transaction,
115
# which is committed or rolled back after the test is finished.
116
# Since we have many tests with incomplete data these tests would be
117
# failing during commit so it is better use rollback as default
118
# and set commit for individual test where necessary
119
DatabaseModule.Transactional.value.default=rollback
55 120

  
121
# org.unitils.database.transaction.impl.DefaultUnitilsTransactionManager is used by default:
122
#
123
#   Implements transactions for unit tests, by delegating to a spring PlatformTransactionManager.
124
#   The concrete implementation of PlatformTransactionManager that is used depends on the test class.
125
#   If a custom PlatformTransactionManager was configured in a spring ApplicationContext, this one is used.
126
#   If not, a suitable subclass of PlatformTransactionManager is created, depending on the configuration
127
#   of a test. E.g. if some ORM persistence unit was configured on the test, a PlatformTransactionManager
128
#   that can offer transactional behavior for such a persistence unit is used.
129
#   If no such configuration is found, a DataSourceTransactionManager is used.
130
#
131
# org.unitils.database.transaction.UnitilsTransactionManager.implClassName=org.unitils.database.transaction.impl.SpringTransactionManager
56 132

  
133
### Hibernate ###
134
#
135
HibernateModule.configuration.implClassName=org.hibernate.cfg.Configuration
57 136

  
137
## Same as defined in hibernate.cfg.xml.
138
hibernate.connection.provider_class=org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl
58 139

  
140
#Created for hibernate 5 support, not yet available in standard unitils 
141
unitils.module.hibernate.className=org.unitils.orm.hibernate.Hibernate5Module
59 142

  
143
#Since Hibernate 5 (or earlier > 4.1.10) using the Proxy does not correctly release 
144
#the connections to the pool after transaction finishes.
145
dataSource.wrapInTransactionalProxy=false

Also available in: Unified diff