Search in sources :

Example 1 with VisibilityController

use of org.apache.hadoop.hbase.security.visibility.VisibilityController in project hbase by apache.

the class TestMasterCoprocessorServices method testVisibilityLabelServices.

@Test
public void testVisibilityLabelServices() {
    MasterCoprocessor defaultImpl = new VisibilityController();
    MasterCoprocessor customImpl = new MockVisibilityController();
    MasterCoprocessor unrelatedImpl = new JMXListener();
    assertTrue(masterServices.checkCoprocessorWithService(Collections.singletonList(defaultImpl), VisibilityLabelsService.Interface.class));
    assertTrue(masterServices.checkCoprocessorWithService(Collections.singletonList(customImpl), VisibilityLabelsService.Interface.class));
    assertFalse(masterServices.checkCoprocessorWithService(Collections.emptyList(), VisibilityLabelsService.Interface.class));
    assertFalse(masterServices.checkCoprocessorWithService(null, VisibilityLabelsService.Interface.class));
    assertFalse(masterServices.checkCoprocessorWithService(Collections.singletonList(unrelatedImpl), VisibilityLabelsService.Interface.class));
    assertTrue(masterServices.checkCoprocessorWithService(Arrays.asList(unrelatedImpl, customImpl), VisibilityLabelsService.Interface.class));
    assertTrue(masterServices.checkCoprocessorWithService(Arrays.asList(unrelatedImpl, defaultImpl), VisibilityLabelsService.Interface.class));
}
Also used : MasterCoprocessor(org.apache.hadoop.hbase.coprocessor.MasterCoprocessor) JMXListener(org.apache.hadoop.hbase.JMXListener) VisibilityController(org.apache.hadoop.hbase.security.visibility.VisibilityController) Test(org.junit.Test)

Aggregations

JMXListener (org.apache.hadoop.hbase.JMXListener)1 MasterCoprocessor (org.apache.hadoop.hbase.coprocessor.MasterCoprocessor)1 VisibilityController (org.apache.hadoop.hbase.security.visibility.VisibilityController)1 Test (org.junit.Test)1