add integration test profile
This commit is contained in:
parent
199fdf2198
commit
1c775ef0ef
|
@ -46,7 +46,13 @@
|
||||||
<artifactId>tomcat-dbcp</artifactId>
|
<artifactId>tomcat-dbcp</artifactId>
|
||||||
<version>${tomcat-dbcp.version}</version>
|
<version>${tomcat-dbcp.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.h2database</groupId>
|
||||||
|
<artifactId>h2</artifactId>
|
||||||
|
<version>${h2.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- utils -->
|
<!-- utils -->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -127,39 +133,52 @@
|
||||||
<version>${maven-surefire-plugin.version}</version>
|
<version>${maven-surefire-plugin.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<excludes>
|
<excludes>
|
||||||
<!-- <exclude>**/*ProductionTest.java</exclude> -->
|
<exclude>**/*IntegrationTest.java</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
<systemPropertyVariables>
|
<systemPropertyVariables>
|
||||||
<!-- <provPersistenceTarget>h2</provPersistenceTarget> -->
|
<!-- <provPersistenceTarget>h2</provPersistenceTarget> -->
|
||||||
</systemPropertyVariables>
|
</systemPropertyVariables>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.cargo</groupId>
|
|
||||||
<artifactId>cargo-maven2-plugin</artifactId>
|
|
||||||
<version>${cargo-maven2-plugin.version}</version>
|
|
||||||
<configuration>
|
|
||||||
<wait>true</wait>
|
|
||||||
<container>
|
|
||||||
<containerId>jetty8x</containerId>
|
|
||||||
<type>embedded</type>
|
|
||||||
<systemProperties>
|
|
||||||
<!-- <provPersistenceTarget>cargo</provPersistenceTarget> -->
|
|
||||||
</systemProperties>
|
|
||||||
</container>
|
|
||||||
<configuration>
|
|
||||||
<properties>
|
|
||||||
<cargo.servlet.port>8082</cargo.servlet.port>
|
|
||||||
</properties>
|
|
||||||
</configuration>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>integration</id>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>integration-test</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>test</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>**/*LiveTest.java</exclude>
|
||||||
|
</excludes>
|
||||||
|
<includes>
|
||||||
|
<include>**/*IntegrationTest.java</include>
|
||||||
|
</includes>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<systemPropertyVariables>
|
||||||
|
<test.mime>json</test.mime>
|
||||||
|
</systemPropertyVariables>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<!-- Spring -->
|
<!-- Spring -->
|
||||||
<org.springframework.version>4.2.5.RELEASE</org.springframework.version>
|
<org.springframework.version>4.2.5.RELEASE</org.springframework.version>
|
||||||
|
@ -170,6 +189,7 @@
|
||||||
<hibernate.version>3.6.10.Final</hibernate.version>
|
<hibernate.version>3.6.10.Final</hibernate.version>
|
||||||
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
|
<mysql-connector-java.version>5.1.38</mysql-connector-java.version>
|
||||||
<tomcat-dbcp.version>7.0.47</tomcat-dbcp.version>
|
<tomcat-dbcp.version>7.0.47</tomcat-dbcp.version>
|
||||||
|
<h2.version>1.4.191</h2.version>
|
||||||
|
|
||||||
<!-- logging -->
|
<!-- logging -->
|
||||||
<org.slf4j.version>1.7.13</org.slf4j.version>
|
<org.slf4j.version>1.7.13</org.slf4j.version>
|
||||||
|
|
|
@ -21,7 +21,7 @@ import com.google.common.base.Preconditions;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableTransactionManagement
|
@EnableTransactionManagement
|
||||||
@PropertySource({ "classpath:persistence-mysql.properties" })
|
@PropertySource({ "classpath:persistence-h2.properties" })
|
||||||
@ComponentScan({ "org.baeldung.persistence.dao", "org.baeldung.persistence.service" })
|
@ComponentScan({ "org.baeldung.persistence.dao", "org.baeldung.persistence.service" })
|
||||||
public class PersistenceConfig {
|
public class PersistenceConfig {
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
# jdbc.X
|
||||||
|
jdbc.driverClassName=org.h2.Driver
|
||||||
|
jdbc.url=jdbc:h2:mem:spring_hibernate3_01;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
|
||||||
|
jdbc.user=sa
|
||||||
|
jdbc.pass=
|
||||||
|
|
||||||
|
# hibernate.X
|
||||||
|
hibernate.dialect=org.hibernate.dialect.H2Dialect
|
||||||
|
hibernate.show_sql=false
|
||||||
|
hibernate.hbm2ddl.auto=create-drop
|
Loading…
Reference in New Issue