ObjectName mbeanName = mBean.getMBeanName();
// we want to check that the mbean is register in the server and exposing the correct attribute values
// so we fetch the attributes from the server
Assert.assertEquals( releaseId.toExternalForm(), MBeanUtils.getAttribute( mbeanName, "ScannerReleaseId") );
Assert.assertEquals( releaseId.toExternalForm(), MBeanUtils.getAttribute( mbeanName, "CurrentReleaseId") );
Assert.assertEquals( InternalKieScanner.Status.STOPPED.toString(), MBeanUtils.getAttribute( mbeanName, "Status") );
MBeanUtils.invoke(mbeanName, "start", new Object[] { Long.valueOf(10000) }, new String[] { "long" } );
Assert.assertEquals( InternalKieScanner.Status.RUNNING.toString(), MBeanUtils.getAttribute( mbeanName, "Status") );