http://kentbeck.github.com/junit/javadoc/latest/
补充:
static void |
assertTrue(String message, boolean condition) Asserts that a condition is true. |
代码如下:
package com.zzk.junit4.test; import static org.junit.Assert.*;//这是一个类不是包 import org.junit.After; import org.junit.Test; import com.zzk.junit4.T; public class TTest { @After public void tearDown() throws Exception { } @Test public void testAdd() { //fail("Not yet implemented"); int z = new T().add(5, 3); assertEquals(8, z);//期望值8,实际值z assertTrue(z>3); // assertTrue("z is too small",z>10); } }