try
{
assertServiceRunning(NAME_ONE);
assertServiceRunning(NAME_TWO);
MBeanServer server = getServer();
test1 = (Simple) server.getAttribute(NAME_ONE, "Instance");
assertEquals("()", test1.constructorUsed);
assertEquals(2, test1.createOrder);
assertEquals(4, test1.startOrder);
assertEquals(0, test1.stopOrder);
assertEquals(0, test1.destroyOrder);
test2 = (Simple) server.getAttribute(NAME_TWO, "Instance");
assertEquals("()", test2.constructorUsed);
assertEquals(1, test2.createOrder);
assertEquals(3, test2.startOrder);
assertEquals(0, test2.stopOrder);
assertEquals(0, test2.destroyOrder);
}
catch (Exception e)
{
error = true;
throw e;
}
catch (Error e)
{
error = true;
throw e;
}
finally
{
undeploy(mbeans);
if (error == false)
{
assertNoService(NAME_ONE);
assertNotRegistered(NAME_ONE);
assertEquals(2, test1.createOrder);
assertEquals(4, test1.startOrder);
assertEquals(5, test1.stopOrder);
assertEquals(7, test1.destroyOrder);
assertNoService(NAME_TWO);
assertNotRegistered(NAME_TWO);
assertEquals(1, test2.createOrder);
assertEquals(3, test2.startOrder);
assertEquals(6, test2.stopOrder);
assertEquals(8, test2.destroyOrder);
}
}
mbeans = deploy(resourceName);
try
{
assertServiceRunning(NAME_ONE);
assertServiceRunning(NAME_TWO);
MBeanServer server = getServer();
test1 = (Simple) server.getAttribute(NAME_ONE, "Instance");
assertEquals("()", test1.constructorUsed);
assertEquals(10, test1.createOrder);
assertEquals(12, test1.startOrder);
assertEquals(0, test1.stopOrder);
assertEquals(0, test1.destroyOrder);
test2 = (Simple) server.getAttribute(NAME_TWO, "Instance");
assertEquals("()", test2.constructorUsed);
assertEquals(9, test2.createOrder);
assertEquals(11, test2.startOrder);
assertEquals(0, test2.stopOrder);
assertEquals(0, test2.destroyOrder);