Revision 87f35b2d
Added by Andreas Kohlbecker over 6 years ago
src/test/java/eu/etaxonomy/cdm/CdmVaadinIntegrationTest.java | ||
---|---|---|
24 | 24 |
* |
25 | 25 |
*/ |
26 | 26 |
@RunWith(AlternativeUnitilsJUnit4TestClassRunner.class) |
27 |
@SpringApplicationContext("file:./src/test/resources/webapp/WEB-INF/applicationContext.xml") |
|
27 |
@SpringApplicationContext("file:./src/test/resources/webapp/WEB-INF/applicationContext-alternative.xml")
|
|
28 | 28 |
@Transactional(TransactionMode.DISABLED) |
29 | 29 |
public abstract class CdmVaadinIntegrationTest extends CdmIntegrationTest { |
30 | 30 |
|
src/test/java/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingsetEditorPresenterTest.java | ||
---|---|---|
98 | 98 |
|
99 | 99 |
service.save(workingset); |
100 | 100 |
|
101 |
printDataSetWithNull(System.err, new String[]{"TYPEDESIGNATIONBASE", "SPECIMENOROBSERVATIONBASE"}); |
|
101 |
//printDataSetWithNull(System.err, new String[]{"TYPEDESIGNATIONBASE", "SPECIMENOROBSERVATIONBASE"});
|
|
102 | 102 |
|
103 | 103 |
workingset = service.loadDtoByIds(registrationId, 0); |
104 | 104 |
|
... | ... | |
157 | 157 |
|
158 | 158 |
service.save(workingset); |
159 | 159 |
|
160 |
printDataSetWithNull(System.err, new String[]{"TYPEDESIGNATIONBASE", "SPECIMENOROBSERVATIONBASE"}); |
|
160 |
//printDataSetWithNull(System.err, new String[]{"TYPEDESIGNATIONBASE", "SPECIMENOROBSERVATIONBASE"});
|
|
161 | 161 |
|
162 | 162 |
workingset = service.loadDtoByIds(registrationId, 0); |
163 | 163 |
Assert.assertEquals(1, workingset.getSpecimenTypeDesignationDTOs().size()); |
src/test/java/eu/etaxonomy/cdm/vaadin/CdmVaadinBaseTest.java | ||
---|---|---|
1 | 1 |
package eu.etaxonomy.cdm.vaadin; |
2 | 2 |
|
3 |
import java.sql.SQLException; |
|
4 |
import java.util.ArrayList; |
|
5 |
import java.util.List; |
|
6 |
|
|
3 | 7 |
import javax.servlet.ServletContextEvent; |
4 | 8 |
import javax.servlet.ServletContextListener; |
5 | 9 |
import javax.servlet.ServletException; |
6 | 10 |
|
7 | 11 |
import org.easymock.EasyMock; |
12 |
import org.h2.tools.Server; |
|
8 | 13 |
import org.junit.Assert; |
14 |
import org.junit.Before; |
|
9 | 15 |
import org.junit.BeforeClass; |
10 |
import org.junit.Ignore; |
|
11 | 16 |
import org.junit.runner.RunWith; |
12 | 17 |
import org.springframework.mock.web.MockServletConfig; |
13 | 18 |
import org.springframework.mock.web.MockServletContext; |
14 | 19 |
import org.springframework.web.context.ContextLoaderListener; |
15 |
import org.unitils.UnitilsJUnit4; |
|
20 |
import org.unitils.UnitilsJUnit4TestClassRunner;
|
|
16 | 21 |
import org.unitils.database.DatabaseUnitils; |
17 | 22 |
import org.unitils.database.annotations.Transactional; |
18 | 23 |
import org.unitils.database.util.TransactionMode; |
... | ... | |
26 | 31 |
import com.vaadin.server.VaadinSession; |
27 | 32 |
|
28 | 33 |
import eu.etaxonomy.cdm.vaadin.util.CdmSQLStringDecorator; |
29 |
import unitils.AlternativeUnitilsJUnit4TestClassRunner; |
|
30 | 34 |
|
31 |
@Ignore |
|
32 |
@RunWith(AlternativeUnitilsJUnit4TestClassRunner.class)
|
|
35 |
|
|
36 |
@RunWith(UnitilsJUnit4TestClassRunner.class) |
|
33 | 37 |
@Transactional(TransactionMode.DISABLED) |
34 |
public class CdmVaadinBaseTest extends UnitilsJUnit4 {
|
|
38 |
public abstract class CdmVaadinBaseTest {
|
|
35 | 39 |
|
36 | 40 |
private static MockServletContext servletContext; |
37 | 41 |
private static VaadinServlet vaadinServlet; |
... | ... | |
39 | 43 |
private static VaadinSession vaadinSession; |
40 | 44 |
private static boolean isVaadinServletEnvCreated = false; |
41 | 45 |
|
46 |
private static final String PROPERTY_H2_SERVER = "h2Server"; |
|
42 | 47 |
|
43 | 48 |
@BeforeClass |
44 | 49 |
public static void setup() { |
... | ... | |
62 | 67 |
Assert.assertEquals(vaadinService, VaadinService.getCurrent()); |
63 | 68 |
} |
64 | 69 |
|
70 |
@Before |
|
71 |
public void startH2Server() throws Exception { |
|
72 |
|
|
73 |
if(System.getProperty(PROPERTY_H2_SERVER) != null){ |
|
74 |
try { |
|
75 |
List<String> args = new ArrayList<String>(); |
|
76 |
try { |
|
77 |
Integer port = Integer.parseInt(System.getProperty(PROPERTY_H2_SERVER)); |
|
78 |
args.add("-webPort"); |
|
79 |
args.add(port.toString()); |
|
80 |
} catch (Exception e) { |
|
81 |
// will start at port 8082 by default |
|
82 |
} |
|
83 |
Server.createWebServer(args.toArray(new String[]{})).start(); |
|
84 |
} catch (SQLException e) { |
|
85 |
e.printStackTrace(); |
|
86 |
} |
|
87 |
} |
|
88 |
} |
|
89 |
|
|
65 | 90 |
|
66 | 91 |
public static void createNewServletEnvironment() { |
67 | 92 |
servletContext = new MockServletContext("/webapp"); |
src/test/resources/eu/etaxonomy/cdm/service/SpecimenTypeDesignationWorkingsetEditorPresenterTest.xml | ||
---|---|---|
1 | 1 |
<?xml version='1.0' encoding='UTF-8'?> |
2 | 2 |
<dataset> |
3 |
<TAXONNAME DTYPE="[null]" ID="5000" CREATED="2017-11-24 22:17:26.0" UUID="bd294483-8383-4a5c-bf76-ffa3e104dc9e" UPDATED="2017-11-24 22:17:27.447" NAMETYPE="ICNAFP" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Planothidium victori" APPENDEDPHRASE="[null]" FULLTITLECACHE="Planothidium victori in - undefined journal -: 11-45" NOMENCLATURALMICROREFERENCE="11-45" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="false" AUTHORSHIPCACHE="" BINOMHYBRID="false" GENUSORUNINOMIAL="Planothidium" HYBRIDFORMULA="false" INFRAGENERICEPITHET="[null]" INFRASPECIFICEPITHET="[null]" MONOMHYBRID="false" NAMECACHE="Planothidium victori" PROTECTEDAUTHORSHIPCACHE="false" PROTECTEDNAMECACHE="false" SPECIFICEPITHET="victori" TRINOMHYBRID="false" NAMEAPPROBATION="[null]" SUBGENUSAUTHORSHIP="[null]" ANAMORPHIC="false" CULTIVARNAME="[null]" ACRONYM="[null]" BREED="[null]" ORIGINALPUBLICATIONYEAR="[null]" PUBLICATIONYEAR="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" HOMOTYPICALGROUP_ID="5000" NOMENCLATURALREFERENCE_ID="5000" RANK_ID="765" BASIONYMAUTHORSHIP_ID="[null]" COMBINATIONAUTHORSHIP_ID="[null]" EXBASIONYMAUTHORSHIP_ID="[null]" EXCOMBINATIONAUTHORSHIP_ID="[null]"/>
|
|
4 |
<REFERENCE DTYPE="[null]" ID="5000" CREATED="2017-11-24 22:17:26.0" UUID="ed1c8722-015b-4a94-82a6-0b42e03d0e92" UPDATED="2017-11-24 22:17:27.448" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Novis, Braidwood & Kilroy, P.M. Novis, J. Braidwood & C. Kilroy, Small diatoms (Bacillariophyta) in cultures from the Styx River, New Zealand, including descriptions of three new species in Phytotaxa 64 in - undefined journal -" DATEPUBLISHED_END="[null]" DATEPUBLISHED_FREETEXT="[null]" DATEPUBLISHED_START="[null]" EDITION="[null]" EDITOR="[null]" ISBN="[null]" ISSN="[null]" DOI="[null]" NOMENCLATURALLYRELEVANT="false" ORGANIZATION="[null]" PAGES="[null]" PARSINGPROBLEM="0" PLACEPUBLISHED="[null]" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PUBLISHER="[null]" REFERENCEABSTRACT="[null]" SERIESPART="[null]" TITLE="P.M. Novis, J. Braidwood & C. Kilroy, Small diatoms (Bacillariophyta) in cultures from the Styx River, New Zealand, including descriptions of three new species in Phytotaxa 64" ABBREVTITLE="[null]" ABBREVTITLECACHE="Novis, Braidwood & Kilroy, P.M. Novis, J. Braidwood & C. Kilroy, Small diatoms (Bacillariophyta) in cultures from the Styx River, New Zealand, including descriptions of three new species in Phytotaxa 64 in - undefined journal -" PROTECTEDABBREVTITLECACHE="false" REFTYPE="ART" URI="[null]" VOLUME="[null]" ACCESSED="[null]" LASTRETRIEVED="[null]" EXTERNALID="[null]" EXTERNALLINK="[null]" AUTHORITYTYPE="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" AUTHORSHIP_ID="5000" INREFERENCE_ID="[null]" INSTITUTION_ID="[null]" SCHOOL_ID="[null]"/>
|
|
3 |
<TAXONNAME ID="5000" CREATED="2017-11-24 22:17:26.0" UUID="bd294483-8383-4a5c-bf76-ffa3e104dc9e" UPDATED="2017-11-24 22:17:27.447" NAMETYPE="ICNAFP" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Planothidium victori" APPENDEDPHRASE="[null]" FULLTITLECACHE="Planothidium victori in - undefined journal -: 11-45" NOMENCLATURALMICROREFERENCE="11-45" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PROTECTEDFULLTITLECACHE="false" AUTHORSHIPCACHE="" BINOMHYBRID="false" GENUSORUNINOMIAL="Planothidium" HYBRIDFORMULA="false" INFRAGENERICEPITHET="[null]" INFRASPECIFICEPITHET="[null]" MONOMHYBRID="false" NAMECACHE="Planothidium victori" PROTECTEDAUTHORSHIPCACHE="false" PROTECTEDNAMECACHE="false" SPECIFICEPITHET="victori" TRINOMHYBRID="false" NAMEAPPROBATION="[null]" SUBGENUSAUTHORSHIP="[null]" ANAMORPHIC="false" CULTIVARNAME="[null]" ACRONYM="[null]" BREED="[null]" ORIGINALPUBLICATIONYEAR="[null]" PUBLICATIONYEAR="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" HOMOTYPICALGROUP_ID="5000" NOMENCLATURALREFERENCE_ID="5000" RANK_ID="765" BASIONYMAUTHORSHIP_ID="[null]" COMBINATIONAUTHORSHIP_ID="[null]" EXBASIONYMAUTHORSHIP_ID="[null]" EXCOMBINATIONAUTHORSHIP_ID="[null]"/> |
|
4 |
<REFERENCE ID="5000" CREATED="2017-11-24 22:17:26.0" UUID="ed1c8722-015b-4a94-82a6-0b42e03d0e92" UPDATED="2017-11-24 22:17:27.448" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="false" TITLECACHE="Novis, Braidwood & Kilroy, P.M. Novis, J. Braidwood & C. Kilroy, Small diatoms (Bacillariophyta) in cultures from the Styx River, New Zealand, including descriptions of three new species in Phytotaxa 64 in - undefined journal -" DATEPUBLISHED_END="[null]" DATEPUBLISHED_FREETEXT="[null]" DATEPUBLISHED_START="[null]" EDITION="[null]" EDITOR="[null]" ISBN="[null]" ISSN="[null]" DOI="[null]" NOMENCLATURALLYRELEVANT="false" ORGANIZATION="[null]" PAGES="[null]" PARSINGPROBLEM="0" PLACEPUBLISHED="[null]" PROBLEMENDS="-1" PROBLEMSTARTS="-1" PUBLISHER="[null]" REFERENCEABSTRACT="[null]" SERIESPART="[null]" TITLE="P.M. Novis, J. Braidwood & C. Kilroy, Small diatoms (Bacillariophyta) in cultures from the Styx River, New Zealand, including descriptions of three new species in Phytotaxa 64" ABBREVTITLE="[null]" ABBREVTITLECACHE="Novis, Braidwood & Kilroy, P.M. Novis, J. Braidwood & C. Kilroy, Small diatoms (Bacillariophyta) in cultures from the Styx River, New Zealand, including descriptions of three new species in Phytotaxa 64 in - undefined journal -" PROTECTEDABBREVTITLECACHE="false" REFTYPE="ART" URI="[null]" VOLUME="[null]" ACCESSED="[null]" LASTRETRIEVED="[null]" EXTERNALID="[null]" EXTERNALLINK="[null]" AUTHORITYTYPE="[null]" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" AUTHORSHIP_ID="5000" INREFERENCE_ID="[null]" INSTITUTION_ID="[null]" SCHOOL_ID="[null]"/> |
|
5 | 5 |
<AGENTBASE DTYPE="Team" ID="5000" CREATED="2017-11-24 22:17:26.0" UUID="5e7b791e-d17f-4378-9a47-923ebebc9b6a" UPDATED="2017-11-24 22:17:27.449" LSID_AUTHORITY="[null]" LSID_LSID="[null]" LSID_NAMESPACE="[null]" LSID_OBJECT="[null]" LSID_REVISION="[null]" PROTECTEDTITLECACHE="true" TITLECACHE="Novis, Braidwood & Kilroy" PROTECTEDCOLLECTORTITLECACHE="false" COLLECTORTITLE="[null]" PROTECTEDNOMENCLATURALTITLECACHE="true" NOMENCLATURALTITLE="Novis, Braidwood & Kilroy" CODE="[null]" NAME="[null]" FIRSTNAME="[null]" INITIALS="[null]" LASTNAME="[null]" LIFESPAN_END="[null]" LIFESPAN_FREETEXT="[null]" LIFESPAN_START="[null]" PREFIX="[null]" SUFFIX="[null]" HASMOREMEMBERS="false" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" ISPARTOF_ID="[null]"/> |
6 | 6 |
<HOMOTYPICALGROUP ID="5000" CREATED="2017-11-24 22:17:26.0" UUID="76cb5ec1-ac61-4c40-a0e2-1bb738f04575" UPDATED="2017-11-24 22:17:27.448" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]"/> |
7 | 7 |
<REGISTRATION ID="5000" CREATED="2017-11-24 22:17:27.0" UUID="247090ee-31b4-4738-970c-69813e785a86" UPDATED="[null]" IDENTIFIER="[null]" REGISTRATIONDATE="[null]" SPECIFICIDENTIFIER="[null]" STATUS="PREP" CREATEDBY_ID="[null]" UPDATEDBY_ID="[null]" INSTITUTION_ID="[null]" NAME_ID="5000" SUBMITTER_ID="[null]"/> |
src/test/resources/h2/cdmTest.trace.db | ||
---|---|---|
1 |
2017-11-27 09:27:02 jdbc[3]: null |
|
2 |
org.h2.message.DbException: The connection was not closed by the application and is garbage collected [90018-190] |
|
3 |
at org.h2.message.DbException.get(DbException.java:179) |
|
4 |
at org.h2.message.DbException.get(DbException.java:155) |
|
5 |
at org.h2.message.DbException.get(DbException.java:144) |
|
6 |
at org.h2.jdbc.JdbcConnection.closeOld(JdbcConnection.java:173) |
|
7 |
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:118) |
|
8 |
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:91) |
|
9 |
at org.h2.Driver.connect(Driver.java:72) |
|
10 |
at org.h2.server.web.WebServer.getConnection(WebServer.java:735) |
|
11 |
at org.h2.server.web.WebApp.login(WebApp.java:955) |
|
12 |
at org.h2.server.web.WebApp.process(WebApp.java:211) |
|
13 |
at org.h2.server.web.WebApp.processRequest(WebApp.java:170) |
|
14 |
at org.h2.server.web.WebThread.process(WebThread.java:133) |
|
15 |
at org.h2.server.web.WebThread.run(WebThread.java:89) |
|
16 |
at java.lang.Thread.run(Thread.java:748) |
|
17 |
Caused by: org.h2.jdbc.JdbcSQLException: The connection was not closed by the application and is garbage collected [90018-190] |
|
18 |
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) |
|
19 |
... 14 more |
src/test/resources/webapp/WEB-INF/applicationContext-alternative.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:tx="http://www.springframework.org/schema/tx" |
|
5 |
xmlns:context="http://www.springframework.org/schema/context" |
|
6 |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd |
|
7 |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd |
|
8 |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd |
|
9 |
"> |
|
10 |
|
|
11 |
<!-- |
|
12 |
NOTE: |
|
13 |
For a detailed overview on the spring MVC and application context configuration and |
|
14 |
bootstrapping of this web application see: |
|
15 |
http://dev.e-taxonomy.eu/trac/wiki/cdmlib-remote-webappConfigurationAndBootstrapping |
|
16 |
--> |
|
17 |
|
|
18 |
<context:annotation-config /> |
|
19 |
|
|
20 |
<!-- |
|
21 |
find the eu.etaxonomy.cdm.remote.config.CdmVaadinConfiguration |
|
22 |
--> |
|
23 |
<context:component-scan base-package="eu/etaxonomy/cdm/addon/config" /> |
|
24 |
|
|
25 |
<!-- include default application context and customization --> |
|
26 |
<import resource="classpath:/eu/etaxonomy/cdm/defaultApplicationContext.xml"/> |
|
27 |
|
|
28 |
<bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/> |
|
29 |
|
|
30 |
<bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer"> |
|
31 |
<property name="omit" value="true" /> |
|
32 |
</bean> |
|
33 |
<context:component-scan base-package="eu/etaxonomy/cdm/ext" /> |
|
34 |
|
|
35 |
<!-- <import resource="classpath:/eu/etaxonomy/cdm/remote.xml"/> --> |
|
36 |
<!-- <context:component-scan base-package="eu/etaxonomy/cdm/io"> |
|
37 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.pesi.*" /> |
|
38 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.faunaEuropaea.*" /> |
|
39 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.erms.*" /> |
|
40 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.eflora.*" /> |
|
41 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.berlinModel.*" /> |
|
42 |
</context:component-scan> --> |
|
43 |
|
|
44 |
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> |
|
45 |
<property name="properties"> |
|
46 |
<props> |
|
47 |
<prop key="eu.etaxonomy.cdm.base.path">${user.home}/.cdmLibrary/</prop> |
|
48 |
<prop key="eu.etaxonomy.cdm.search.index.path">${user.home}/.cdmLibrary/index/</prop> |
|
49 |
</props> |
|
50 |
</property> |
|
51 |
</bean> |
|
52 |
|
|
53 |
<!-- enable the configuration of transactional behavior based on annotations --> |
|
54 |
<tx:annotation-driven transaction-manager="transactionManager"/> |
|
55 |
|
|
56 |
<import resource="classpath:/eu/etaxonomy/cdm/applicationContext-test.common.xml" /> |
|
57 |
|
|
58 |
<bean id="termInitializer" class="eu.etaxonomy.cdm.database.TestingTermInitializer"> |
|
59 |
<property name="termsDataSet" value="classpath:/eu/etaxonomy/cdm/database/TermsDataSet-ui-registration-with_auditing_info.xml"/> |
|
60 |
<property name="termsDtd" value="classpath:/eu/etaxonomy/cdm/database/schema/dataset.dtd"/> |
|
61 |
</bean> |
|
62 |
|
|
63 |
</beans> |
src/test/resources/webapp/WEB-INF/applicationContext.xml | ||
---|---|---|
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 | 2 |
<beans xmlns="http://www.springframework.org/schema/beans" |
3 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
4 |
xmlns:tx="http://www.springframework.org/schema/tx" |
|
5 |
xmlns:context="http://www.springframework.org/schema/context" |
|
6 |
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd |
|
7 |
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd |
|
8 |
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd |
|
9 |
"> |
|
10 |
|
|
11 |
<!-- |
|
12 |
NOTE: |
|
13 |
For a detailed overview on the spring MVC and application context configuration and |
|
14 |
bootstrapping of this web application see: |
|
15 |
http://dev.e-taxonomy.eu/trac/wiki/cdmlib-remote-webappConfigurationAndBootstrapping |
|
16 |
--> |
|
17 |
|
|
18 |
<context:annotation-config /> |
|
19 |
|
|
20 |
<!-- |
|
21 |
find the eu.etaxonomy.cdm.remote.config.CdmVaadinConfiguration |
|
22 |
--> |
|
23 |
<context:component-scan base-package="eu/etaxonomy/cdm/addon/config" /> |
|
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 |
|
|
12 |
<context:property-override location="classpath:override.properties"/> |
|
24 | 13 |
|
25 |
<!-- include default application context and customization --> |
|
26 |
<import resource="classpath:/eu/etaxonomy/cdm/defaultApplicationContext.xml"/> |
|
27 |
|
|
28 |
<bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/> |
|
29 |
|
|
30 |
<bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer"> |
|
31 |
<property name="omit" value="true" /> |
|
32 |
</bean> |
|
33 |
<context:component-scan base-package="eu/etaxonomy/cdm/ext" /> |
|
34 |
|
|
35 |
<!-- <import resource="classpath:/eu/etaxonomy/cdm/remote.xml"/> --> |
|
36 |
<!-- <context:component-scan base-package="eu/etaxonomy/cdm/io"> |
|
37 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.pesi.*" /> |
|
38 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.faunaEuropaea.*" /> |
|
39 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.erms.*" /> |
|
40 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.eflora.*" /> |
|
41 |
<context:exclude-filter type="regex" expression="eu\.etaxonomy\.cdm\.io\.berlinModel.*" /> |
|
42 |
</context:component-scan> --> |
|
43 |
|
|
44 |
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> |
|
45 |
<property name="properties"> |
|
46 |
<props> |
|
47 |
<prop key="eu.etaxonomy.cdm.base.path">${user.home}/.cdmLibrary/</prop> |
|
48 |
<prop key="eu.etaxonomy.cdm.search.index.path">${user.home}/.cdmLibrary/index/</prop> |
|
49 |
</props> |
|
50 |
</property> |
|
51 |
</bean> |
|
14 |
<context:component-scan base-package="eu/etaxonomy/cdm/api/config" /> |
|
15 |
|
|
16 |
<context:component-scan base-package="eu/etaxonomy/cdm/api/service"> |
|
17 |
</context:component-scan> |
|
18 |
|
|
19 |
<context:component-scan base-package="eu/etaxonomy/cdm/api/application"> |
|
20 |
</context:component-scan> |
|
21 |
|
|
22 |
<import resource="classpath:/eu/etaxonomy/cdm/services.xml"/> |
|
52 | 23 |
|
24 |
<context:component-scan base-package="eu/etaxonomy/cdm/api/cache"/> |
|
53 | 25 |
<!-- enable the configuration of transactional behavior based on annotations --> |
54 | 26 |
<tx:annotation-driven transaction-manager="transactionManager"/> |
55 |
|
|
56 |
<import resource="classpath:/eu/etaxonomy/cdm/applicationContext-test.common.xml" /> |
|
57 |
|
|
58 |
<bean id="termInitializer" class="eu.etaxonomy.cdm.database.TestingTermInitializer"> |
|
59 |
<property name="termsDataSet" value="classpath:/eu/etaxonomy/cdm/database/TermsDataSet-ui-registration-with_auditing_info.xml"/> |
|
60 |
<property name="termsDtd" value="classpath:/eu/etaxonomy/cdm/database/schema/dataset.dtd"/> |
|
27 |
|
|
28 |
<bean id="dataSource" class="org.unitils.database.UnitilsDataSourceFactoryBean"/> |
|
29 |
|
|
30 |
<bean id="persistentTermInitializer" class="eu.etaxonomy.cdm.database.PersistentTermInitializer"> |
|
31 |
<property name="omit" value="false"/> |
|
61 | 32 |
</bean> |
62 |
|
|
63 |
</beans> |
|
33 |
|
|
34 |
<bean id="hibernateProperties" |
|
35 |
class="org.springframework.beans.factory.config.PropertiesFactoryBean"> |
|
36 |
<property name="properties"> |
|
37 |
<props> |
|
38 |
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.internal.NoCachingRegionFactory</prop> |
|
39 |
<prop key="hibernate.show_sql">false</prop> |
|
40 |
<prop key="hibernate.format_sql">false</prop> |
|
41 |
<prop key="hibernate.search.autoregister_listeners">false</prop> |
|
42 |
<prop key="hibernate.jdbc.batch_size">0</prop> |
|
43 |
</props> |
|
44 |
</property> |
|
45 |
</bean> |
|
46 |
|
|
47 |
<bean id="tableGeneratorGlobalOverride" |
|
48 |
class="eu.etaxonomy.cdm.persistence.hibernate.TableGeneratorGlobalOverride"> |
|
49 |
<property name="properties"> |
|
50 |
<props> |
|
51 |
<!-- |
|
52 |
globally overriding id generation settings see: eu.etaxonomy.cdm.persistence.hibernate.TableGenerator |
|
53 |
--> |
|
54 |
<prop key="optimizer">none</prop> |
|
55 |
<prop key="initial_value">5000</prop><!-- must be higher than any term id in TermsDataSet.xml --> |
|
56 |
</props> |
|
57 |
</property> |
|
58 |
</bean> |
|
59 |
|
|
60 |
|
|
61 |
<!-- |
|
62 |
We do not use spelling suggestions anymore. This one relates to spring modules which is |
|
63 |
somewhat out-dated. Once we work again with spelling suggestions we better use a modern |
|
64 |
approach, e.g. annotation based. |
|
65 |
<bean id="taxonSpellingDirectory" class="org.springmodules.lucene.index.support.FSDirectoryFactoryBean"> |
|
66 |
<property name="location" value="file:./target/index/eu.etaxonomy.cdm.model.taxon.TaxonBase_spelling"/> |
|
67 |
<property name="create" value="true"/> |
|
68 |
</bean> --> |
|
69 |
|
|
70 |
<bean id="validatorFactory" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean"> |
|
71 |
<property name="mappingLocations"> |
|
72 |
<set> |
|
73 |
<value>classpath:/eu/etaxonomy/cdm/validation/name/TaxonName-Constraints.xml</value> |
|
74 |
</set> |
|
75 |
</property> |
|
76 |
</bean> |
|
77 |
|
|
78 |
|
|
79 |
<!-- equips a new and empty database with the initial set of meta data and admin user --> |
|
80 |
<bean id="firstDataInserter" class="eu.etaxonomy.cdm.api.application.FirstDataInserter" /> |
|
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 |
<constructor-arg> |
|
94 |
<list> |
|
95 |
<ref local="daoAuthenticationProvider"/> |
|
96 |
</list> |
|
97 |
</constructor-arg> |
|
98 |
<!-- <property name="providers"> --> |
|
99 |
<!-- <list> --> |
|
100 |
<!-- <bean class="org.springframework.security.authentication.TestingAuthenticationProvider"/> --> |
|
101 |
<!-- <ref local="daoAuthenticationProvider"/> --> |
|
102 |
<!-- </list> --> |
|
103 |
<!-- </property> --> |
|
104 |
</bean> |
|
105 |
|
|
106 |
</beans> |
Also available in: Unified diff
fxing problems in testsetup: