-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTestTrigram.java
43 lines (30 loc) · 1.15 KB
/
TestTrigram.java
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
33
34
35
36
37
38
39
40
41
42
43
import org.apache.hadoop.io.Text;
public class TestTrigram {
public static void main(String args[]) {
testToString();
testCompareTo();
}
public static void testToString() {
Text x = new Text("hello");
Text y = new Text("trigram");
Text z = new Text("test");
Trigram tg = new Trigram(x,y,z);
System.out.println(tg.toString());
}
public static void testCompareTo() {
Text x = new Text("hello");
Text y = new Text("trigram");
Text z = new Text("test");
Trigram tg = new Trigram(x,y,z);
Trigram other = new Trigram(x,y,z);
if (tg.compareTo(other) == 0) {
System.out.println("PASS: Comparison of equal objects");
}
else {System.out.println("FAIL: Comparison of equal objects ");}
Trigram other2 = new Trigram();
if (tg.compareTo(other2) != 0) {
System.out.println("PASS: Comparison of non equal objects");
}
else {System.out.println("FAIL: Comparison of non-equal objects");}
}
}