Here are the mods I have made:
<groupId>org.codehaus.mojo</groupId> <-- THIS PLUGIN DROPS / CREATES
TABLES
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>annotationconfiguration</implementation>
<!-- Use 'jpaconfiguration' if you're using JPA. -->
<!--<implementation>jpaconfiguration</implementation>-->
</component>
</components>
<componentProperties>
<drop>true</drop>
<jdk5>true</jdk5>
<!--in this file the DB is specified for the plugin to use-->
<propertyfile>/jdbc.properties</propertyfile> <-- SPECIFY CUSTOM
FILE AND DB
<skip>${maven.test.skip}</skip>
</componentProperties>
</configuration>
<!--this plugin fills the DB with test data-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dbunit-maven-plugin</artifactId>
<version>1.0-beta-1</version>
<configuration>
<dataTypeFactoryName>${dbunit.dataTypeFactoryName}</dataTypeFactoryName>
<driver>${jdbc.driverClassName}</driver>
<username>${jdbc.username}</username>
<password>${jdbc.password}</password>
<!--set the url to the test DB-->
<url>${jdbc.url_test}</url> <-- SPECIFY URL TO TEST
SCHEMA
<src>src/test/resources/sample-data.xml</src>
<type>${dbunit.operation.type}</type>
<schema>db_test</schema> <-- SPECIFY SCHEMA FOR
TESTING PURPOSES
<profile>
<id>integration-test</id>
<properties>
<!--set the DB to run the integration webtests on-->
<jdbc.groupId>mysql</jdbc.groupId>
<jdbc.artifactId>mysql-connector-java</jdbc.artifactId>
<jdbc.version>5.0.5</jdbc.version>
<jdbc.driverClassName>com.mysql.jdbc.Driver</jdbc.driverClassName>
<jdbc.url>${jdbc.url_test}</jdbc.url> <-- SPECIFY THE CORRECT
SCHEMA FOR RUNNING ON
The rest I have left much unchanged. Tests just run on test schema
(including drop / create tables / fill with data / run webtests).
Development runs on different schema.
For safety purposes, disable DROP privilgdges on development DB too.
Hope it helps,
M
--
View this message in context:
http://www.nabble.com/Production-and-Test-Profiles-tp25505742s2369p25509513.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]