Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

cdmlib / cdmlib-test / src / main / resources / eu / etaxonomy / cdm / applicationContext-test.common.xml @ 2638be38

History | View | Annotate | Download (5.36 KB)

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

    
42
    <!-- enable the configuration of transactional behavior based on annotations -->
43
    <tx:annotation-driven transaction-manager="transactionManager"/>
44

    
45
    <bean id="hibernateProperties"
46
        class="org.springframework.beans.factory.config.PropertiesFactoryBean">
47
        <!--
48
            NOTE:
49
            the database connection is configured in /cdmlib-persistence/src/test/resources/unitils.properties
50
        -->
51
        <property name="properties">
52
            <props>
53
                <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.internal.NoCachingRegionFactory</prop>
54
                <prop key="hibernate.show_sql">false</prop>
55
                <prop key="hibernate.format_sql">false</prop>
56
                <prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.impl.FSDirectoryProvider</prop>
57
                <prop key="hibernate.search.default.indexBase">./target/index</prop>
58
                <!--  hibernate.search.default.exclusive_index_use=false
59
                      locks must not only be released after application shutdown in test environment -->
60
                <prop key="hibernate.search.default.exclusive_index_use">false</prop>
61
                <prop key="hibernate.dialect">org.hibernate.dialect.H2CorrectedDialectTest</prop>
62
                <prop key="implicitNamingStrategy">org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl"</prop>
63
                <!-- hsqldb v. <1.9 has a bug (http://sourceforge.net/tracker/?func=detail&atid=378131&aid=1407528&group_id=23316)
64
                    due to which it is not possible to use batch updates, so we need to disable
65
                    hibernate batching when using hsqldb in the app context: -->
66
                <prop key="hibernate.jdbc.batch_size">0</prop>
67
            </props>
68
        </property>
69
    </bean>
70

    
71
    <bean id="tableGeneratorGlobalOverride"
72
        class="eu.etaxonomy.cdm.persistence.hibernate.TableGeneratorGlobalOverride">
73
        <property name="properties">
74
            <props>
75
                <!-- globally overriding id generation settings see: eu.etaxonomy.cdm.persistence.hibernate.TableGenerator -->
76
                <prop key="optimizer">none</prop>
77
                <prop key="initial_value">5000</prop><!-- must be higher than any term id in TermsDataSet.xml -->
78
            </props>
79
        </property>
80
    </bean>
81

    
82
    <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
83
       <constructor-arg>
84
            <list>
85
                <bean class="org.springframework.security.authentication.TestingAuthenticationProvider"/>
86
            </list>
87
        </constructor-arg>
88
    </bean>
89

    
90
<!--
91
    We do not use spelling suggestions anymore. This one relates to springmodules which is
92
    somewhat outdated. Once we work again with spelling suggestions we better use a modern
93
    approache, e.g. annotation based.
94
    <bean id="taxonSpellingDirectory" class="org.springmodules.lucene.index.support.FSDirectoryFactoryBean">
95
      <property name="location" value="file:./target/index/eu.etaxonomy.cdm.model.taxon.TaxonBase_spelling"/>
96
      <property name="create" value="true"/>
97
    </bean> -->
98

    
99
</beans>
Add picture from clipboard (Maximum size: 40 MB)