// A test suite for the Book class. public class BookTest { Book htdp = new Book("HtDP", 500); Book anotherHtdp = new Book("HtDP", 500); Book htdch = new Book("HtDCH", 300); // Run the test suite for the same method public void testSameMethod() { SimpleTestHarness sth = new SimpleTestHarness("Test same Method "); sth.test(this.htdp + " same as " + htdch, false, htdp.same(htdch)); sth.test(this.htdp + " same as the other " + this.anotherHtdp, true, htdp.same(anotherHtdp)); sth.fullTestReport(); } /* // Run the test suite for someOtherMethod public void testSomeOtherMethod() { SimpleTestHarness sth = new SimpleTestHarness("Test some other method "); sth.test(...); ... sth.fullTestReport(); } */ // When we ask Eclipse to Run our program, it will begin inside // the main method public static void main(String[] args) { BookTest bookTest = new BookTest(); bookTest.testSameMethod(); // bookTest.testSomeOtherMethod(); } }