ANT:与Junit的整合(一):Junit4
2015-12-16 08:18
344 查看
public class TestHello {
private HelloWorld hw;
@Before
public void setUp() {
hw = new HelloWorld();
}
@Test
public void testHello() {
String str = hw.hello();
assertEquals("hello 测试失败",str,"world");
}
@Test
public void testWorld() {
String str = hw.world();
assertEquals("world 测试失败",str, "hello");
}
@Test
public void testNil() {
assertNull("对象不为空",hw.nil());
}
@Test
public void testNotNil() {
assertNotNull("对象为空", hw.notNil());
}
@Test(expected=NumberFormatException.class)
public void testExt() {
hw.ext();
}
@After
public void tearDown() {
hw = null;
}
}
private HelloWorld hw;
@Before
public void setUp() {
hw = new HelloWorld();
}
@Test
public void testHello() {
String str = hw.hello();
assertEquals("hello 测试失败",str,"world");
}
@Test
public void testWorld() {
String str = hw.world();
assertEquals("world 测试失败",str, "hello");
}
@Test
public void testNil() {
assertNull("对象不为空",hw.nil());
}
@Test
public void testNotNil() {
assertNotNull("对象为空", hw.notNil());
}
@Test(expected=NumberFormatException.class)
public void testExt() {
hw.ext();
}
@After
public void tearDown() {
hw = null;
}
}
相关文章推荐
- HDU5583 Kingdom of Black and White (暴力)
- 《iOS Human Interface Guidelines》——3D Touch
- 声音文件Sample数据读取
- ANT:与Junit的整合(一):Junit3
- LeetCode(199) Binary Tree Right Side View解题报告
- HDU4825 Xor Sum 字典树
- 如何更改MyEclipse所创建的jsp工程的编码方式为utf-8
- 判斷 iPhone 是否已插入 SIM 卡的方法
- ANT:属性、环境属性、Ant属性
- 修改字符串 ToCharArray()
- MySQL中CREATE DATABASE和CREATE SCHEMA区别
- 浅谈如何带领好一个团队
- 浅谈如何带领好一个团队
- PHP7新特性
- ANT:安装、基本使用
- 中小型公司静态资源管理部署方案
- python --批量重命名文件名
- Windows下Python添加库(模块)路径
- Ubuntu选择python版本
- hdu 1542 矩形面积并(扫描线+线段树)