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 xsi:
schemaLocation=
"http://www.springframework.org/schema/beans
6 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
7 http://www.springframework.org/schema/context
8 http://www.springframework.org/schema/context/spring-context-2.5.xsd">
10 <import resource=
"classpath:/eu/etaxonomy/cdm/defaultIoApplicationContext.xml"/>
13 use TestingTermInitializer
15 <!-- exclude persistent term initializer as we want to use the TestingTermInitializer instead -->
16 <context:component-scan base-package=
"eu/etaxonomy/cdm">
17 <context:exclude-filter type=
"regex" expression=
"eu\.etaxonomy\.cdm\.database\.PersistentTermInitializer"/>
18 </context:component-scan>
19 <bean id=
"testingTermInitializer" class=
"eu.etaxonomy.cdm.database.TestingTermInitializer">
20 <property name=
"termsDataSet" value=
"classpath:/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml"/>
21 <property name=
"termsDtd" value=
"classpath:/eu/etaxonomy/cdm/persistence/dao/hibernate/dataset.dtd"/>
22 <property name=
"omit" value=
"false"/>
24 <!-- TODO remove <bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
25 <property name="omit" value="true"/>
31 the database connection is configured in /cdmlib-persistence/src/test/resources/unitils.properties
33 <bean id=
"dataSource" class=
"org.unitils.database.UnitilsDataSourceFactoryBean"/>
35 <bean id=
"hibernateProperties"
36 class=
"org.springframework.beans.factory.config.PropertiesFactoryBean">
37 <property name=
"properties">
39 <prop key=
"hibernate.cache.region.factory_class">org.hibernate.cache.internal.NoCachingRegionFactory
</prop>
40 <prop key=
"hibernate.show_sql">false
</prop>
41 <prop key=
"hibernate.format_sql">false
</prop>
42 <prop key=
"hibernate.search.default.directory_provider">org.hibernate.search.store.impl.FSDirectoryProvider
</prop>
43 <!-- hibernate.search.default.exclusive_index_use=false
44 locks must not only be released after application shutdown in test environment -->
45 <prop key=
"hibernate.search.default.exclusive_index_use">false
</prop>
46 <prop key=
"hibernate.search.default.indexBase">./target/index
</prop>
51 <bean id=
"tableGeneratorGlobalOverride"
52 class=
"eu.etaxonomy.cdm.persistence.hibernate.TableGeneratorGlobalOverride">
53 <property name=
"properties">
55 <!-- globally overriding id generation settings see: eu.etaxonomy.cdm.persistence.hibernate.TableGenerator -->
56 <prop key=
"optimizer">none
</prop>
57 <prop key=
"initial_value">3000</prop>
63 <!-- <bean id="taxonSpellingDirectory" class="org.springmodules.lucene.index.support.FSDirectoryFactoryBean">
64 <property name="location" value="file:./target/test-classes/eu.etaxonomy.cdm.model.taxon.TaxonBase_spelling"/>
65 <property name="create" value="true"/>
68 <bean id="taxonSpellingIndex" class="org.springmodules.lucene.index.support.SimpleIndexFactoryBean">
69 <property name="directory" ref="taxonSpellingDirectory"/>
70 <property name="create" value="true"/>
71 <property name="analyzer">
72 <bean class="org.apache.lucene.analysis.SimpleAnalyzer"/>
76 <bean id=
"authenticationManager" class=
"org.springframework.security.authentication.ProviderManager">
77 <property name=
"providers">
79 <bean class=
"org.springframework.security.authentication.TestingAuthenticationProvider"/>
84 <bean id=
"passwordEncoder" class=
"org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>
86 <bean id=
"saltSource" class=
"org.springframework.security.authentication.dao.ReflectionSaltSource">
87 <property name=
"userPropertyToUse" value=
"getUsername"/>