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
|
<import resource="classpath:/eu/etaxonomy/cdm/services.xml"/>
|
12
|
|
13
|
<context:component-scan base-package="eu/etaxonomy/cdm/api"/>
|
14
|
|
15
|
<!-- enable the configuration of transactional behavior based on annotations -->
|
16
|
<!-- <tx:annotation-driven transaction-manager="transactionManager"/> -->
|
17
|
|
18
|
|
19
|
<bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/>
|
20
|
|
21
|
<bean id="hibernateProperties"
|
22
|
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
|
23
|
<property name="properties">
|
24
|
<props>
|
25
|
<prop key="hibernate.dialect">org.hibernate.dialect.HSQLCorrectedDialect</prop>
|
26
|
<prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop>
|
27
|
<!-- TODO trying to use a managed session context -->
|
28
|
<prop key="hibernate.current_session_context_class">managed</prop>
|
29
|
<prop key="hibernate.show_sql">false</prop>
|
30
|
<prop key="hibernate.format_sql">false</prop>
|
31
|
<prop key="hibernate.search.default.directory_provider">org.hibernate.search.store.FSDirectoryProvider</prop>
|
32
|
<prop key="hibernate.search.default.indexBase">./target/test-classes</prop>
|
33
|
</props>
|
34
|
</property>
|
35
|
</bean>
|
36
|
|
37
|
<bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
|
38
|
<property name="providers">
|
39
|
<list>
|
40
|
<bean class="org.springframework.security.providers.TestingAuthenticationProvider"/>
|
41
|
<ref local="daoAuthenticationProvider"/>
|
42
|
</list>
|
43
|
</property>
|
44
|
</bean>
|
45
|
|
46
|
<bean id="daoAuthenticationProvider" class="org.springframework.security.providers.dao.DaoAuthenticationProvider">
|
47
|
<property name="userDetailsService" ref="userService"/>
|
48
|
<property name="saltSource" ref="saltSource"/>
|
49
|
<property name="passwordEncoder" ref="passwordEncoder"/>
|
50
|
</bean>
|
51
|
|
52
|
<bean id="passwordEncoder" class="org.springframework.security.providers.encoding.Md5PasswordEncoder"/>
|
53
|
|
54
|
<bean id="saltSource" class="org.springframework.security.providers.dao.salt.ReflectionSaltSource">
|
55
|
<property name="userPropertyToUse" value="getUsername"/>
|
56
|
</bean>
|
57
|
|
58
|
</beans>
|