@Override
 protected EmbeddedCacheManager createCacheManager() throws Exception {
   cacheManager =
       TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(JMX_DOMAIN, true, false);
   name = getCacheManagerObjectName(JMX_DOMAIN);
   server = PerThreadMBeanServerLookup.getThreadMBeanServer();
   server.invoke(name, "startCache", new Object[] {}, new String[] {});
   return cacheManager;
 }
  protected EmbeddedCacheManager createCacheManager() throws Exception {
    GlobalConfiguration globalConfiguration = GlobalConfiguration.getNonClusteredDefault();
    globalConfiguration.setExposeGlobalJmxStatistics(true);
    globalConfiguration.setMBeanServerLookup(PerThreadMBeanServerLookup.class.getName());
    globalConfiguration.setJmxDomain(JMX_DOMAIN);
    cacheManager = TestCacheManagerFactory.createCacheManagerEnforceJmxDomain(globalConfiguration);

    Configuration configuration = getDefaultClusteredConfig(Configuration.CacheMode.LOCAL);
    configuration.setExposeJmxStatistics(true);
    cacheManager.defineConfiguration("test", configuration);
    cache = cacheManager.getCache("test");
    advanced = cache.getAdvancedCache();
    mgmtInterceptor = getCacheObjectName(JMX_DOMAIN, "test(local)", "Statistics");

    threadMBeanServer = PerThreadMBeanServerLookup.getThreadMBeanServer();
    return cacheManager;
  }