1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.mapreduce;
19
20 import org.apache.hadoop.hbase.SmallTests;
21 import org.junit.Test;
22 import org.junit.experimental.categories.Category;
23
24 import java.util.HashSet;
25
26 import static junit.framework.Assert.assertEquals;
27 import static org.junit.Assert.assertTrue;
28
29 @Category(SmallTests.class)
30 public class TestTableSplit {
31 @Test
32 public void testHashCode() {
33 TableSplit split1 = new TableSplit("table".getBytes(), "row-start".getBytes(), "row-end".getBytes(), "location");
34 TableSplit split2 = new TableSplit("table".getBytes(), "row-start".getBytes(), "row-end".getBytes(), "location");
35 assertEquals (split1, split2);
36 assertTrue (split1.hashCode() == split2.hashCode());
37 HashSet<TableSplit> set = new HashSet<TableSplit>(2);
38 set.add(split1);
39 set.add(split2);
40 assertTrue(set.size() == 1);
41 }
42
43 @org.junit.Rule
44 public org.apache.hadoop.hbase.ResourceCheckerJUnitRule cu =
45 new org.apache.hadoop.hbase.ResourceCheckerJUnitRule();
46 }
47