1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.security.visibility;
19
20 import static org.apache.hadoop.hbase.security.visibility.VisibilityConstants.LABELS_TABLE_NAME;
21
22 import org.apache.hadoop.hbase.HConstants;
23 import org.apache.hadoop.hbase.MediumTests;
24 import org.apache.hadoop.hbase.security.User;
25 import org.junit.AfterClass;
26 import org.junit.BeforeClass;
27 import org.junit.experimental.categories.Category;
28
29
30
31
32 @Category(MediumTests.class)
33 public class TestVisibilityLabelsWithDistributedLogReplay extends TestVisibilityLabels {
34
35 @BeforeClass
36 public static void setupBeforeClass() throws Exception {
37
38 conf = TEST_UTIL.getConfiguration();
39 conf.setBoolean(HConstants.DISTRIBUTED_LOG_REPLAY_KEY, true);
40 conf.setInt("hfile.format.version", 3);
41 conf.set("hbase.coprocessor.master.classes", VisibilityController.class.getName());
42 conf.set("hbase.coprocessor.region.classes", VisibilityController.class.getName());
43 conf.setClass(VisibilityUtils.VISIBILITY_LABEL_GENERATOR_CLASS, SimpleScanLabelGenerator.class,
44 ScanLabelGenerator.class);
45 conf.set("hbase.superuser", "admin");
46 TEST_UTIL.startMiniCluster(2);
47 SUPERUSER = User.createUserForTesting(conf, "admin", new String[] { "supergroup" });
48
49
50 TEST_UTIL.waitTableEnabled(LABELS_TABLE_NAME.getName(), 50000);
51 addLabels();
52 }
53 }