在IDEA中用JUnit的做測試
為什么在IDEA中用JUnit做測試沒有tearDownAfterClass這些方法呢?只有兩個before() 和 after()方法
/**?
*?Play?Tester.?
*?
*?@author?<Authors?name>?
*?@since?<pre>Apr?4,?2015</pre>?
*?@version?1.0?
*/?
public?class?PlayTest?{
@Before
public?void?before()?throws?Exception?{
????System.out.println("Before");
}?
@After
public?void?after()?throws?Exception?{
????System.out.println("After");
}?
/**?
*?
*?Method:?play(String?a)?
*?
*/?
@Test
public?void?testPlay()?throws?Exception?{?
????System.out.println("test?play");
}?
/**?
*?
*?Method:?add(int?a,?int?b)?
*?
*/?
@Test
public?void?testAdd()?throws?Exception?{?
????System.out.println("test?add");
}
/**?
*?
*?Method:?divide(Double?a,?Double?b)?
*?
*/?
@Test
public?void?testDivide()?throws?Exception?{?
????System.out.println("test?divide");
}
}
2015-04-04
知道了~原來都要自己寫。。。。