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>
    
  • 相关阅读:
    join函数——Gevent源码分析
    代理上网(ssh 动态端口转发)
    内核热patch
    技术债
    mysql 隔离级别与间隙锁等
    python type
    django : related_name and related_query_name
    ssh 卡主
    logistics regression
    __new__ 和 __init__
  • 原文地址:https://www.cnblogs.com/laoniu85/p/5128408.html
Copyright © 2011-2022 走看看