zoukankan      html  css  js  c++  java
  • [转]利用maven的surefire插件实现单元测试与集成测试

    原文链接
    http://my.oschina.net/dlpinghailinfeng/blog/301136

    maven单元测试与集成测试

    1. 通过maven的Profile
    2. 配置生命周期 通过maven-surefire-plugin的生命周期配置不同的测试范围

    如下使用的是方式2
    unit包中包含的是单元测试
    integration包种包含的是集成测试

    <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.9</version>
                    <configuration>
                        <skip>true</skip>
                    </configuration>
                    <executions>
                        <execution>
                            <id>run-integration-test</id>
                            <phase>integration-test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <skip>false</skip>
                                <includes>
                                    <include>**/integration/**/*.java</include>
                                </includes>
                            </configuration>
                        </execution>
                        <execution>
                            <id>run-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <skip>false</skip>
                                <includes>
                                    <include>**/unit/**/*.java</include>
                                </includes>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.0</version>
                    <configuration>
                        <dependentWarExcludes>WEB-INF/lib</dependentWarExcludes>
                    </configuration>
                </plugin>
            </plugins>
    
  • 相关阅读:
    Java学习9
    Windows环境下实现WireShark抓取HTTPS
    WireShark新手使用教程
    charles使用教程
    charles
    知道做到
    Appium 自动化测试改造思路
    今日总结
    今日总结
    今日总结
  • 原文地址:https://www.cnblogs.com/laoniu85/p/5128408.html
Copyright © 2011-2022 走看看