owner/src/test/java/org/aeonbits/owner/jmx/JMXMBeanTest.java
@Test
	public void testMultipleBeanHandling() throws Throwable {
		Properties props = new Properties();
		
		JMXConfigMutableReloadable config = ConfigFactory.create(JMXConfigMutableReloadable.class, props);
		MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
		ObjectName mbeanName1 = new ObjectName(
				"org.aeonbits.owner.jmx:type=testMultipleBeanHandling,id=JMXConfigMutableReloadable");
		ObjectName mbeanName2 = new ObjectName(
				"org.aeonbits.owner.jmx:type=testMultipleBeanHandling2,id=JMXConfigMutableReloadable");		
		mbs.registerMBean(config, mbeanName1);
		mbs.registerMBean(config, mbeanName2);
		mbs.setAttribute(mbeanName1, new Attribute("port", "7878"));
		assertEquals("7878", mbs.getAttribute(mbeanName1, "port"));			
		assertEquals(mbs.getAttribute(mbeanName2, "port"), mbs.getAttribute(mbeanName1, "port"));		
	}
/*
	 * Test case for registering multiple mbeans with same configuration object.
	 */
Test case for registering multiple mbeans with same configuration object.
Test case for registering multiple mbeans with same configuration object .
@Test
	public void testMultipleBeanHandling() throws Throwable {
		Properties props = new Properties();
		JMXConfigMutableReloadable config = ConfigFactory.create(JMXConfigMutableReloadable.class, props);
		MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
		ObjectName mbeanName1 = new ObjectName(
				"org.aeonbits.owner.jmx:type=testMultipleBeanHandling,id=JMXConfigMutableReloadable");
		ObjectName mbeanName2 = new ObjectName(
				"org.aeonbits.owner.jmx:type=testMultipleBeanHandling2,id=JMXConfigMutableReloadable");		
		mbs.registerMBean(config, mbeanName1);
		mbs.registerMBean(config, mbeanName2);
		mbs.setAttribute(mbeanName1, new Attribute("port", "7878"));
		assertEquals("7878", mbs.getAttribute(mbeanName1, "port"));			
		assertEquals(mbs.getAttribute(mbeanName2, "port"), mbs.getAttribute(mbeanName1, "port"));		
	}
@ Test public void testMultipleBeanHandling ( ) throws Throwable { Properties props = new Properties ( ) ; JMXConfigMutableReloadable config = ConfigFactory . create ( JMXConfigMutableReloadable . class , props ) ; MBeanServer mbs = ManagementFactory . getPlatformMBeanServer ( ) ; ObjectName mbeanName1 = new ObjectName ( "org.aeonbits.owner.jmx:type=testMultipleBeanHandling,id=JMXConfigMutableReloadable" ) ; ObjectName mbeanName2 = new ObjectName ( "org.aeonbits.owner.jmx:type=testMultipleBeanHandling2,id=JMXConfigMutableReloadable" ) ; mbs . registerMBean ( config , mbeanName1 ) ; mbs . registerMBean ( config , mbeanName2 ) ; mbs . setAttribute ( mbeanName1 , new Attribute ( "port" , "7878" ) ) ; assertEquals ( "7878" , mbs . getAttribute ( mbeanName1 , "port" ) ) ; assertEquals ( mbs . getAttribute ( mbeanName2 , "port" ) , mbs . getAttribute ( mbeanName1 , "port" ) ) ; }
Test case for registering multiple mbeans with same configuration object.
Test case for registering multiple mbeans with same configuration object .