protected void tearDown() throws Exception
{
if (jarNames != null)
{
JBossTestClusteredServices clusteredDelegate = (JBossTestClusteredServices) delegate;
// deploy the comma seperated list of jars
StringTokenizer st = new StringTokenizer(jarNames, ", ");
String[] depoyments = new String[st.countTokens()];
for (int i = depoyments.length - 1; i >= 0; i--)
depoyments[i] = st.nextToken();
for (int i = 0; i < depoyments.length; i++)
{
String jarName = depoyments[i];
this.getLog().debug("Attempt undeploy of " + jarName);
clusteredDelegate.undeploy(clusteredDelegate.getAdaptor(0), jarName);
this.getLog().debug("undeployed package: " + jarName);
}
}
JBossTestClusteredServices testServices = (JBossTestClusteredServices) delegate;
try
{
testServices.getAdaptor(1).invoke(new ObjectName("jboss.system:type=Server"), "shutdown", new Object[]{}, new String[]{});
log.info("Shut down jbm-cluster2");
}
catch (Exception ignored)
{
// expected if the test worked and shut down a server