JUnit断言方法有很多不过可以很清楚地从其子面看出其功能常用的方法如下assertEquals(a b) Asserts that two primitive values are equal
测试a是否等于b(a和b是原始类型数值(primitive value)或者必须为实现比较而具有equal方法)
assertFalse(a) Asserts that a condition (a) is false
测试a是否为false(假)a是一个Boolean数值
assertTrue(a) Asserts that a condition is true
测试a是否为true(真)a是一个Boolean数值
assertNotNull(a) Asserts that an object isnt null
测试a是否非空a是一个对象或者null
assertNull(a) Asserts that an object is null
测试a是否为nulla是一个对象或者null
assertNotSame(a b) Asserts that two objects do not refer to the same object
测试a和b是否没有都引用同一个对象
assertSame(a b) Asserts that two objects refer to the same object
测试a和b是否都引用同一个对象