-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathNullObjectTest.java
More file actions
32 lines (22 loc) · 904 Bytes
/
NullObjectTest.java
File metadata and controls
32 lines (22 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package nullobject;
import junit.framework.TestCase;
import org.junit.Test;
public class NullObjectTest extends TestCase {
@Test
public void test() {
System.out.println("NullObjectTest:");
System.out.println("\tCreate two stubs 0002 and 0004\n");
System.out.println("\t0002 is in the Ticket Database");
System.out.println("\t0004 is not in the Ticket Database\n");
Stub stub = new Stub("0002","0002");
Stub stub1 = new Stub("0004","0004");
TicketFinder finder = new TicketFinder();
System.out.println("\tWe can find 0002:");
Ticket t = finder.Find(stub);
System.out.println("\t"+t.getInfo());
System.out.println("\tBut 0004 is an invalid Ticket:");
Ticket t1 = finder.Find(stub1);
System.out.println("\t"+t1.getInfo());
System.out.println("\nExit NullObjectTest");
}
}