Project

General

Profile

Download (1.99 KB) Statistics
| Branch: | Tag: | Revision:
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE hibernate-configuration PUBLIC
3
 "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
4
 "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
5
 
6
 <!-- 
7
    This is a hibernate configuration which complements the hibernate.cfg.xml
8
    found in cdmlib-persistence exclusively for a specific phase of the execution
9
    of integration tests.
10
    
11
    This configuration is used to define properties for the session-factory which are
12
    usually defined in the spring application context (applicationContext-test.common.xml).
13
    Integration tests which are based on eu.etaxonomy.cdm.test.integration.CdmIntegrationTest 
14
    are in general using the configuration of the spring application context, except 
15
    in one situation:
16
    
17
    When Unitils calls the afterTestTearDown() method after the execution of a test method
18
    it is directly using the Hibernate5Module to create a new  session instead of using the 
19
    spring ApplicationContextManager. Unitils has explicitly configured to behave in this way
20
    for somr reason (see the property dataSource.wrapInTransactionalProxy=false in 
21
    /cdmlib-test/src/main/resources/unitils.properties). 
22
    The session created by the Hibernate5Module gets its configuration only from the file defined 
23
    in  @HibernateSessionFactory, therefore it misses the additional hibernate configuration 
24
    properties defined in the spring  application context. 
25
    In order to create a hibernate only way to define essential configuration properties this 
26
    file exists.
27
    
28
    CdmIntegrationTest is configured to use this configuration file as second source to the 
29
    main hibernate.cfg.xml. Both configurations are merged:
30
    
31
    @HibernateSessionFactory({"/eu/etaxonomy/cdm/hibernate.cfg.xml", "/eu/etaxonomy/cdm/hibernate-test.cfg.xml"})
32
    
33
  -->
34

    
35
<hibernate-configuration>
36
    <session-factory>
37
        <property name="hibernate.search.default.indexBase">./target/index</property>
38
    </session-factory>
39
</hibernate-configuration>
(2-2/3)