System.err.println("测试开始!");
book = new BookBean();
System.out.println("BookBean对象被初始化。");
}
public void tearDown() throws Exception {
System.out.println("BookBean对象将被清理");
book = null;
System.out.println("测试结束!");
//调用超类的tearDown(),确保对象被清理
super.tearDown();
}
public static junit.framework.Test suite()
{
TestSuite suite = new TestSuite(BookBeanTest.class);
return suite;
}
public void testBookISBN() {
book.setBookISBN("ISBN 8-8000-8000-8");
//使用 Assert查看id的属性值是否为ISBN 8-8000-8000-8。
Assert.assertEquals("ISBN 8-8000-8000-8", book.getBookISBN());
System.out.println("BookISBN属性被测试!");
}
public void testBookName() {
book.setBookName("精通NetBeans");
文章来源于领测软件测试网 https://www.ltesting.net/