【发布时间】:2014-08-25 12:08:22
【问题描述】:
我有一个 Spring MVC + JPA/Hibernate 应用程序。该应用程序有一些 GUI (Selenium) 测试。我使用tomcat7-maven-plugin 为这些测试部署我的应用程序:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>tomcat-run</id>
<goals>
<goal>run-war-only</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<fork>true</fork>
</configuration>
</execution>
<execution>
<id>tomcat-shutdown</id>
<goals>
<goal>shutdown</goal>
</goals>
<phase>post-integration-test</phase>
</execution>
</executions>
</plugin>
此设置适用于生产数据库,但我需要使用另一个数据库进行这些测试。我的数据库连接设置在 Spring 配置和 .properties 文件中定义。
部署应用程序进行 GUI 测试时如何更改数据库连接设置?
【问题讨论】:
标签: spring spring-mvc jpa selenium maven-tomcat-plugin