Project

General

Profile

Download (5.53 KB) Statistics
| Branch: | Tag: | Revision:
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.3.xsd
8
    http://www.springframework.org/schema/context
9
    http://www.springframework.org/schema/context/spring-context-4.3.xsd
10
    http://www.springframework.org/schema/tx
11
    http://www.springframework.org/schema/tx/spring-tx-4.3.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="dataBaseTablePrinter" class="eu.etaxonomy.cdm.database.DataBaseTablePrinter"/>
26

    
27
    <bean id="termInitializer" class="eu.etaxonomy.cdm.database.TestingTermInitializer">
28
        <property name="termsDataSet" value="classpath:/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml"/>
29
        <property name="termsDtd" value="classpath:/eu/etaxonomy/cdm/database/schema/dataset.dtd"/>
30
    </bean>
31
    <!-- alternative way :
32
    <bean id="testingTermInitializer" class="eu.etaxonomy.cdm.database.TestingTermInitializer">
33
        <property name="termsDataSet" value="classpath:/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml"/>
34
        <property name="termsDtd" value="classpath:/eu/etaxonomy/cdm/database/schema/dataset.dtd"/>
35
        <property name="omit" value="false"/>
36
    </bean>
37
    <bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
38
        <property name="omit" value="true"/>
39
    </bean>
40
     -->
41
     
42
    <context:component-scan base-package="eu/etaxonomy/cdm/api/cache"/>
43
    <context:component-scan base-package="eu/etaxonomy/cdm/api/config"/>
44

    
45
    <!-- enable the configuration of transactional behavior based on annotations -->
46
    <tx:annotation-driven transaction-manager="transactionManager"/>
47

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

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

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

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

    
102
</beans>
(1-1/3)