创建Java Project项目:ch02-internals

MasterTestSuite.java

package com.manning.junitbook.ch02.internals;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses; @RunWith(value = Suite.class)
@SuiteClasses(value = { TestSuiteA.class, TestSuiteB.class })
public class MasterTestSuite { }

TestSuiteA.java

package com.manning.junitbook.ch02.internals;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses; @RunWith(value = Suite.class)
@SuiteClasses(value = { TestCaseA.class })
public class TestSuiteA { }

TestSuiteB.java

package com.manning.junitbook.ch02.internals;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses; @RunWith(value = Suite.class)
@SuiteClasses(value = { TestCaseB.class })
public class TestSuiteB { }

TestCaseA.java

package com.manning.junitbook.ch02.internals;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

public class TestCaseA {
@Test
public void testA1() {
assertEquals("Dummy test-case", 1+1, 2);
}
}

TestCaseB.java

package com.manning.junitbook.ch02.internals;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class TestCaseB {
@Test
public void testB1() {
assertTrue("Dummy test-case", true);
}
}

注:层级关系Suite-->Suite--TestCase.

pom.xml

<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.manning.junitbook</groupId>
<artifactId>junit-in-action-II</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
<artifactId>ch02-internals</artifactId> <packaging>jar</packaging> <name>JUnitBook Chapter 2 - JUnit internals</name>
<url>http://maven.apache.org</url>
</project>

最新文章

  1. ES6 - Note2:解构赋值
  2. hashlib 和 hmac
  3. 二分图最大权最小权完美匹配模板KM
  4. Dubbo初探
  5. 单点登录CAS使用记(二):部署CAS服务器以及客户端
  6. Spark操作hbase
  7. wamp+python+CGI+wingIDE
  8. 通过 [&#39;1&#39;, &#39;2&#39;, &#39;3&#39;].map(parseInt) 学习 map 和 parseInt 函数
  9. 权限管理系统之项目框架搭建并集成日志、mybatis和分页
  10. C++ 编译发现 error C2146: syntax error : missing &#39;;&#39; before identifier &#39;m_ctrlserver&#39;
  11. Excel坐标自动在AutoCad绘图_4
  12. UML入门学习
  13. python--第十六天总结(bootstrap)
  14. AtCoder 瞎做
  15. Some Conclusions.
  16. ActiveMQ 入门Nodejs版
  17. algorithm.sty not found error in LaTeX 解决方法
  18. WPF Blend 一个动画结束后另一个动画开始执行(一个一个执行)
  19. 我的Java之旅——答答租车系统的改进
  20. 【quickhybrid】如何实现一个Hybrid框架

热门文章

  1. zabbix 监控特定进程
  2. 边坡优化主题5——bzoj 1096 [ZJOI2007]仓库建设 解决问题的方法
  3. 两个实验操作系统-ubuntu在安装配置pintos
  4. uva11922(强行用rope替代spaly)
  5. BestCoder Round#8 1003
  6. Windows Phone开发(28):隔离存储B
  7. linux free
  8. HT for Web嵌入QtWebKit的client解决方式
  9. muduo网络图书馆评测
  10. 分析java.lang.NullPointerException thrown in RelativeLayout measure()