AccessDecisionVoter based acl implementation working - all test succeed, but assertio...
[cdmlib.git] / cdmlib-services / src / test / resources / eu / etaxonomy / cdm / applicationContext-test.xml
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-2.5.xsd
8 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
9 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
10
11 <context:property-override location="classpath:override.properties"/>
12
13 <context:component-scan base-package="eu/etaxonomy/cdm/api/service">
14 </context:component-scan>
15
16 <import resource="classpath:/eu/etaxonomy/cdm/services.xml"/>
17
18 <!-- enable the configuration of transactional behavior based on annotations -->
19 <tx:annotation-driven transaction-manager="transactionManager"/>
20
21 <bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/>
22
23 <!--
24 use TestingTermInitializer
25 -->
26 <bean id="testingTermInitializer" class="eu.etaxonomy.cdm.database.TestingTermInitializer">
27 <property name="termsDataSet" value="classpath:/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml"/>
28 <property name="termsDtd" value="classpath:/eu/etaxonomy/cdm/persistence/dao/hibernate/dataset.dtd"/>
29 <property name="omit" value="false"/>
30 </bean>
31 <bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer">
32 <property name="omit" value="true"/>
33 </bean>
34
35 <bean id="hibernateProperties"
36 class="org.springframework.beans.factory.config.PropertiesFactoryBean">
37 <property name="properties">
38 <props>
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 <!-- TODO trying to use a managed session context
44 <prop key="hibernate.current_session_context_class">managed</prop>
45 -->
46 <prop key="hibernate.search.default.indexBase">./target/index</prop>
47 <!-- hsqldb v. <1.9 has a bug (http://sourceforge.net/tracker/?func=detail&atid=378131&aid=1407528&group_id=23316)
48 due to which it is not possible to use batch updates, so we need to disable
49 hibernate batching when using hsqldb in the app context: -->
50 <prop key="hibernate.jdbc.batch_size">0</prop>
51 </props>
52 </property>
53 </bean>
54
55 <bean id="tableGeneratorGlobalOverride"
56 class="eu.etaxonomy.cdm.persistence.hibernate.TableGeneratorGlobalOverride">
57 <property name="properties">
58 <props>
59 <!--
60 globally overriding id generation settings see: eu.etaxonomy.cdm.persistence.hibernate.TableGenerator
61 -->
62 <prop key="optimizer">none</prop>
63 <prop key="initial_value">1000</prop>
64 </props>
65 </property>
66 </bean>
67
68
69 <bean id="taxonSpellingDirectory" class="org.springmodules.lucene.index.support.FSDirectoryFactoryBean">
70 <property name="location" value="file:./target/index/eu.etaxonomy.cdm.model.taxon.TaxonBase_spelling"/>
71 <property name="create" value="true"/>
72 </bean>
73
74 <bean id="validatorFactory" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
75 <property name="mappingLocations">
76 <set>
77 <value>classpath:/eu/etaxonomy/cdm/validation/name/TaxonNameBase-Constraints.xml</value>
78 </set>
79 </property>
80 </bean>
81
82 <!-- security -->
83 <bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>
84 <bean id="saltSource" class="org.springframework.security.authentication.dao.ReflectionSaltSource">
85 <property name="userPropertyToUse" value="getUsername"/>
86 </bean>
87 <bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
88 <property name="userDetailsService" ref="userService"/>
89 <property name="saltSource" ref="saltSource"/>
90 <property name="passwordEncoder" ref="passwordEncoder"/>
91 </bean>
92 <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
93 <property name="providers">
94 <list>
95 <bean class="org.springframework.security.authentication.TestingAuthenticationProvider"/>
96 <ref local="daoAuthenticationProvider"/>
97 </list>
98 </property>
99 </bean>
100
101 </beans>