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.provider_class">org.hibernate.cache.NoCacheProvider
</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.FSDirectoryProvider
</prop>
43 <prop key=
"hibernate.search.default.indexBase">./target/index
</prop>
48 <bean id=
"tableGeneratorGlobalOverride"
49 class=
"eu.etaxonomy.cdm.persistence.hibernate.TableGeneratorGlobalOverride">
50 <property name=
"properties">
52 <!-- globally overriding id generation settings see: eu.etaxonomy.cdm.persistence.hibernate.TableGenerator -->
53 <prop key=
"optimizer">none
</prop>
54 <prop key=
"initial_value">3000</prop>
60 <bean id=
"taxonSpellingDirectory" class=
"org.springmodules.lucene.index.support.FSDirectoryFactoryBean">
61 <property name=
"location" value=
"file:./target/test-classes/eu.etaxonomy.cdm.model.taxon.TaxonBase_spelling"/>
62 <property name=
"create" value=
"true"/>
65 <bean id=
"taxonSpellingIndex" class=
"org.springmodules.lucene.index.support.SimpleIndexFactoryBean">
66 <property name=
"directory" ref=
"taxonSpellingDirectory"/>
67 <property name=
"create" value=
"true"/>
68 <property name=
"analyzer">
69 <bean class=
"org.apache.lucene.analysis.SimpleAnalyzer"/>
73 <bean id=
"authenticationManager" class=
"org.springframework.security.authentication.ProviderManager">
74 <property name=
"providers">
76 <bean class=
"org.springframework.security.authentication.TestingAuthenticationProvider"/>
81 <bean id=
"passwordEncoder" class=
"org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>
83 <bean id=
"saltSource" class=
"org.springframework.security.authentication.dao.ReflectionSaltSource">
84 <property name=
"userPropertyToUse" value=
"getUsername"/>