/** * Gets the name of deployment from the deployment method. * * @param method a method to get the deployment name from * @return name of the deployment from the {@code method} as a string * @throws IllegalArgumentException if {@code method} is null or if it is not annotated by {@code @Deployment} or if */ public static String getDeploymentName(Method method) { Validate.notNull(method, "Method to get the deployment name from can not be a null object!"); Deployment deploymentAnnotation = null; deploymentAnnotation = method.getAnnotation(Deployment.class); if (deploymentAnnotation == null) { throw new IllegalArgumentException("You want to know the name of a deployment from a deployment method without " + "@Deployment annotation."); } return deploymentAnnotation.name(); }
public synchronized void removeTargertServerGroups(@Observes AfterClass event) { final TestClass testClass = event.getTestClass(); final Method[] methods = testClass.getMethods(Deployment.class); for (Method method : methods) { final Deployment deployment = method.getAnnotation(Deployment.class); serverGroupTargets.remove(deployment.name()); } }
public synchronized void findTargetServerGroups(@Observes(precedence = 100) BeforeClass event) { final TestClass testClass = event.getTestClass(); final Method[] methods = testClass.getMethods(Deployment.class); for (Method method : methods) { if (method.isAnnotationPresent(TargetsServerGroups.class)) { final Deployment deployment = method.getAnnotation(Deployment.class); for (TargetsServerGroup target : method.getAnnotation(TargetsServerGroups.class).value()) { add(deployment.name(), target.value()); } } else if (method.isAnnotationPresent(TargetsServerGroup.class)) { final Deployment deployment = method.getAnnotation(Deployment.class); final TargetsServerGroup target = method.getAnnotation(TargetsServerGroup.class); add(deployment.name(), target.value()); } } }
m.getAnnotation(org.jboss.arquillian.container.test.api.Deployment.class); if (deploymentAnnotation.name().equals(deploymentName) && deploymentAnnotation.testable()) { log.warning( "The test method "
m.getAnnotation(org.jboss.arquillian.container.test.api.Deployment.class); if (deploymentAnnotation.name().equals(deploymentName) && deploymentAnnotation.testable()) { log.warning( "The test method "
if (Archive.class.isAssignableFrom(deploymentMethod.getReturnType())) deployment = new DeploymentDescription(deploymentAnnotation.name(), invoke(Archive.class, deploymentMethod)); deployment.shouldBeTestable(deploymentAnnotation.testable()); deployment = new DeploymentDescription(deploymentAnnotation.name(), invoke(Descriptor.class, deploymentMethod));
/** * @param deploymentMethod * @return */ private DeploymentConfiguration generateDeploymentContent(Method deploymentMethod) { Deployment deploymentAnnotation = deploymentMethod.getAnnotation(Deployment.class); DeploymentConfiguration.DeploymentContentBuilder deploymentContentBuilder = null; if (Archive.class.isAssignableFrom(deploymentMethod.getReturnType())) { deploymentContentBuilder = new DeploymentConfiguration.DeploymentContentBuilder(invoke(Archive.class, deploymentMethod)); } else if (Descriptor.class.isAssignableFrom(deploymentMethod.getReturnType())) { deploymentContentBuilder = new DeploymentConfiguration.DeploymentContentBuilder(invoke(Descriptor.class, deploymentMethod)); } if (deploymentMethod.isAnnotationPresent(OverProtocol.class)) { deploymentContentBuilder.withOverProtocol(deploymentMethod.getAnnotation(OverProtocol.class).value()); } if (deploymentMethod.isAnnotationPresent(TargetsContainer.class)) { deploymentContentBuilder.withTargetsContainer(deploymentMethod.getAnnotation(TargetsContainer.class).value()); } if (deploymentMethod.isAnnotationPresent(ShouldThrowException.class)) { final ShouldThrowException shouldThrowException = deploymentMethod.getAnnotation(ShouldThrowException.class); deploymentContentBuilder.withShouldThrowException(shouldThrowException.value(), shouldThrowException.testable()); } deploymentContentBuilder = deploymentContentBuilder.withDeployment() .withManaged(deploymentAnnotation.managed()) .withName(deploymentAnnotation.name()) .withOrder(deploymentAnnotation.order()) .withTestable(deploymentAnnotation.testable()) .build(); return deploymentContentBuilder.get(); }
if (Archive.class.isAssignableFrom(deploymentMethod.getReturnType())) deployment = new DeploymentDescription(deploymentAnnotation.name(), invoke(Archive.class, deploymentMethod)); deployment.shouldBeTestable(deploymentAnnotation.testable()); deployment = new DeploymentDescription(deploymentAnnotation.name(), invoke(Descriptor.class, deploymentMethod));
/** * @param deploymentMethod * @return */ private DeploymentConfiguration generateDeploymentContent(Method deploymentMethod) { Deployment deploymentAnnotation = deploymentMethod.getAnnotation(Deployment.class); DeploymentConfiguration.DeploymentContentBuilder deploymentContentBuilder = null; if (Archive.class.isAssignableFrom(deploymentMethod.getReturnType())) { deploymentContentBuilder = new DeploymentConfiguration.DeploymentContentBuilder(invoke(Archive.class, deploymentMethod)); } else if (Descriptor.class.isAssignableFrom(deploymentMethod.getReturnType())) { deploymentContentBuilder = new DeploymentConfiguration.DeploymentContentBuilder(invoke(Descriptor.class, deploymentMethod)); } if (deploymentMethod.isAnnotationPresent(OverProtocol.class)) { deploymentContentBuilder.withOverProtocol(deploymentMethod.getAnnotation(OverProtocol.class).value()); } if (deploymentMethod.isAnnotationPresent(TargetsContainer.class)) { deploymentContentBuilder.withTargetsContainer(deploymentMethod.getAnnotation(TargetsContainer.class).value()); } if (deploymentMethod.isAnnotationPresent(ShouldThrowException.class)) { final ShouldThrowException shouldThrowException = deploymentMethod.getAnnotation(ShouldThrowException.class); deploymentContentBuilder.withShouldThrowException(shouldThrowException.value(), shouldThrowException.testable()); } deploymentContentBuilder = deploymentContentBuilder.withDeployment() .withManaged(deploymentAnnotation.managed()) .withName(deploymentAnnotation.name()) .withOrder(deploymentAnnotation.order()) .withTestable(deploymentAnnotation.testable()) .build(); return deploymentContentBuilder.get(); }
final Deployment deployment = deploymentConfiguration.getDeployment(); if (deploymentConfiguration.getArchive() != null) { deploymentDescription = new DeploymentDescription(deployment.name(), manipulateArchive(testClass, deployment.name(), deploymentConfiguration.getArchive())); deploymentDescription.shouldBeTestable(deployment.testable()); } else if (deploymentConfiguration.getDescriptor() != null) { deploymentDescription = new DeploymentDescription(deployment.name(), deploymentConfiguration.getDescriptor());
final Deployment deployment = deploymentConfiguration.getDeployment(); if (deploymentConfiguration.getArchive() != null) { deploymentDescription = new DeploymentDescription(deployment.name(), manipulateArchive(testClass, deployment.name(), deploymentConfiguration.getArchive())); deploymentDescription.shouldBeTestable(deployment.testable()); } else if (deploymentConfiguration.getDescriptor() != null) { deploymentDescription = new DeploymentDescription(deployment.name(), deploymentConfiguration.getDescriptor());