* Test of setBookName method, of class BookBean.
*/
@Test
public void testSetBookName() {
System.out.println("setBookName");
String bookName = "";
BookBean instance = new BookBean();
instance.setBookName(bookName);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}
}
·對于要被測試的BookBean類中的四個方法,NetBeans都自動編寫了測試代碼框架。
·開發者可以根據需要對自動生成的測試代碼進行適當的修改。
三、修改并運行測試程序:
修改后的代碼如下:
view plaincopy to clipboardprint?
import junit.framework.*;
/**
*
* @author 雁過留聲
*/
public class BookBeanTest extends TestCase{
BookBean book = null;
文章來源于領測軟件測試網 http://www.kjueaiud.com/