r33 - in trunk: . cantharella.data cantharella.data/src/main/java/nc/ird/cantharella/data/config cantharella.data/src/main/resources/development cantharella.data/src/main/resources/integration cantharella.data/src/main/resources/production cantharella.data/src/test/resources cantharella.service
Author: echatellier Date: 2012-11-28 15:53:21 +0100 (Wed, 28 Nov 2012) New Revision: 33 Url: http://forge.codelutin.com/repositories/revision/cantharella/33 Log: Fix project tests during "mvn install" Added: trunk/cantharella.data/src/test/resources/data.properties Removed: trunk/cantharella.data/src/main/resources/development/hibernate.cfg.xml trunk/cantharella.data/src/main/resources/integration/hibernate.cfg.xml trunk/cantharella.data/src/main/resources/production/hibernate.cfg.xml trunk/cantharella.data/src/test/resources/nc/ Modified: trunk/cantharella.data/pom.xml trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java trunk/cantharella.data/src/main/resources/development/data.properties trunk/cantharella.service/pom.xml trunk/pom.xml Modified: trunk/cantharella.data/pom.xml =================================================================== --- trunk/cantharella.data/pom.xml 2012-11-28 13:57:26 UTC (rev 32) +++ trunk/cantharella.data/pom.xml 2012-11-28 14:53:21 UTC (rev 33) @@ -197,6 +197,12 @@ <artifactId>log4j</artifactId> <scope>test</scope> </dependency> + + <dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + <scope>test</scope> + </dependency> <dependency> <groupId>org.springframework</groupId> Modified: trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java =================================================================== --- trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java 2012-11-28 13:57:26 UTC (rev 32) +++ trunk/cantharella.data/src/main/java/nc/ird/cantharella/data/config/DataContext.java 2012-11-28 14:53:21 UTC (rev 33) @@ -143,6 +143,10 @@ @Value("${db.user}") protected String dbUserProperty; + /** DB user */ + @Value("${db.hbm2ddl:validate}") + protected String hbm2ddl; + static { // The first Locale in the list is the default one List<Locale> locales = new ArrayList<Locale>(); @@ -235,7 +239,7 @@ // Hibernate: basic hibernateProperties.setProperty("hibernate.dialect", PostgreSQLDialect.class.getName()); // System.setProperty(Environment.BYTECODE_PROVIDER, "cglib"); - hibernateProperties.setProperty("hibernate.hbm2ddl.auto", "validate"); + hibernateProperties.setProperty("hibernate.hbm2ddl.auto", hbm2ddl); // hibernateProperties.setProperty("hibernate.hbm2ddl.auto", "create-drop"); hibernateProperties.setProperty("hibernate.generate_statistics", String.valueOf(dbDebugProperty)); hibernateProperties.setProperty("hibernate.cache.use_structured_entries", String.valueOf(dbDebugProperty)); Modified: trunk/cantharella.data/src/main/resources/development/data.properties =================================================================== --- trunk/cantharella.data/src/main/resources/development/data.properties 2012-11-28 13:57:26 UTC (rev 32) +++ trunk/cantharella.data/src/main/resources/development/data.properties 2012-11-28 14:53:21 UTC (rev 33) @@ -24,7 +24,8 @@ #db.user=${pom.db.user} #db.password=${pom.db.password} #db.debug=true -db.url=jdbc:postgresql://isdev:5432/cantharella +db.url=jdbc:postgresql:cantharella db.user=cantharella -db.password=ctrl4 -db.debug=true \ No newline at end of file +db.password=cantharella +db.debug=true +db.hbm2ddl=validate \ No newline at end of file Deleted: trunk/cantharella.data/src/main/resources/development/hibernate.cfg.xml =================================================================== --- trunk/cantharella.data/src/main/resources/development/hibernate.cfg.xml 2012-11-28 13:57:26 UTC (rev 32) +++ trunk/cantharella.data/src/main/resources/development/hibernate.cfg.xml 2012-11-28 14:53:21 UTC (rev 33) @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - #%L - Cantharella :: Data - $Id:$ - $HeadURL:$ - %% - Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below) - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> - -<!DOCTYPE hibernate-configuration PUBLIC - "-//Hibernate/Hibernate Configuration DTD 3.0//EN" - "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> -<hibernate-configuration> - <session-factory name="cantharella"> - <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property> - </session-factory> -</hibernate-configuration> Deleted: trunk/cantharella.data/src/main/resources/integration/hibernate.cfg.xml =================================================================== --- trunk/cantharella.data/src/main/resources/integration/hibernate.cfg.xml 2012-11-28 13:57:26 UTC (rev 32) +++ trunk/cantharella.data/src/main/resources/integration/hibernate.cfg.xml 2012-11-28 14:53:21 UTC (rev 33) @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - #%L - Cantharella :: Data - $Id:$ - $HeadURL:$ - %% - Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below) - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> - -<!DOCTYPE hibernate-configuration PUBLIC - "-//Hibernate/Hibernate Configuration DTD 3.0//EN" - "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> -<hibernate-configuration> - <session-factory name="cantharella"> - <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property> - </session-factory> -</hibernate-configuration> Deleted: trunk/cantharella.data/src/main/resources/production/hibernate.cfg.xml =================================================================== --- trunk/cantharella.data/src/main/resources/production/hibernate.cfg.xml 2012-11-28 13:57:26 UTC (rev 32) +++ trunk/cantharella.data/src/main/resources/production/hibernate.cfg.xml 2012-11-28 14:53:21 UTC (rev 33) @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - #%L - Cantharella :: Data - $Id:$ - $HeadURL:$ - %% - Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below) - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - #L% - --> - -<!DOCTYPE hibernate-configuration PUBLIC - "-//Hibernate/Hibernate Configuration DTD 3.0//EN" - "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> -<hibernate-configuration> - <session-factory name="cantharella"> - <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property> - </session-factory> -</hibernate-configuration> Added: trunk/cantharella.data/src/test/resources/data.properties =================================================================== --- trunk/cantharella.data/src/test/resources/data.properties (rev 0) +++ trunk/cantharella.data/src/test/resources/data.properties 2012-11-28 14:53:21 UTC (rev 33) @@ -0,0 +1,27 @@ +### +# #%L +# Cantharella :: Data +# $Id:$ +# $HeadURL:$ +# %% +# Copyright (C) 2009 - 2012 IRD (Institut de Recherche pour le Developpement) and by respective authors (see below) +# %% +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# #L% +### +db.url=jdbc:h2:file:/tmp/cantharella/db +db.user=sa +db.password= +db.debug=false +db.hbm2ddl=create \ No newline at end of file Modified: trunk/cantharella.service/pom.xml =================================================================== --- trunk/cantharella.service/pom.xml 2012-11-28 13:57:26 UTC (rev 32) +++ trunk/cantharella.service/pom.xml 2012-11-28 14:53:21 UTC (rev 33) @@ -105,10 +105,11 @@ <artifactId>aspectjrt</artifactId> </dependency> - <!--dependency> + <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> - </dependency--> + <scope>runtime</scope> + </dependency> <dependency> <groupId>junit</groupId> @@ -122,6 +123,12 @@ </dependency> <dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + <scope>test</scope> + </dependency> + + <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> </dependency> Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2012-11-28 13:57:26 UTC (rev 32) +++ trunk/pom.xml 2012-11-28 14:53:21 UTC (rev 33) @@ -110,6 +110,7 @@ <log4jVersion>1.2.16</log4jVersion> <junitVersion>4.5</junitVersion> <version.slf4j>1.6.0</version.slf4j> + <version.h2>1.3.168</version.h2> <version.jpa>1.0.0.Final</version.jpa> <version.hibernate-annotations>3.5.6-Final</version.hibernate-annotations> @@ -320,7 +321,6 @@ <version>${version.c3p0}</version> </dependency> - <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> @@ -396,6 +396,12 @@ <version>${version.wicket}</version> </dependency> + <dependency> + <groupId>com.h2database</groupId> + <artifactId>h2</artifactId> + <version>${version.h2}</version> + </dependency> + <!-- for JUnit Spring Test with @Configuration --> <dependency> <groupId>cglib</groupId>
participants (1)
-
echatellier@users.forge.codelutin.com