1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
3
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4
|
xmlns:context="http://www.springframework.org/schema/context"
|
5
|
xmlns:tx="http://www.springframework.org/schema/tx"
|
6
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
7
|
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
8
|
http://www.springframework.org/schema/context
|
9
|
http://www.springframework.org/schema/context/spring-context-4.0.xsd
|
10
|
http://www.springframework.org/schema/tx
|
11
|
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
|
12
|
|
13
|
<!--
|
14
|
========================================================================================
|
15
|
NOTE: this is application context configuration used by all testing contexts
|
16
|
in common, this file should be included into other contexts.
|
17
|
========================================================================================
|
18
|
-->
|
19
|
|
20
|
<!-- exclude persistent term initializer as we want to use the TestingTermInitializer instead -->
|
21
|
<context:component-scan base-package="eu/etaxonomy/cdm/persistence/"/>
|
22
|
|
23
|
<bean id="testingTermVocabularyDao" class="eu.etaxonomy.cdm.database.TestingTermVocabularyDao"/>
|
24
|
|
25
|
<bean id="termInitializer" class="eu.etaxonomy.cdm.database.TestingTermInitializer">
|
26
|
<property name="termsDataSet" value="classpath:/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml"/>
|
27
|
<property name="termsDtd" value="classpath:/eu/etaxonomy/cdm/database/schema/dataset.dtd"/>
|
28
|
</bean>
|
29
|
<!-- alternative way :
|
30
|
<bean id="testingTermInitializer" class="eu.etaxonomy.cdm.database.TestingTermInitializer">
|
31
|
<property name="termsDataSet" value="classpath:/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml"/>
|
32
|
<property name="termsDtd" value="classpath:/eu/etaxonomy/cdm/database/schema/dataset.dtd"/>
|
33
|
<property name="omit" value="false"/>
|
34
|
</bean>
|
35
|
<bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
|
36
|
<property name="omit" value="true"/>
|
37
|
</bean>
|
38
|
-->
|
39
|
|
40
|
<context:component-scan base-package="eu/etaxonomy/cdm/api/cache"/>
|
41
|
<context:component-scan base-package="eu/etaxonomy/cdm/api/config"/>
|
42
|
|
43
|
<!-- enable the configuration of transactional behavior based on annotations -->
|
44
|
<tx:annotation-driven transaction-manager="transactionManager"/>
|
45
|
|
46
|
<bean id="hibernateProperties"
|
47
|
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
|
48
|
<!--
|
49
|
NOTE:
|
50
|
the database connection is configured in /cdmlib-persistence/src/test/resources/unitils.properties
|
51
|
-->
|
52
|
<property name="properties">
|
53
|
<props>
|
54
|
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.internal.NoCachingRegionFactory</prop>
|
55
|
<prop key="hibernate.show_sql">false</prop>
|
56
|
<prop key="hibernate.format_sql">false</prop>
|
57
|
<prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.impl.FSDirectoryProvider</prop>
|
58
|
<prop key="hibernate.search.default.indexBase">./target/index</prop>
|
59
|
<!-- hibernate.search.default.exclusive_index_use=false
|
60
|
locks must not only be released after application shutdown in test environment -->
|
61
|
<prop key="hibernate.search.default.exclusive_index_use">false</prop>
|
62
|
<prop key="hibernate.dialect">org.hibernate.dialect.H2CorrectedDialectTest</prop>
|
63
|
<prop key="implicitNamingStrategy">org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl"</prop>
|
64
|
<!-- hsqldb v. <1.9 has a bug (http://sourceforge.net/tracker/?func=detail&atid=378131&aid=1407528&group_id=23316)
|
65
|
due to which it is not possible to use batch updates, so we need to disable
|
66
|
hibernate batching when using hsqldb in the app context: -->
|
67
|
<prop key="hibernate.jdbc.batch_size">0</prop>
|
68
|
</props>
|
69
|
</property>
|
70
|
</bean>
|
71
|
|
72
|
<bean id="tableGeneratorGlobalOverride"
|
73
|
class="eu.etaxonomy.cdm.persistence.hibernate.TableGeneratorGlobalOverride">
|
74
|
<property name="properties">
|
75
|
<props>
|
76
|
<!-- globally overriding id generation settings see: eu.etaxonomy.cdm.persistence.hibernate.TableGenerator -->
|
77
|
<prop key="optimizer">none</prop>
|
78
|
<prop key="initial_value">5000</prop><!-- must be higher than any term id in TermsDataSet.xml -->
|
79
|
</props>
|
80
|
</property>
|
81
|
</bean>
|
82
|
|
83
|
<bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
|
84
|
<constructor-arg>
|
85
|
<list>
|
86
|
<bean class="org.springframework.security.authentication.TestingAuthenticationProvider"/>
|
87
|
</list>
|
88
|
</constructor-arg>
|
89
|
</bean>
|
90
|
|
91
|
<!--
|
92
|
We do not use spelling suggestions anymore. This one relates to springmodules which is
|
93
|
somewhat outdated. Once we work again with spelling suggestions we better use a modern
|
94
|
approache, e.g. annotation based.
|
95
|
<bean id="taxonSpellingDirectory" class="org.springmodules.lucene.index.support.FSDirectoryFactoryBean">
|
96
|
<property name="location" value="file:./target/index/eu.etaxonomy.cdm.model.taxon.TaxonBase_spelling"/>
|
97
|
<property name="create" value="true"/>
|
98
|
</bean> -->
|
99
|
|
100
|
</beans>
|