maven junit 单元测试插件配置
单元测试插件配置
pom.xml中增加
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
插件
<build>
<finalName>recommend-gate</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<parallel>methods</parallel>
<threadCount>10</threadCount>
</configuration>
</plugin>
</plugins>
</build>
此配置适合我厂私有仓库环境,
其他网上配置在公司目前私有maven仓库的情况下报maven 'modelVersion' is missing. @ [unknown-group-id]
使用样例如下:
import com.jd.app.server.recommend.manager.bean.RecommendParam;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Created by liubaofeng on 2016/11/22.
*/
public class ResolutionParamHelperTest {
@Test
public void resolution(){
RecommendParam recommendParam = ResolutionParamHelper.resolution(null);
assertEquals(recommendParam,null);
}
}
后边在汇总一下单元测试的统计等的配置
maven junit 单元测试插件配置的更多相关文章
- spring && Cobertura && maven &&junit 单元测试以及测试覆盖率
1. 目的: junit 单元测试,Cobertura 测试覆盖率报告 项目目录结构 2. maven 配置 <project xmlns= ...
- maven中jetty插件配置
maven中jetty插件的配置,可用于项目在内置jetty服务器中的部署. <plugin> <groupId>org.mortbay.jetty</groupId&g ...
- 笔记:Maven 仓库和插件配置本机私服
通过配置POM中的配置仓库和插件仓库,只在当前项目生效,而实际应用中,我们希望通过一次配置就能让本机所有的Maven项目都使用自己的Maven私服,这个时候我们需要配置 settings.xml文件, ...
- Junit单元测试-环境配置
JUnit是Java单元测试框架,已经在Eclipse中默认安装.目前主流的有JUnit3和JUnit4.JUnit3中,测试用例需要继承TestCase类.JUnit4中,测试用例无需继承TestC ...
- Eclipse下Maven插件配置
要做一个基于C/S架构的汽车租赁系统,由于在实习期间接触过一些Java和SpringMVC,Spring,Hibernate的东西,所以决定使用这个框架组合来完成这个项目. 首先是Maven的配置,为 ...
- Maven常用插件配置和使用
主要介绍Maven的几个常见第三方插件(cobertura.findbugs.source.assembly.插件开发)配置和使用,接Maven介绍 maven本质上是一个插件框架,它的所有工作都交给 ...
- Spring完全基于Java配置和集成Junit单元测试
要点: 配置继承WebApplicationInitializer的类作为启动类,相当于配置web.xml文件 使用@Configuration注解一个类,在类中的方式使用@Bean注解,则表名该方法 ...
- Maven中常用插件的配置
在Maven项目的pom.xml文件中配置插件信息,使用<build></build>标签 1.配置JDK版本插件和Tomcat版本插件 <build> <! ...
- maven常用插件配置详解
常用插件配置详解Java代码 <!-- 全局属性配置 --> <properties> <project.build.name>tools</proje ...
随机推荐
- php中文转换编码函数
$filename= $list->filename; // 获取文件名字 if(preg_match("/[\x80-\xff]/",$filename)){ // 如果是 ...
- 【leetcode】Best Time to Buy and Sell 2(too easy)
Say you have an array for which the ith element is the price of a given stock on day i. Design an al ...
- 9.12/ css3拓展、js基础语法、程序基本知识、数据类型、运算符表达方式、语句知识点
css3拓展: <display:none> 将某个元素隐藏 <visibility:hidden> 也是将某个元素隐藏 <display:block&g ...
- windows端口备忘
FTP 端口号21 SSH 端口号22 Telnet 端口号23
- grep(Global Regular Expression Print)
.grep -iwr --color 'hellp' /home/weblogic/demo 或者 grep -iw --color 'hellp' /home/weblogic/demo/* (-i ...
- ArrayList 和 LinkedList 的区别
1.ArrayList是实现了基于动态数组的数据结构,LinkedList基于链表的数据结构.2.对于随机访问get和set,ArrayList优于LinkedList,因为LinkedList要移动 ...
- 瞧一瞧迷一般的SQLDA
With static SQL, host variables used in embedded SQL statements are known at application compile tim ...
- Foreign key (referential) constraints on DB2 LUW v105
oreign key constraints (also known as referential constraints or referential integrity constraints) ...
- 《Thinking in Java》十七章_容器深入研究_练习13(Page484)
练习13: 单词计数器 import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFou ...
- route netstat -rn
-n :不要使用通讯协定或主机名称,直接使用ip或port number; -ee:使用更详细的资讯来显示 [root@NB data]# route -nee Kernel IP routing t ...