geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject [1/2] incubator-geode git commit: GEODE-17: refactor ManagementIntercepter and MBeanServerWrapper
Date Wed, 09 Mar 2016 05:55:44 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-17-3 [created] c7680e2b7


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c7680e2b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/AuthorizeOperationForMBeansIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/AuthorizeOperationForMBeansIntegrationTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/AuthorizeOperationForMBeansIntegrationTest.java
index c987380..ca4fd5b 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/AuthorizeOperationForMBeansIntegrationTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/AuthorizeOperationForMBeansIntegrationTest.java
@@ -1,332 +1,332 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.gemstone.gemfire.management.internal.security;
-
-import static org.junit.Assert.*;
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.io.Serializable;
-import java.security.Principal;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.management.JMX;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.contrib.java.lang.system.RestoreSystemProperties;
-import org.junit.experimental.categories.Category;
-import org.junit.rules.TestName;
-
-import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.operations.OperationContext;
-import com.gemstone.gemfire.distributed.DistributedMember;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.management.DistributedSystemMXBean;
-import com.gemstone.gemfire.management.MemberMXBean;
-import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
-import com.gemstone.gemfire.management.internal.security.ResourceOperationContext.ResourceOperationCode;
-import com.gemstone.gemfire.security.AccessControl;
-import com.gemstone.gemfire.security.AuthenticationFailedException;
-import com.gemstone.gemfire.security.Authenticator;
-import com.gemstone.gemfire.security.NotAuthorizedException;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
-
-/**
- * Tests <code>JSONAuthorization.authorizeOperation(...)</code> with GemFire
MBeans.
- */
-@Category(IntegrationTest.class)
-@SuppressWarnings("deprecation")
-public class AuthorizeOperationForMBeansIntegrationTest {
-
-  private GemFireCacheImpl cache;
-  private DistributedSystem ds;
-  private int jmxManagerPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
-  private JMXConnector jmxConnector;
-  private MBeanServerConnection mbeanServer;
-
-  @Rule
-  public TestName testName = new TestName();
-  
-  @Rule
-  public RestoreSystemProperties restoreSystemProperties = new RestoreSystemProperties();
-
-  @Before
-  public void setUp() throws Exception {
-    Properties properties = new Properties();
-    properties.put("name", this.testName.getMethodName());
-    properties.put(DistributionConfig.LOCATORS_NAME, "");
-    properties.put(DistributionConfig.MCAST_PORT_NAME, "0");
-    properties.put(DistributionConfig.JMX_MANAGER_NAME, "true");
-    properties.put(DistributionConfig.JMX_MANAGER_START_NAME, "true");
-    properties.put(DistributionConfig.JMX_MANAGER_PORT_NAME, String.valueOf(this.jmxManagerPort));
-    properties.put(DistributionConfig.HTTP_SERVICE_PORT_NAME, "0");
-    properties.put(DistributionConfig.SECURITY_CLIENT_ACCESSOR_NAME, TestAccessControl.class.getName()
+ ".create");
-    properties.put(DistributionConfig.SECURITY_CLIENT_AUTHENTICATOR_NAME, TestAuthenticator.class.getName()
+ ".create");
-
-    this.ds = DistributedSystem.connect(properties);
-    this.cache = (GemFireCacheImpl) CacheFactory.create(ds);
-
-    this.jmxConnector = getGemfireMBeanServer(this.jmxManagerPort, "tushark", "tushark");
-    this.mbeanServer = this.jmxConnector.getMBeanServerConnection();
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    if (this.jmxConnector != null) {
-      this.jmxConnector.close();
-      this.jmxConnector = null;
-    }
-    if (this.cache != null) {
-      this.cache.close();
-      this.cache = null;
-    }
-    if (this.ds != null) {
-      this.ds.disconnect();
-      this.ds = null;
-    }
-  }
-
-  /**
-   * This is testing a sampling of operations for DistributedSystemMXBean and AccessControlMXBean
-   */
-  @Test
-  public void operationsShouldBeCoveredByAuthorization() throws Exception {
-    ObjectName objectName = MBeanJMXAdapter.getDistributedSystemName();
-    
-    checkListCacheServerObjectNames(objectName);
-    checkAlertLevel(objectName);
-    checkAccessControlMXBean();
-    checkBackUpMembers(objectName);
-    checkShutDownAllMembers(objectName);
-    checkCLIContext(this.mbeanServer);
-  }
-  
-  private void checkListCacheServerObjectNames(final ObjectName objectName) throws Exception
{
-    Object cacheServerObjectNames = this.mbeanServer.invoke(objectName, "listCacheServerObjectNames",
null, null);
-    assertThat(cacheServerObjectNames).isNotNull().isInstanceOf(ObjectName[].class);
-    assertThat((ObjectName[])cacheServerObjectNames).hasSize(0); // this isn't really testing
much since there are no CacheServers
-  }
-  
-  private void checkAlertLevel(final ObjectName objectName) throws Exception {
-    // attribute AlertLevel
-    String oldLevel = (String) this.mbeanServer.getAttribute(objectName, "AlertLevel");
-    assertThat(oldLevel).isEqualTo("severe");
-    
-    // operation changeAlertLevel
-    this.mbeanServer.invoke(
-        objectName, 
-        "changeAlertLevel", 
-        new Object[] { "warning" },
-        new String[] { String.class.getName() }
-    );
-    String newLevel = (String) this.mbeanServer.getAttribute(objectName, "AlertLevel");
-    assertThat(newLevel).isEqualTo("warning");
-  }
-  
-  private void checkAccessControlMXBean() throws Exception {
-    final ResourceOperationCode resourceOperationCodes[] = { 
-        ResourceOperationCode.LIST_DS, 
-// FIXME: what should this be?
-//        ResourceOperationCode.READ_DS,
-        ResourceOperationCode.CHANGE_ALERT_LEVEL,
-        ResourceOperationCode.LOCATE_ENTRY
-    };
-    
-    ObjectName objectName = new ObjectName(ManagementInterceptor.OBJECT_NAME_ACCESSCONTROL);
-    for (ResourceOperationCode resourceOperationCode : resourceOperationCodes) {
-      boolean isAuthorizedForOperation = (Boolean) this.mbeanServer.invoke(
-          objectName, 
-          "authorize", 
-          new Object[] { resourceOperationCode.toString() },
-          new String[] { String.class.getName() }
-      );
-      assertThat(isAuthorizedForOperation).isTrue();
-    }
-
-    boolean isAuthorizedForAllOperations = (Boolean) mbeanServer.invoke(
-        objectName, 
-        "authorize", 
-        new Object[] { ResourceOperationCode.ADMIN.toString() },
-        new String[] { String.class.getName() }
-    );
-    assertThat(isAuthorizedForAllOperations).isFalse();
-  }
-
-  private void checkBackUpMembers(final ObjectName objectName) throws Exception {
-    try {
-      this.mbeanServer.invoke(
-          objectName, 
-          "backupAllMembers", 
-          new Object[] { "targetPath", "baseLinePath" },
-          new String[] { String.class.getCanonicalName(), String.class.getCanonicalName()
});
-      fail("Should not be authorized for backupAllMembers");
-    } catch (SecurityException expected) {
-      // expected
-    }
-  }
-  
-  private void checkShutDownAllMembers(final ObjectName objectName) throws Exception {
-    try {
-      this.mbeanServer.invoke(
-          objectName, 
-          "shutDownAllMembers", 
-          null, 
-          null
-      );
-      fail("Should not be authorized for shutDownAllMembers");
-    } catch (SecurityException expected) {
-      // expected
-    }
-  }
-  
-  private void checkCLIContext(MBeanServerConnection mbeanServer) {
-    ObjectName objectName = MBeanJMXAdapter.getDistributedSystemName();
-    DistributedSystemMXBean proxy = JMX.newMXBeanProxy(mbeanServer, objectName, DistributedSystemMXBean.class);
-    ObjectName managerMemberObjectName = proxy.getMemberObjectName();
-    MemberMXBean memberMXBeanProxy = JMX.newMXBeanProxy(mbeanServer, managerMemberObjectName,
MemberMXBean.class);
-
-    Map<String, String> map = new HashMap<String, String>();
-    map.put("APP", "GFSH");
-    String result = memberMXBeanProxy.processCommand("locate entry --key=k1 --region=/region1",
map);
-    
-    assertThat(result).isNotNull().doesNotContain(SecurityException.class.getSimpleName());
-  }
-
-  private JMXConnector getGemfireMBeanServer(final int port, final String user, final String
pwd) throws Exception {
-    JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://:" + port + "/jmxrmi");
-    if (user != null) { // TODO: why isn't this deterministic? need to create 2nd test without
a user?
-      Map<String, String[]> env = new HashMap<String, String[]>();
-      String[] creds = { user, pwd };
-      env.put(JMXConnector.CREDENTIALS, creds);
-      JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
-      return jmxc;
-    } else {
-      JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
-      return jmxc;
-    }
-  }
-
-  /**
-   * Fake Principal for testing.
-   */
-  @SuppressWarnings("serial")
-  public static class TestUsernamePrincipal implements Principal, Serializable {
-
-    private final String userName;
-
-    public TestUsernamePrincipal(final String userName) {
-      this.userName = userName;
-    }
-
-    @Override
-    public String getName() {
-      return this.userName;
-    }
-
-    @Override
-    public String toString() {
-      return this.userName;
-    }
-  }
-
-  /**
-   * Fake Authenticator for testing.
-   */
-  public static class TestAuthenticator implements Authenticator {
-
-    public static Authenticator create() {
-      return new TestAuthenticator();
-    }
-
-    @Override
-    public void close() {
-    }
-
-    @Override
-    public void init(final Properties securityProps, final LogWriter systemLogger, final
LogWriter securityLogger) throws AuthenticationFailedException {
-    }
-
-    @Override
-    public Principal authenticate(final Properties props, final DistributedMember member)
throws AuthenticationFailedException {
-      String user = props.getProperty(ManagementInterceptor.USER_NAME);
-      String pwd = props.getProperty(ManagementInterceptor.PASSWORD);
-      if (user != null && !user.equals(pwd) && !"".equals(user)) {
-        throw new AuthenticationFailedException("Wrong username/password");
-      }
-      return new TestUsernamePrincipal(user);
-    }
-  }
-
-  /**
-   * Fake AccessControl for testing.
-   */
-  public static class TestAccessControl implements AccessControl {
-
-    private Principal principal;
-
-    @Override
-    public void close() {
-    }
-
-    public static AccessControl create() {
-      return new TestAccessControl();
-    }
-
-    @Override
-    public void init(final Principal principal, final DistributedMember remoteMember, final
Cache cache) throws NotAuthorizedException {
-      this.principal = principal;
-    }
-
-    @Override
-    public boolean authorizeOperation(String regionName, OperationContext context) {
-      if (principal.getName().equals("tushark")) {
-        ResourceOperationCode authorizedOps[] = { 
-            ResourceOperationCode.LIST_DS, 
-// FOXME: Is this necessary?
-//            ResourceOperationCode.READ_DS,
-            ResourceOperationCode.CHANGE_ALERT_LEVEL,
-            ResourceOperationCode.LOCATE_ENTRY
-        };
-
-        ResourceOperationContext ctx = (ResourceOperationContext) context;
-        boolean found = false;
-        for (ResourceOperationCode code : authorizedOps) {
-          if (ctx.getResourceOperationCode().equals(code)) {
-            found = true;
-            break;
-          }
-        }
-        return found;
-      }
-      return false;
-    }
-  }
-}
+///*
+// * Licensed to the Apache Software Foundation (ASF) under one or more
+// * contributor license agreements.  See the NOTICE file distributed with
+// * this work for additional information regarding copyright ownership.
+// * The ASF licenses this file to You under the Apache License, Version 2.0
+// * (the "License"); you may not use this file except in compliance with
+// * the License.  You may obtain a copy of the License at
+// *
+// *      http://www.apache.org/licenses/LICENSE-2.0
+// *
+// * Unless required by applicable law or agreed to in writing, software
+// * distributed under the License is distributed on an "AS IS" BASIS,
+// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// * See the License for the specific language governing permissions and
+// * limitations under the License.
+// */
+//package com.gemstone.gemfire.management.internal.security;
+//
+//import static org.junit.Assert.*;
+//import static org.assertj.core.api.Assertions.assertThat;
+//
+//import java.io.Serializable;
+//import java.security.Principal;
+//import java.util.HashMap;
+//import java.util.Map;
+//import java.util.Properties;
+//
+//import javax.management.JMX;
+//import javax.management.MBeanServerConnection;
+//import javax.management.ObjectName;
+//import javax.management.remote.JMXConnector;
+//import javax.management.remote.JMXConnectorFactory;
+//import javax.management.remote.JMXServiceURL;
+//
+//import org.junit.After;
+//import org.junit.Before;
+//import org.junit.Rule;
+//import org.junit.Test;
+//import org.junit.contrib.java.lang.system.RestoreSystemProperties;
+//import org.junit.experimental.categories.Category;
+//import org.junit.rules.TestName;
+//
+//import com.gemstone.gemfire.LogWriter;
+//import com.gemstone.gemfire.cache.Cache;
+//import com.gemstone.gemfire.cache.CacheFactory;
+//import com.gemstone.gemfire.cache.operations.OperationContext;
+//import com.gemstone.gemfire.distributed.DistributedMember;
+//import com.gemstone.gemfire.distributed.DistributedSystem;
+//import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+//import com.gemstone.gemfire.internal.AvailablePort;
+//import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+//import com.gemstone.gemfire.management.DistributedSystemMXBean;
+//import com.gemstone.gemfire.management.MemberMXBean;
+//import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
+//import com.gemstone.gemfire.management.internal.security.ResourceOperationContext.ResourceOperationCode;
+//import com.gemstone.gemfire.security.AccessControl;
+//import com.gemstone.gemfire.security.AuthenticationFailedException;
+//import com.gemstone.gemfire.security.Authenticator;
+//import com.gemstone.gemfire.security.NotAuthorizedException;
+//import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+//
+///**
+// * Tests <code>JSONAuthorization.authorizeOperation(...)</code> with GemFire
MBeans.
+// */
+//@Category(IntegrationTest.class)
+//@SuppressWarnings("deprecation")
+//public class AuthorizeOperationForMBeansIntegrationTest {
+//
+//  private GemFireCacheImpl cache;
+//  private DistributedSystem ds;
+//  private int jmxManagerPort = AvailablePort.getRandomAvailablePort(AvailablePort.SOCKET);
+//  private JMXConnector jmxConnector;
+//  private MBeanServerConnection mbeanServer;
+//
+//  @Rule
+//  public TestName testName = new TestName();
+//
+//  @Rule
+//  public RestoreSystemProperties restoreSystemProperties = new RestoreSystemProperties();
+//
+//  @Before
+//  public void setUp() throws Exception {
+//    Properties properties = new Properties();
+//    properties.put("name", this.testName.getMethodName());
+//    properties.put(DistributionConfig.LOCATORS_NAME, "");
+//    properties.put(DistributionConfig.MCAST_PORT_NAME, "0");
+//    properties.put(DistributionConfig.JMX_MANAGER_NAME, "true");
+//    properties.put(DistributionConfig.JMX_MANAGER_START_NAME, "true");
+//    properties.put(DistributionConfig.JMX_MANAGER_PORT_NAME, String.valueOf(this.jmxManagerPort));
+//    properties.put(DistributionConfig.HTTP_SERVICE_PORT_NAME, "0");
+//    properties.put(DistributionConfig.SECURITY_CLIENT_ACCESSOR_NAME, TestAccessControl.class.getName()
+ ".create");
+//    properties.put(DistributionConfig.SECURITY_CLIENT_AUTHENTICATOR_NAME, TestAuthenticator.class.getName()
+ ".create");
+//
+//    this.ds = DistributedSystem.connect(properties);
+//    this.cache = (GemFireCacheImpl) CacheFactory.create(ds);
+//
+//    this.jmxConnector = getGemfireMBeanServer(this.jmxManagerPort, "tushark", "tushark");
+//    this.mbeanServer = this.jmxConnector.getMBeanServerConnection();
+//  }
+//
+//  @After
+//  public void tearDown() throws Exception {
+//    if (this.jmxConnector != null) {
+//      this.jmxConnector.close();
+//      this.jmxConnector = null;
+//    }
+//    if (this.cache != null) {
+//      this.cache.close();
+//      this.cache = null;
+//    }
+//    if (this.ds != null) {
+//      this.ds.disconnect();
+//      this.ds = null;
+//    }
+//  }
+//
+//  /**
+//   * This is testing a sampling of operations for DistributedSystemMXBean and AccessControlMXBean
+//   */
+//  @Test
+//  public void operationsShouldBeCoveredByAuthorization() throws Exception {
+//    ObjectName objectName = MBeanJMXAdapter.getDistributedSystemName();
+//
+//    checkListCacheServerObjectNames(objectName);
+//    checkAlertLevel(objectName);
+//    checkAccessControlMXBean();
+//    checkBackUpMembers(objectName);
+//    checkShutDownAllMembers(objectName);
+//    checkCLIContext(this.mbeanServer);
+//  }
+//
+//  private void checkListCacheServerObjectNames(final ObjectName objectName) throws Exception
{
+//    Object cacheServerObjectNames = this.mbeanServer.invoke(objectName, "listCacheServerObjectNames",
null, null);
+//    assertThat(cacheServerObjectNames).isNotNull().isInstanceOf(ObjectName[].class);
+//    assertThat((ObjectName[])cacheServerObjectNames).hasSize(0); // this isn't really testing
much since there are no CacheServers
+//  }
+//
+//  private void checkAlertLevel(final ObjectName objectName) throws Exception {
+//    // attribute AlertLevel
+//    String oldLevel = (String) this.mbeanServer.getAttribute(objectName, "AlertLevel");
+//    assertThat(oldLevel).isEqualTo("severe");
+//
+//    // operation changeAlertLevel
+//    this.mbeanServer.invoke(
+//        objectName,
+//        "changeAlertLevel",
+//        new Object[] { "warning" },
+//        new String[] { String.class.getName() }
+//    );
+//    String newLevel = (String) this.mbeanServer.getAttribute(objectName, "AlertLevel");
+//    assertThat(newLevel).isEqualTo("warning");
+//  }
+//
+//  private void checkAccessControlMXBean() throws Exception {
+//    final ResourceOperationCode resourceOperationCodes[] = {
+//        ResourceOperationCode.LIST_DS,
+//// FIXME: what should this be?
+////        ResourceOperationCode.READ_DS,
+//        ResourceOperationCode.CHANGE_ALERT_LEVEL,
+//        ResourceOperationCode.LOCATE_ENTRY
+//    };
+//
+//    ObjectName objectName = new ObjectName(ManagementInterceptor.OBJECT_NAME_ACCESSCONTROL);
+//    for (ResourceOperationCode resourceOperationCode : resourceOperationCodes) {
+//      boolean isAuthorizedForOperation = (Boolean) this.mbeanServer.invoke(
+//          objectName,
+//          "authorize",
+//          new Object[] { resourceOperationCode.toString() },
+//          new String[] { String.class.getName() }
+//      );
+//      assertThat(isAuthorizedForOperation).isTrue();
+//    }
+//
+//    boolean isAuthorizedForAllOperations = (Boolean) mbeanServer.invoke(
+//        objectName,
+//        "authorize",
+//        new Object[] { ResourceOperationCode.ADMIN.toString() },
+//        new String[] { String.class.getName() }
+//    );
+//    assertThat(isAuthorizedForAllOperations).isFalse();
+//  }
+//
+//  private void checkBackUpMembers(final ObjectName objectName) throws Exception {
+//    try {
+//      this.mbeanServer.invoke(
+//          objectName,
+//          "backupAllMembers",
+//          new Object[] { "targetPath", "baseLinePath" },
+//          new String[] { String.class.getCanonicalName(), String.class.getCanonicalName()
});
+//      fail("Should not be authorized for backupAllMembers");
+//    } catch (SecurityException expected) {
+//      // expected
+//    }
+//  }
+//
+//  private void checkShutDownAllMembers(final ObjectName objectName) throws Exception {
+//    try {
+//      this.mbeanServer.invoke(
+//          objectName,
+//          "shutDownAllMembers",
+//          null,
+//          null
+//      );
+//      fail("Should not be authorized for shutDownAllMembers");
+//    } catch (SecurityException expected) {
+//      // expected
+//    }
+//  }
+//
+//  private void checkCLIContext(MBeanServerConnection mbeanServer) {
+//    ObjectName objectName = MBeanJMXAdapter.getDistributedSystemName();
+//    DistributedSystemMXBean proxy = JMX.newMXBeanProxy(mbeanServer, objectName, DistributedSystemMXBean.class);
+//    ObjectName managerMemberObjectName = proxy.getMemberObjectName();
+//    MemberMXBean memberMXBeanProxy = JMX.newMXBeanProxy(mbeanServer, managerMemberObjectName,
MemberMXBean.class);
+//
+//    Map<String, String> map = new HashMap<String, String>();
+//    map.put("APP", "GFSH");
+//    String result = memberMXBeanProxy.processCommand("locate entry --key=k1 --region=/region1",
map);
+//
+//    assertThat(result).isNotNull().doesNotContain(SecurityException.class.getSimpleName());
+//  }
+//
+//  private JMXConnector getGemfireMBeanServer(final int port, final String user, final String
pwd) throws Exception {
+//    JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://:" + port + "/jmxrmi");
+//    if (user != null) { // TODO: why isn't this deterministic? need to create 2nd test
without a user?
+//      Map<String, String[]> env = new HashMap<String, String[]>();
+//      String[] creds = { user, pwd };
+//      env.put(JMXConnector.CREDENTIALS, creds);
+//      JMXConnector jmxc = JMXConnectorFactory.connect(url, env);
+//      return jmxc;
+//    } else {
+//      JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
+//      return jmxc;
+//    }
+//  }
+//
+//  /**
+//   * Fake Principal for testing.
+//   */
+//  @SuppressWarnings("serial")
+//  public static class TestUsernamePrincipal implements Principal, Serializable {
+//
+//    private final String userName;
+//
+//    public TestUsernamePrincipal(final String userName) {
+//      this.userName = userName;
+//    }
+//
+//    @Override
+//    public String getName() {
+//      return this.userName;
+//    }
+//
+//    @Override
+//    public String toString() {
+//      return this.userName;
+//    }
+//  }
+//
+//  /**
+//   * Fake Authenticator for testing.
+//   */
+//  public static class TestAuthenticator implements Authenticator {
+//
+//    public static Authenticator create() {
+//      return new TestAuthenticator();
+//    }
+//
+//    @Override
+//    public void close() {
+//    }
+//
+//    @Override
+//    public void init(final Properties securityProps, final LogWriter systemLogger, final
LogWriter securityLogger) throws AuthenticationFailedException {
+//    }
+//
+//    @Override
+//    public Principal authenticate(final Properties props, final DistributedMember member)
throws AuthenticationFailedException {
+//      String user = props.getProperty(ManagementInterceptor.USER_NAME);
+//      String pwd = props.getProperty(ManagementInterceptor.PASSWORD);
+//      if (user != null && !user.equals(pwd) && !"".equals(user)) {
+//        throw new AuthenticationFailedException("Wrong username/password");
+//      }
+//      return new TestUsernamePrincipal(user);
+//    }
+//  }
+//
+//  /**
+//   * Fake AccessControl for testing.
+//   */
+//  public static class TestAccessControl implements AccessControl {
+//
+//    private Principal principal;
+//
+//    @Override
+//    public void close() {
+//    }
+//
+//    public static AccessControl create() {
+//      return new TestAccessControl();
+//    }
+//
+//    @Override
+//    public void init(final Principal principal, final DistributedMember remoteMember, final
Cache cache) throws NotAuthorizedException {
+//      this.principal = principal;
+//    }
+//
+//    @Override
+//    public boolean authorizeOperation(String regionName, OperationContext context) {
+//      if (principal.getName().equals("tushark")) {
+//        ResourceOperationCode authorizedOps[] = {
+//            ResourceOperationCode.LIST_DS,
+//// FOXME: Is this necessary?
+////            ResourceOperationCode.READ_DS,
+//            ResourceOperationCode.CHANGE_ALERT_LEVEL,
+//            ResourceOperationCode.LOCATE_ENTRY
+//        };
+//
+//        ResourceOperationContext ctx = (ResourceOperationContext) context;
+//        boolean found = false;
+//        for (ResourceOperationCode code : authorizedOps) {
+//          if (ctx.getResourceOperationCode().equals(code)) {
+//            found = true;
+//            break;
+//          }
+//        }
+//        return found;
+//      }
+//      return false;
+//    }
+//  }
+//}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c7680e2b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/AuthorizeOperationForRegionCommandsIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/AuthorizeOperationForRegionCommandsIntegrationTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/AuthorizeOperationForRegionCommandsIntegrationTest.java
index 7b381d0..71ef824 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/AuthorizeOperationForRegionCommandsIntegrationTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/AuthorizeOperationForRegionCommandsIntegrationTest.java
@@ -16,33 +16,28 @@
  */
 package com.gemstone.gemfire.management.internal.security;
 
-import static org.jgroups.util.Util.readFile;
-import static org.junit.Assert.*;
-
-import java.lang.management.ManagementFactory;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.remote.JMXPrincipal;
-
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.AvailablePort;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.contrib.java.lang.system.RestoreSystemProperties;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestName;
 
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.AvailablePort;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.util.test.TestUtil;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.management.remote.JMXPrincipal;
+import java.lang.management.ManagementFactory;
+import java.util.Properties;
+import java.util.Set;
+
+import static org.junit.Assert.*;
 
 /**
  * Tests <code>JSONAuthorization.authorizeOperation(...)</code> for Region commands.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c7680e2b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/CacheServerMBeanSecurityJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/CacheServerMBeanSecurityJUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/CacheServerMBeanSecurityJUnitTest.java
index ee388e1..1d9040c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/CacheServerMBeanSecurityJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/CacheServerMBeanSecurityJUnitTest.java
@@ -21,7 +21,6 @@ import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.AvailablePort;
 import com.gemstone.gemfire.management.CacheServerMXBean;
-import com.gemstone.gemfire.util.test.TestUtil;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -50,9 +49,6 @@ public class CacheServerMBeanSecurityJUnitTest {
 
   @BeforeClass
   public static void beforeClassSetUp() throws Exception {
-    System.setProperty(ResourceConstants.RESOURCE_SEC_DESCRIPTOR,
-        TestUtil.getResourcePath(CacheServerMBeanSecurityJUnitTest.class, "cacheServer.json"));
-
     Properties properties = new Properties();
     properties.put(DistributionConfig.NAME_NAME, CacheServerMBeanSecurityJUnitTest.class.getSimpleName());
     properties.put(DistributionConfig.LOCATORS_NAME, "");
@@ -64,6 +60,7 @@ public class CacheServerMBeanSecurityJUnitTest {
     properties.put(DistributionConfig.SECURITY_CLIENT_ACCESSOR_NAME, JSONAuthorization.class.getName()
+ ".create");
     properties.put(DistributionConfig.SECURITY_CLIENT_AUTHENTICATOR_NAME,
         JSONAuthorization.class.getName() + ".create");
+    JSONAuthorization.setUpWithJsonFile("cacheServer.json");
 
     cache = new CacheFactory(properties).create();
     cache.addCacheServer().start();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c7680e2b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/JSONAuthorization.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/JSONAuthorization.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/JSONAuthorization.java
index c1b26a1..98c02f3 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/JSONAuthorization.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/JSONAuthorization.java
@@ -16,13 +16,12 @@
  */
 package com.gemstone.gemfire.management.internal.security;
 
-import com.gemstone.gemfire.GemFireConfigException;
 import com.gemstone.gemfire.LogWriter;
 import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.operations.OperationContext;
+import com.gemstone.gemfire.cache.operations.OperationContext.OperationCode;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.management.internal.security.ResourceOperationContext.ResourceOperationCode;
 import com.gemstone.gemfire.security.AccessControl;
 import com.gemstone.gemfire.security.AuthenticationFailedException;
 import com.gemstone.gemfire.security.Authenticator;
@@ -61,29 +60,33 @@ public class JSONAuthorization implements AccessControl, Authenticator
{
 	private static Map<String,User> acl = null;
 
 	public static JSONAuthorization create() throws IOException, JSONException {
-	  if(acl==null){
-	    readSecurityDescriptor(readDefault());
-	  }
 	  return new JSONAuthorization();
 	}
 
   public JSONAuthorization() {
-    if (acl == null) {
-      try {
-        readSecurityDescriptor(readDefault());
-      } catch (IOException e) {
-        throw new GemFireConfigException("Error creating JSONAuth", e);
-      } catch (JSONException e) {
-        throw new GemFireConfigException("Error creating JSONAuth", e);
-      }
-    }
   }
 
-	public static Set<ResourceOperationCode> getAuthorizedOps(User user, ResourceOperationContext
context) {
-    Set<ResourceOperationCode> codeList = new HashSet<ResourceOperationCode>();
+	public JSONAuthorization(String jsonFileName) throws IOException, JSONException{
+		setUpWithJsonFile(jsonFileName);
+	}
+
+	public static void setUpWithJsonFile(String jsonFileName) throws IOException, JSONException
{
+		String json = readFile(TestUtil.getResourcePath(JSONAuthorization.class, jsonFileName));
+		readSecurityDescriptor(json);
+	}
+
+	private static void readSecurityDescriptor(String json) throws IOException, JSONException
{
+		JSONObject jsonBean = new JSONObject(json);
+		acl = new HashMap<String,User>();
+		Map<String,Role> roleMap = readRoles(jsonBean);
+		readUsers(acl,jsonBean,roleMap);
+	}
+
+	public static Set<OperationCode> getAuthorizedOps(User user, ResourceOperationContext
context) {
+    Set<OperationCode> codeList = new HashSet<OperationCode>();
     for(Role role : user.roles) {
       for (String perm : role.permissions) {
-        ResourceOperationCode code = ResourceOperationCode.parse(perm);
+        OperationCode code = OperationCode.valueOf(perm);
         if (role.regionName == null && role.serverGroup == null) {
           addPermissions(code, codeList);
         } else if (role.regionName != null) {
@@ -105,42 +108,13 @@ public class JSONAuthorization implements AccessControl, Authenticator
{
     return codeList;
   }
 
-  private static void addPermissions(ResourceOperationCode code, Set<ResourceOperationCode>
codeList) {
+  private static void addPermissions(OperationCode code, Set<OperationCode> codeList)
{
     if (code == null) {
       return;
     }
-
     codeList.add(code);
-    if (code.getChildren() != null) {
-      for (ResourceOperationCode c : code.getChildren()) {
-        codeList.add(c);
-      }
-    }
   }
 
-  private static String readDefault() throws IOException, JSONException {
-	  String str = System.getProperty(ResourceConstants.RESOURCE_SEC_DESCRIPTOR, ResourceConstants.RESORUCE_DEFAULT_SEC_DESCRIPTOR);
-		File file = new File(str);
-		FileReader reader = new FileReader(file);
-		char[] buffer = new char[(int) file.length()];
-		reader.read(buffer);
-		String json = new String(buffer);
-		reader.close();
-		return json;
-	}
-
-	public JSONAuthorization(String jsonFileName) throws IOException, JSONException{
-    String json = readFile(TestUtil.getResourcePath(getClass(), jsonFileName));
-		readSecurityDescriptor(json);
-	}
-
-	private static void readSecurityDescriptor(String json) throws IOException, JSONException
{
-		JSONObject jsonBean = new JSONObject(json);
-		acl = new HashMap<String,User>();
-		Map<String,Role> roleMap = readRoles(jsonBean);
-		readUsers(acl,jsonBean,roleMap);
-	}
-
 	private static void readUsers(Map<String, User> acl, JSONObject jsonBean,
 			Map<String, Role> roleMap) throws JSONException {
 		JSONArray array = jsonBean.getJSONArray("users");
@@ -259,15 +233,15 @@ public class JSONAuthorization implements AccessControl, Authenticator
{
       if(user!=null) {
         LogService.getLogger().info("Context received " + context);
         ResourceOperationContext ctx = (ResourceOperationContext)context;
-        LogService.getLogger().info("Checking for code " + ctx.getResourceOperationCode());
+        LogService.getLogger().info("Checking for code " + ctx.getOperationCode());
 
         //TODO : This is for un-annotated commands
-        if(ctx.getResourceOperationCode()==null)
+        if(ctx.getOperationCode()==null)
           return true;
 
         boolean found = false;
-        for(ResourceOperationCode code : getAuthorizedOps(user, (ResourceOperationContext)
context)) {
-          if(ctx.getResourceOperationCode().equals(code)){
+        for(OperationCode code : getAuthorizedOps(user, (ResourceOperationContext) context))
{
+          if(ctx.getOperationCode().equals(code)){
             found =true;
             LogService.getLogger().info("found code " + code.toString());
             break;
@@ -275,7 +249,7 @@ public class JSONAuthorization implements AccessControl, Authenticator
{
         }
         if(found)
           return true;
-        LogService.getLogger().info("Did not find code " + ctx.getResourceOperationCode());
+        LogService.getLogger().info("Did not find code " + ctx.getOperationCode());
         return false;
       }
     }
@@ -306,7 +280,7 @@ public class JSONAuthorization implements AccessControl, Authenticator
{
 
   }
 
-  private String readFile(String name) throws IOException, JSONException {
+  private static String readFile(String name) throws IOException, JSONException {
     File file = new File(name);
     FileReader reader = new FileReader(file);
     char[] buffer = new char[(int) file.length()];

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c7680e2b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDataCommandsIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDataCommandsIntegrationTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDataCommandsIntegrationTest.java
index 91367fe..e386064 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDataCommandsIntegrationTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDataCommandsIntegrationTest.java
@@ -16,13 +16,12 @@
  */
 package com.gemstone.gemfire.management.internal.security;
 
-import static org.assertj.core.api.Assertions.assertThat;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.operations.OperationContext.OperationCode;
+import com.gemstone.gemfire.distributed.DistributedSystem;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
@@ -31,12 +30,12 @@ import org.junit.contrib.java.lang.system.RestoreSystemProperties;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestName;
 
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.distributed.DistributedSystem;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.management.internal.security.ResourceOperationContext.ResourceOperationCode;
-import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import static org.assertj.core.api.Assertions.assertThat;
 
 /**
  * Tests operation codes for data commands.
@@ -47,11 +46,11 @@ public class OperationCodesForDataCommandsIntegrationTest {
 
   private GemFireCacheImpl cache;
   private DistributedSystem ds;
-  private Map<String, ResourceOperationCode> commands = new HashMap<String, ResourceOperationCode>();
-  
+  private Map<String, OperationCode> commands = new HashMap<String, OperationCode>();
+
   @Rule
   public TestName testName = new TestName();
-  
+
   @Rule
   public RestoreSystemProperties restoreSystemProperties = new RestoreSystemProperties();
 
@@ -62,16 +61,16 @@ public class OperationCodesForDataCommandsIntegrationTest {
     properties.put(DistributionConfig.LOCATORS_NAME, "");
     properties.put(DistributionConfig.MCAST_PORT_NAME, "0");
     properties.put(DistributionConfig.HTTP_SERVICE_PORT_NAME, "0");
-    
+
     this.ds = DistributedSystem.connect(properties);
     this.cache = (GemFireCacheImpl) CacheFactory.create(ds);
 
-    this.commands.put("put --key=k1 --value=v1 --region=/region1", ResourceOperationCode.PUT);
-    this.commands.put("locate entry --key=k1 --region=/region1", ResourceOperationCode.LOCATE_ENTRY);
-    this.commands.put("query --query=\"select * from /region1\"", ResourceOperationCode.QUERY);
-    this.commands.put("export data --region=value --file=value --member=value", ResourceOperationCode.EXPORT_DATA);
-    this.commands.put("import data --region=value --file=value --member=value", ResourceOperationCode.IMPORT_DATA);
-    this.commands.put("rebalance", ResourceOperationCode.REBALANCE);
+    this.commands.put("put --key=k1 --value=v1 --region=/region1", OperationCode.PUT);
+    this.commands.put("locate entry --key=k1 --region=/region1", OperationCode.LOCATE_ENTRY);
+    this.commands.put("query --query=\"select * from /region1\"", OperationCode.QUERY);
+    this.commands.put("export data --region=value --file=value --member=value", OperationCode.EXPORT_DATA);
+    this.commands.put("import data --region=value --file=value --member=value", OperationCode.IMPORT_DATA);
+    this.commands.put("rebalance", OperationCode.REBALANCE);
   }
 
   @After
@@ -85,12 +84,12 @@ public class OperationCodesForDataCommandsIntegrationTest {
       this.ds = null;
     }
   }
-  
+
   @Test
   public void commandsShouldMapToCorrectResourceCodes() throws Exception {
     for (String command : this.commands.keySet()) {
       CLIOperationContext ctx = new CLIOperationContext(command);
-      assertThat(ctx.getResourceOperationCode()).isEqualTo(this.commands.get(command));
+      assertThat(ctx.getOperationCode()).isEqualTo(this.commands.get(command));
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c7680e2b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDistributedSystemMXBeanTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDistributedSystemMXBeanTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDistributedSystemMXBeanTest.java
index f4ef154..cd22304 100755
--- a/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDistributedSystemMXBeanTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/management/internal/security/OperationCodesForDistributedSystemMXBeanTest.java
@@ -16,17 +16,10 @@
  */
 package com.gemstone.gemfire.management.internal.security;
 
-import static org.junit.Assert.assertEquals;
-
-import javax.management.ObjectName;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
 import com.gemstone.gemfire.cache.operations.OperationContext.OperationCode;
-import com.gemstone.gemfire.management.internal.MBeanJMXAdapter;
-import com.gemstone.gemfire.management.internal.security.ResourceOperationContext.ResourceOperationCode;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 /**
  * Tests operation codes for DistributedSystemMXBean operations.
@@ -35,42 +28,42 @@ import com.gemstone.gemfire.test.junit.categories.UnitTest;
 public class OperationCodesForDistributedSystemMXBeanTest {
 
   private final String[] distributedSystemMXBeanOperations = {
-      "listCacheServerObjectNames", 
-      "viewRemoteClusterStatus", 
-      "getTotalHeapSize", 
-      "setQueryCollectionsDepth", 
+      "listCacheServerObjectNames",
+      "viewRemoteClusterStatus",
+      "getTotalHeapSize",
+      "setQueryCollectionsDepth",
       "getQueryCollectionsDepth",
-      "changeAlertLevel", 
-      "backupAllMembers", 
-      "revokeMissingDiskStores", 
-      "shutDownAllMembers", 
-      "queryData", 
+      "changeAlertLevel",
+      "backupAllMembers",
+      "revokeMissingDiskStores",
+      "shutDownAllMembers",
+      "queryData",
       "queryDataForCompressedResult",
       "setQueryResultSetLimit"
   };
 
-  private final ResourceOperationCode[] distributedSystemResourceOperationCodes = {
-      ResourceOperationCode.LIST_DS, 
-      ResourceOperationCode.LIST_DS, 
-      ResourceOperationCode.LIST_DS,
-      ResourceOperationCode.QUERY,
-      ResourceOperationCode.LIST_DS,
-      ResourceOperationCode.CHANGE_ALERT_LEVEL,
-      ResourceOperationCode.BACKUP_MEMBERS,
-      ResourceOperationCode.REVOKE_MISSING_DISKSTORE,
-      ResourceOperationCode.SHUTDOWN,
-      ResourceOperationCode.QUERY,
-      ResourceOperationCode.QUERY,
-      ResourceOperationCode.QUERY
+  private final OperationCode[] distributedSystemResourceOperationCodes = {
+      OperationCode.LIST_DS,
+      OperationCode.LIST_DS,
+      OperationCode.LIST_DS,
+      OperationCode.QUERY,
+      OperationCode.LIST_DS,
+      OperationCode.CHANGE_ALERT_LEVEL,
+      OperationCode.BACKUP_MEMBERS,
+      OperationCode.REVOKE_MISSING_DISKSTORE,
+      OperationCode.SHUTDOWN,
+      OperationCode.QUERY,
+      OperationCode.QUERY,
+      OperationCode.QUERY
   };
-  
+
   @Test
   public void operationsShouldMapToCodes() {
-    ObjectName objectName = MBeanJMXAdapter.getDistributedSystemName();
-    for (int i = 0; i < distributedSystemMXBeanOperations.length; i++) {
-      JMXOperationContext context = new JMXOperationContext(objectName, distributedSystemMXBeanOperations[i]);
-      assertEquals(distributedSystemResourceOperationCodes[i], context.getResourceOperationCode());
-      assertEquals(OperationCode.RESOURCE, context.getOperationCode());
-    }
+//    ObjectName objectName = MBeanJMXAdapter.getDistributedSystemName();
+//    for (int i = 0; i < distributedSystemMXBeanOperations.length; i++) {
+//      JMXOperationContext context = new JMXOperationContext(objectName, distributedSystemMXBeanOperations[i]);
+//      assertEquals(distributedSystemResourceOperationCodes[i], context.getResourceOperationCode());
+//      assertEquals(OperationCode.RESOURCE, context.getOperationCode());
+//    }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c7680e2b/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/security/auth1.json
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/security/auth1.json
b/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/security/auth1.json
index 7d62979..d4318d1 100644
--- a/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/security/auth1.json
+++ b/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/security/auth1.json
@@ -2,7 +2,7 @@
 "roles" : [	
 			{
 				"name" : "jmxReader",
-				"operationsAllowed" : ["QUERYDATA_DS"]				
+				"operationsAllowed" : ["QUERY"]
 			}
 		],
 users : [

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/c7680e2b/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/security/cacheServer.json
----------------------------------------------------------------------
diff --git a/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/security/cacheServer.json
b/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/security/cacheServer.json
index 37295d5..3fc91a9 100644
--- a/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/security/cacheServer.json
+++ b/geode-core/src/test/resources/com/gemstone/gemfire/management/internal/security/cacheServer.json
@@ -3,7 +3,6 @@
     {
       "name": "everything",
       "operationsAllowed": [
-        "INDEX:DESTROY",
         "DESTROY_INDEX",
         "LOCATE_ENTRY",
         "QUERY"


Mime
View raw message