1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.master;
19
20 import static org.junit.Assert.assertEquals;
21
22 import org.apache.hadoop.fs.Path;
23 import org.apache.hadoop.hbase.HBaseTestingUtility;
24 import org.apache.hadoop.hbase.testclassification.MasterTests;
25 import org.apache.hadoop.hbase.testclassification.MediumTests;
26 import org.apache.hadoop.hbase.util.FSUtils;
27 import org.junit.AfterClass;
28 import org.junit.BeforeClass;
29 import org.junit.Test;
30 import org.junit.experimental.categories.Category;
31
32
33
34
35 @Category({MasterTests.class, MediumTests.class})
36 public class TestMasterFileSystemWithWALDir {
37
38 private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
39
40 @BeforeClass
41 public static void setupTest() throws Exception {
42 UTIL.startMiniCluster(true);
43 }
44
45 @AfterClass
46 public static void teardownTest() throws Exception {
47 UTIL.shutdownMiniCluster();
48 }
49
50 @Test
51 public void testFsUriSetProperly() throws Exception {
52 HMaster master = UTIL.getMiniHBaseCluster().getMaster();
53 MasterFileSystem fs = master.getMasterFileSystem();
54 Path masterRoot = FSUtils.getRootDir(fs.getConfiguration());
55 Path rootDir = FSUtils.getRootDir(fs.getFileSystem().getConf());
56 assertEquals(masterRoot, rootDir);
57 assertEquals(FSUtils.getWALRootDir(UTIL.getConfiguration()), fs.getWALRootDir());
58 }
59 }