Search in sources :

Example 1 with JMXListener

use of org.apache.hadoop.hbase.JMXListener 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)

Example 2 with JMXListener

use of org.apache.hadoop.hbase.JMXListener in project hbase by apache.

the class TestMasterCoprocessorServices method testAccessControlServices.

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

Aggregations

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