/** * Get all {@link DeploymentDescription} defined to be deployed during Test startup for a specific {@link * TargetDescription} ordered. * * @param target * The Target to filter on * * @return A List of found {@link DeploymentDescription}. Will return a empty list if none are found. */ public List<Deployment> startupDeploymentsFor(TargetDescription target) { Validate.notNull(target, "Target must be specified"); List<Deployment> startupDeployments = new ArrayList<Deployment>(); for (Deployment deployment : deployments) { DeploymentDescription desc = deployment.getDescription(); if (desc.managed() && target.equals(desc.getTarget())) { startupDeployments.add(deployment); } } // sort them by order Collections.sort(startupDeployments, new Comparator<Deployment>() { public int compare(Deployment o1, Deployment o2) { return new Integer(o1.getDescription().getOrder()).compareTo(o2.getDescription().getOrder()); } }); return Collections.unmodifiableList(startupDeployments); }
/** * Get all {@link DeploymentDescription} defined to be deployed during Test startup for a specific {@link * TargetDescription} ordered. * * @param target * The Target to filter on * * @return A List of found {@link DeploymentDescription}. Will return a empty list if none are found. */ public List<Deployment> startupDeploymentsFor(TargetDescription target) { Validate.notNull(target, "Target must be specified"); List<Deployment> startupDeployments = new ArrayList<Deployment>(); for (Deployment deployment : deployments) { DeploymentDescription desc = deployment.getDescription(); if (desc.managed() && target.equals(desc.getTarget())) { startupDeployments.add(deployment); } } // sort them by order Collections.sort(startupDeployments, new Comparator<Deployment>() { public int compare(Deployment o1, Deployment o2) { return new Integer(o1.getDescription().getOrder()).compareTo(o2.getDescription().getOrder()); } }); return Collections.unmodifiableList(startupDeployments); }
@Override public Container getContainer(TargetDescription target) { Validate.notNull(target, "Target must be specified"); if (TargetDescription.DEFAULT.equals(target)) { return findDefaultContainer(); } return findMatchingContainer(target.getName()); }
@Override public Container getContainer(TargetDescription target) { Validate.notNull(target, "Target must be specified"); if (TargetDescription.DEFAULT.equals(target)) { return findDefaultContainer(); } return findMatchingContainer(target.getName()); }
@Override public Container getContainer(TargetDescription target) { Validate.notNull(target, "Target must be specified"); if (TargetDescription.DEFAULT.equals(target)) { return findDefaultContainer(); } return findMatchingContainer(target.getName()); }
/** * Validate that a deployment with a archive of the same name does not have the same taget */ private void validateNotSameArchiveAndSameTarget(DeploymentDescription deployment) { if (!deployment.isArchiveDeployment()) { return; } for (Deployment existing : archiveDeployments(deployments)) { if (existing.getDescription().getArchive().getName().equals(deployment.getArchive().getName())) { if (existing.getDescription().getTarget().equals(deployment.getTarget())) { throw new IllegalArgumentException("Can not add multiple " + Archive.class.getName() + " archive deployments with the same archive name " + deployment.getName() + " that target the same target " + deployment.getTarget()); } } } } }
/** * Validate that a deployment with a archive of the same name does not have the same taget */ private void validateNotSameArchiveAndSameTarget(DeploymentDescription deployment) { if (!deployment.isArchiveDeployment()) { return; } for (Deployment existing : archiveDeployments(deployments)) { if (existing.getDescription().getArchive().getName().equals(deployment.getArchive().getName())) { if (existing.getDescription().getTarget().equals(deployment.getTarget())) { throw new IllegalArgumentException("Can not add multiple " + Archive.class.getName() + " archive deployments with the same archive name " + deployment.getName() + " that target the same target " + deployment.getTarget()); } } } } }