public void setup(final ManagementClient managementClient, final String containerId) throws Exception {
ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(managementClient.getControllerClient());
final String packageName = DeployedXmlDataSourceManagementTestCase.class.getPackage().getName().replace(".", "/");
final DeploymentPlan plan = manager.newDeploymentPlan().add(DeployedXmlDataSourceManagementTestCase.class.getResource("/" + packageName + "/" + TEST_DS_XML)).andDeploy().build();
final Future<ServerDeploymentPlanResult> future = manager.execute(plan);
final ServerDeploymentPlanResult result = future.get(20, TimeUnit.SECONDS);
final ServerDeploymentActionResult actionResult = result.getDeploymentActionResult(plan.getId());
if (actionResult != null) {
if (actionResult.getDeploymentException() != null) {
throw new RuntimeException(actionResult.getDeploymentException());
}
}