final String packageName = DeployedXmlDataSourceManagementTestCase.class.getPackage().getName().replace(".", "/");
DeploymentPlan plan = manager.newDeploymentPlan()
.add(DeployedXmlDataSourceManagementTestCase.class.getResource("/" + packageName + "/" + TEST_DS_XML)).andDeploy()
.build();
Future<ServerDeploymentPlanResult> future = manager.execute(plan);
ServerDeploymentPlanResult result = future.get(20, TimeUnit.SECONDS);
ServerDeploymentActionResult actionResult = result.getDeploymentActionResult(plan.getId());
if (actionResult != null) {
final Throwable deploymentException = actionResult.getDeploymentException();
if (deploymentException != null) {
throw new RuntimeException(deploymentException);
}
}
plan = manager.newDeploymentPlan()
.add(DeployedXmlDataSourceManagementTestCase.class.getResource("/" + packageName + "/" + JPA_DS_XML)).andDeploy()
.build();
future = manager.execute(plan);
future.get(20, TimeUnit.SECONDS);
actionResult = result.getDeploymentActionResult(plan.getId());
if (actionResult != null) {
final Throwable deploymentException = actionResult.getDeploymentException();
if (deploymentException != null) {
throw new RuntimeException(deploymentException);
}