KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > uk > co > jezuk > mango > GreaterThanTest


1 package uk.co.jezuk.mango;
2
3 import junit.framework.*;
4
5 public class GreaterThanTest extends TestCase
6 {
7   java.util.List JavaDoc list;
8
9   public GreaterThanTest(String JavaDoc name) { super(name); }
10   public static Test suite() { return new TestSuite(GreaterThanTest.class); }
11
12   private BinaryPredicate p_;
13
14   protected void setUp()
15   {
16     p_ = Predicates.GreaterThan();
17   } // setUp
18

19   public void test1()
20   {
21     assertEquals(false, p_.test(new Integer JavaDoc(1), new Integer JavaDoc(3)));
22   } // test1
23

24   public void test2()
25   {
26     assertEquals(false, p_.test("hello", "zibignew"));
27   } // test2
28

29   public void test3()
30   {
31     assertEquals(true, p_.test(new Integer JavaDoc(3), new Integer JavaDoc(1)));
32   } // test3
33

34   public void test4()
35   {
36     assertEquals(true, p_.test("hello", "aerosol"));
37   } // test4
38

39   public void test5()
40   {
41     assertEquals(false, p_.test(new Integer JavaDoc(3), new Integer JavaDoc(3)));
42   } // test5
43

44   public void test6()
45   {
46     assertEquals(false, p_.test("hello", "hello"));
47   } // test6
48

49   public void test7()
50   {
51     assertEquals(false, p_.test(null, null));
52   } // test7
53

54   public void test8()
55   {
56     assertEquals(false, p_.test(null, "word"));
57   } // test8
58

59   public void test9()
60   {
61     assertEquals(true, p_.test("word", null));
62   } // test9
63

64 } // GreaterThanTest
65
Popular Tags