Project

General

Profile

Download (6.9 KB) Statistics
| Branch: | Tag: | Revision:
1
#
2
# NOTE: this is the unitils.properties file for the cdmlib-persistence module
3
# a separate unitils.properties exists for cdmlib-io and for cdmlib-services
4
#
5
#
6
# the list of all properties is found in
7
# http://unitils.org/unitils-default.properties
8
#
9

    
10
### Unitils Modules ###
11
# List of modules that is loaded. Overloading this list is normally not useful, unless you want to add a custom
12
# module. Disabling a module can be performed by setting unitils.module.<modulename>.enabled to false.
13
# If a module's specific dependencies are not found (e.g. hibernate is not in you classpath), this module is not loaded,
14
# even if it is in this list and the enabled property is set to true. It's therefore not strictly necessary to disable
15
# any of these modules.
16
#DEFAULT: unitils.modules=database,dbunit,hibernate,mock,easymock,inject,spring,jpa
17
unitils.module.easymock.enabled=false
18
unitils.module.mock.enabled=false
19

    
20

    
21
### Database ###
22
#
23
# Name or path of the user specific properties file. This file should contain the necessary parameters to connect to the
24
# developer's own unit test schema. It is recommended to override the name of this file in the project specific properties
25
# file, to include the name of the project. The system will try to find this file in the classpath, the user home folder
26
# (recommended) or the local filesystem.
27
#
28
unitils.configuration.localFileName=unitils-cdmlib-local.properties
29
#
30
updateDataBaseSchema.enabled=true
31
#
32
dataSetStructureGenerator.xsd.dirName=src/test/resources/eu/etaxonomy/cdm/database/schema
33
#
34
# Fully qualified name of the implementation of org.unitils.dbmaintainer.maintainer.script.ScriptSource that is used.
35
# The default value is 'org.unitils.dbmaintainer.maintainer.script.FileScriptSource', which will retrieve the scripts
36
# from the local file system.
37
org.unitils.dbmaintainer.script.ScriptSource.implClassName=org.unitils.dbmaintainer.script.impl.ResourceScriptSource
38

    
39
dbMaintainer.script.locations=dbscripts
40
#dbMaintainer.script.locations=src/test/resources/dbscripts  - requires ScriptSource.implClassName=...DefaultScriptSource
41

    
42
dbMaintainer.dbVersionSource.autoCreateVersionTable=true
43

    
44
dbMaintainer.autoCreateExecutedScriptsTable=true
45

    
46
#
47
# default database configurations for HSQL, H2 and MYSQL:
48
#
49

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

    
66
# H2 #
67
#
68
database.driverClassName=org.h2.Driver
69
# -----------------------------------------
70
# memory based db - default
71
database.url=jdbc:h2:mem:cdm
72
# use server based h2 -
73
# either 
74
# A. start a h2 server locally for the below url 
75
# or
76
# B. use the  -Dh2Server as jvm argument, see CdmIntegrationTest.startH2Server()) 
77
#database.url= jdbc:h2:tcp://localhost/~/cdm
78
# file based - 
79
#database.url=jdbc:h2:file:~/.h2/cdm
80
# -----------------------------------------
81
database.dialect=h2
82
dbMaintainer.script.fileExtensions=h2.sql
83
database.userName=sa
84
database.password=
85
database.schemaNames=PUBLIC
86
org.dbunit.dataset.datatype.IDataTypeFactory.implClassName.h2=org.dbunit.ext.h2.H2DataTypeFactory
87
#org.dbunit.dataset.datatype.IDataTypeFactory.implClassName=org.dbunit.ext.h2.H2DataTypeFactory
88
#maybe we can replace this by org.unitils.core.dbsupport.H2DbSupport
89
org.unitils.core.dbsupport.DbSupport.implClassName.h2=eu.etaxonomy.cdm.database.H2DbSupport  
90
database.storedIndentifierCase.h2=auto
91
database.identifierQuoteString.h2=auto
92

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

    
115

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

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

    
137
### Hibernate ###
138
#
139
HibernateModule.configuration.implClassName=org.hibernate.cfg.Configuration
140

    
141
## Same as defined in hibernate.cfg.xml.
142
hibernate.connection.provider_class=org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl
143

    
144
#Created for hibernate 5 support, not yet available in standard unitils 
145
unitils.module.hibernate.className=org.unitils.orm.hibernate.Hibernate5Module
146

    
147
#Since Hibernate 5 (or earlier > 4.1.10) using the Proxy does not correctly release 
148
#the connections to the pool after transaction finishes.
149
dataSource.wrapInTransactionalProxy=false
(2-2/2)