1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.hadoop.hbase.catalog;
21
22 import org.apache.commons.logging.Log;
23 import org.apache.commons.logging.LogFactory;
24 import org.apache.hadoop.hbase.Abortable;
25 import org.apache.hadoop.hbase.HBaseTestingUtility;
26 import org.apache.hadoop.hbase.HServerAddress;
27 import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
28 import org.junit.Test;
29
30
31
32
33 public class TestCatalogTrackerOnCluster {
34 private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
35 private static final Log LOG =
36 LogFactory.getLog(TestCatalogTrackerOnCluster.class);
37
38
39
40
41
42 @Test public void testBadOriginalRootLocation() throws Exception {
43 UTIL.getConfiguration().setInt("ipc.socket.timeout", 3000);
44
45 UTIL.startMiniCluster();
46
47 UTIL.shutdownMiniHBaseCluster();
48
49 ZooKeeperWatcher zookeeper = new ZooKeeperWatcher(UTIL.getConfiguration(),
50 "Bad Root Location Writer", new Abortable() {
51 @Override
52 public void abort(String why, Throwable e) {
53 LOG.error("Abort was called on 'bad root location writer'", e);
54 }
55 });
56 HServerAddress nonsense = new HServerAddress("example.org:1234");
57 RootLocationEditor.setRootLocation(zookeeper, nonsense);
58
59
60 UTIL.startMiniHBaseCluster(1, 1);
61 UTIL.shutdownMiniCluster();
62 }
63 }