*
* @throws Exception
*/
public void testHotDeploymentBeans() throws Exception
{
ManagementView mgtView = getManagementView();
ComponentType type = new ComponentType("MCBean", "ServerConfig");
ManagedComponent mc = mgtView.getComponent("jboss.system:type=ServerConfig", type);
assertNotNull(mc);
ManagedProperty homeDirProperty = mc.getProperty("serverHomeDir");
assertNotNull("serverHomeDir property exists", homeDirProperty);
String homeDir = (String) ((SimpleValue) homeDirProperty.getValue()).getValue();
assertNotNull(homeDir);
// Manually copy the deployment
File deploy = new File(homeDir, "deploy/");
File hotDeployment = copyFile(deploy, HD_DEPLOYMENT);
File failedDeployment = copyFile(deploy, FAILING_DEPLOYMENT);
// Wait for HDScanner
Thread.sleep(8000);
// Reload mgtView
mgtView = getManagementView();
try
{
ManagedDeployment md = mgtView.getDeployment(HD_DEPLOYMENT);
assertNotNull("hd-beans not deployed", md);
assertEquals("deployment started", DeploymentState.STARTED, md.getDeploymentState());
// HDScanner will not undeploy failed deployment unlike the deployMgr
// the state should represent this as well
md = mgtView.getDeployment(FAILING_DEPLOYMENT);
assertNotNull("failed-beans", md);
assertEquals("deployment failed", DeploymentState.FAILED, md.getDeploymentState());
}
finally
{