first set up a new folder as your test class place, and then let your package in test class folder be the same name with your src folder. in the package of src folder,you can code the entity class, and in the test folder, write test class. here is the file strcture

and I use suite to finish many test case in one test.

here is a entrance class

here us the test parametered class

here is the coverage answer :

you can see src test case is 100%

tools we need are eclemma ,junit.jar,hamcrest.jar

test lab ~ triangle test by using junit and coverage的更多相关文章

  1. [ Java ] [ JUnit ] [ Eclipse ] coverage

    官方資訊: https://www.eclemma.org/ - 簡短使用範例說明: https://dzone.com/articles/java-code-coverage-in-eclipse ...

  2. 软件测试Lab 1 Junit and Eclemma

    首先安装eclipse 然后下载hamcrest-core-1.3.jar,下载地址:http://mvnrepository.com/artifact/org.hamcrest/hamcrest-c ...

  3. Lab1--关于安装JUnit的简要描述

    安装JUnit的过程描述: 下载两个jar包: hamcrest-all-1.3.jar junit-4.12.jar 注意在导入完成jar包之后不要随意改变jar包的路径. 创建java程序,书写如 ...

  4. Junit+ant+JaCoCo集成使用

    接上文,本文主要介绍Junit+ant+JaCoCo集成使用 1.工具的下载上传 需要的工具有: apache-ant-1.10.5-bin.tarapache-tomcat-8.0.50.tarja ...

  5. 软件测试-----Graph Coverage作业

    /******************************************************* * Finds and prints n prime integers * Jeff ...

  6. Blog2:nchu-software-oop-2022-4+5+期中

    Blog2:nchu-software-oop-2022-4+5+期中 一.前言 两次大作业是关于四边形和五边形的相关操作,类似于之前的三角形,但由于图形边数的变化,难度大大增加.对数学知识的运用考察 ...

  7. 用ant组建测试框架

    有时候由于公司网络或其它原因,无法采用maven,这时ant是一个比较理想的选择.以下是以ant为例,搭建一个测试框架 项目结构如下图: build.properties代码如下: # The sou ...

  8. [转载] JaCoCo:分析单元测试覆盖率的利器

    转载自http://www.ibm.com/developerworks/cn/java/j-lo-jacoco/和http://www.cnblogs.com/chenfengmugu/p/4937 ...

  9. 第64节:Java中的Spring Boot 2.0简介笔记

    Java中的Spring Boot 2.0简介笔记 spring boot简介 依赖java8的运行环境 多模块项目 打包和运行 spring boot是由spring framework构建的,sp ...

随机推荐

  1. [PCL]点云渐进形态学滤波

    PCL支持点云的形态学滤波,四种操作:侵蚀.膨胀.开(先侵蚀后膨胀).闭(先膨胀后侵蚀) 在#include <pcl/filters/morphological_filter.h>中定义 ...

  2. SpringMVC源码剖析(三)- DispatcherServlet的初始化流程

    在我们第一次学Servlet编程,学Java Web的时候,还没有那么多框架.我们开发一个简单的功能要做的事情很简单,就是继承HttpServlet,根据需要重写一下doGet,doPost方法,跳转 ...

  3. xl2tp部署

    参考 http://blog.51yip.com/linux/1795.html 说到VPN,就会想到google,满心的疼.以前写过一篇关于vpn的文单,请参考:centos5.5 vpn 安装配置 ...

  4. linux----------ab--性能测试工具

    ab.exe –n 10000 –c 100 localhost/index.php //其中-n代表请求数,-c代表并发数

  5. 显示textarea内容的时候没有自动换行

    显示textarea内容的时候没有自动换行,网上找了好久,在一个论坛里找到解决方法: 1.把从数据库读出来的内容存放在一个Div内,例如: <div class="new-commen ...

  6. java三大框架

    1定义 集成SSH框架的系统从职责上分为四层:表示层.业务逻辑层.数据持久层和域模块层,以帮助开发人员在短期内搭建结构清晰.可复用性好.维护方便的Web应用程序.其中使用Struts作为系统的整体基础 ...

  7. Android中top命令字段含义

    PID       PR     CPU%      S       #THR           VSS        RSS       PCY           UID      Name 1 ...

  8. org.springframework.dao.DataIntegrityViolationException:

    数据库用的hibernate,开发工具用的myeclipse,使用开发工具连接数据库生成hibernate基于xml的po类,运行时报org.springframework.dao.DataInteg ...

  9. MiniUI动态添加table表格

    本文将介绍一下,如何用Jquery MiniUi动态添加一行table表格 1.效果展示 ↓ 2.具体代码 <script type="text/javascript"> ...

  10. OA工作流规格--转

    工作流是整个OA系统的核心,也是BPM的核心,工作流到 底需要实现哪些功能,本文就此以用户的需求为蓝本进行阐述.工作流表面看起来是很简单的,无非是一个表单模板,一个流程定义,然后起草后根据设定的流程一 ...