use of javax.management.j2ee.Management in project wildfly by wildfly.
the class Jsr77TestCase method testJSR77Availabilty.
/**
* Test for simple MBean functionality
*
* Catches NamingException if a naming exception is encountered in lookup() method.
* Catches CreateException Indicates a failure to create the EJB object in create() method.
* Catches RemoteException A communication exception occurred during the execution of a remote method call CreateException in create(), getDefaultDomain() or getMBeanCount() method.
*/
@Test
public void testJSR77Availabilty() {
try {
Context ic = new InitialContext();
Object obj = ic.lookup("ejb/mgmt/MEJB");
ManagementHome mejbHome = (ManagementHome) obj;
final Management management = mejbHome.create();
Assert.assertNotNull(management.getDefaultDomain());
Assert.assertTrue(management.getMBeanCount() > 0);
} catch (NamingException | CreateException | RemoteException ne) {
Assert.fail(ne.getMessage());
}
}
Aggregations