Tag: 集成测试

你将如何测试连接池

我在Java中实现了一个非常简单的ConnectionPool。 它没有花哨的function,只是获取/释放连接方法。 我怎样才能测试它是否有效? 我知道有很多连接池可以在那里使用,它比我要做的更可靠,但我只是想练习理解连接池的工作方式。 谢谢! 这是代码,以防它有帮助: public class ConnectionPoolImpl implements ConnectionPool { private Vector connections; // The connections container String url; String username; String password; /** * Instanciates a new MySQLConnectionPool * @param nbConnectionsMax */ public ConnectionPoolImpl(String DBUrl, String username, String password){ this.connections = new Vector(); this.url = DBUrl; this.username = username; this.password = password; […]

Maven – unit testing的独立集成测试

是否可以将集成测试与同一模块内的unit testing隔离开来? 我创建了简单的pom: 4.0.0 prj war org.apache.maven.plugins maven-compiler-plugin 1.6 1.6 UTF-8 org.apache.maven.plugins maven-surefire-plugin **/integration/**/*.java integration org.apache.maven.plugins maven-surefire-plugin **/integration/**/*.java 但是使用mvn -Pintegration测试它不会调用任何东西。 如果我注释掉主编译中的部分 – 那么它开始执行测试,但也没有配置文件。

将类路径添加到在maven集成测试中运行的jetty

我正在尝试为生成war文件的Maven项目设置集成测试。 (如此处所见http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin/ 。)但是我的war文件需要在类路径上有一堆.properties文件,我不想捆绑在战争中。 有没有办法(最好通过插件配置)将文件夹添加到jetty使用的类路径? 我用Google搜索并发现了http://markmail.org/message/awtqrgxxttra3uxx但据我所知,这根本不起作用。 找不到.properties文件。