RSS feed
[root]
/
c02
/
code
/
TI Pattern
/
software design
/
document
testable
test
login:
password:
title search:
Search this site
Enter your search terms
Web
www.carfield.com.hk
Submit search form
Prev
Next
Wed Dec 26 16:00:00 GMT 2001
TestDemo
//: c02:TestDemo.java // Creating a test import com.bruceeckel.test.*; public class TestDemo { private static int objCounter = 0; private int id = ++objCounter; public TestDemo(String s) { System.out.println(s + ": count = " + id); } public void close() { System.out.println("Cleaning up: " + id); } public boolean someCondition() { return true; } public static class Test extends UnitTest { TestDemo test1 = new TestDemo("test1"); TestDemo test2 = new TestDemo("test2"); public void cleanup() { test2.close(); test1.close(); } public void testA() { System.out.println("TestDemo.testA"); affirm(test1.someCondition()); } public void testB() { System.out.println("TestDemo.testB"); affirm(test2.someCondition()); affirm(TestDemo.objCounter != 0); } // Causes the build to halt: //! public void test3() { affirm(false); } } } ///:~
(google search)
(amazon search)
1
2
3
second
download zip of files only
Prev
Next