geode-wan/src/test/java/org/apache/geode/management/WANManagementDUnitTest.java
@SuppressWarnings("serial")
  protected void checkSenderMBean(final VM vm, final String regionPath, boolean connected) {
    SerializableRunnable checkMBean = new SerializableRunnable("Check Sender MBean") {
      public void run() {
        Cache cache = GemFireCacheImpl.getInstance();
        ManagementService service = ManagementService.getManagementService(cache);

        GatewaySenderMXBean bean = service.getLocalGatewaySenderMXBean("pn");
        assertNotNull(bean);
        Awaitility.await().atMost(1, TimeUnit.MINUTES)
            .until(() -> assertEquals(connected, bean.isConnected()));

        ObjectName regionBeanName = service.getRegionMBeanName(
            cache.getDistributedSystem().getDistributedMember(), "/" + regionPath);
        RegionMXBean rBean = service.getMBeanInstance(regionBeanName, RegionMXBean.class);
        assertTrue(rBean.isGatewayEnabled());


      }
    };
    vm.invoke(checkMBean);
  }
/**
   * Checks whether a GatewayReceiverMBean is created or not
   * 
   * @param vm reference to VM
   */
Checks whether a GatewayReceiverMBean is created or not

@param vm reference to VM
Checks whether a GatewayReceiverMBean is created or not @param vm reference to VM
@SuppressWarnings("serial")
  protected void checkSenderMBean(final VM vm, final String regionPath, boolean connected) {
    SerializableRunnable checkMBean = new SerializableRunnable("Check Sender MBean") {
      public void run() {
        Cache cache = GemFireCacheImpl.getInstance();
        ManagementService service = ManagementService.getManagementService(cache);
        GatewaySenderMXBean bean = service.getLocalGatewaySenderMXBean("pn");
        assertNotNull(bean);
        Awaitility.await().atMost(1, TimeUnit.MINUTES)
            .until(() -> assertEquals(connected, bean.isConnected()));
        ObjectName regionBeanName = service.getRegionMBeanName(
            cache.getDistributedSystem().getDistributedMember(), "/" + regionPath);
        RegionMXBean rBean = service.getMBeanInstance(regionBeanName, RegionMXBean.class);
        assertTrue(rBean.isGatewayEnabled());
      }
    };
    vm.invoke(checkMBean);
  }
@ SuppressWarnings ( "serial" ) protected void checkSenderMBean ( final VM vm , final String regionPath , boolean connected ) { SerializableRunnable checkMBean = new SerializableRunnable ( "Check Sender MBean" ) { public void run ( ) { Cache cache = GemFireCacheImpl . getInstance ( ) ; ManagementService service = ManagementService . getManagementService ( cache ) ; GatewaySenderMXBean bean = service . getLocalGatewaySenderMXBean ( "pn" ) ; assertNotNull ( bean ) ; Awaitility . await ( ) . atMost ( 1 , TimeUnit . MINUTES ) . until ( ( ) -> assertEquals ( connected , bean . isConnected ( ) ) ) ; ObjectName regionBeanName = service . getRegionMBeanName ( cache . getDistributedSystem ( ) . getDistributedMember ( ) , "/" + regionPath ) ; RegionMXBean rBean = service . getMBeanInstance ( regionBeanName , RegionMXBean . class ) ; assertTrue ( rBean . isGatewayEnabled ( ) ) ; } } ; vm . invoke ( checkMBean ) ; }
Checks whether a GatewayReceiverMBean is created or not
Checks whether a GatewayReceiverMBean is created or not