/** * @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(); }
/** * @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(); }
public static DeploymentConfiguration.DeploymentContentBuilder populate(TestClass testClass, Archive<?> archive) { DeploymentParameters deploymentParameters = resolveDeployment(testClass); DeploymentConfiguration.DeploymentContentBuilder deploymentContentBuilder = new DeploymentConfiguration.DeploymentContentBuilder(archive); final DeploymentConfiguration.DeploymentBuilder deploymentBuilder = deploymentContentBuilder.withDeployment() .withManaged(deploymentParameters.managed()) .withOrder(deploymentParameters.order()) .withTestable(deploymentParameters.testable()); if (isNotEmptyOrNull(deploymentParameters.deploymentName())) { deploymentBuilder.withName(deploymentParameters.deploymentName()); } deploymentContentBuilder = deploymentBuilder.build(); if (isNotEmptyOrNull(deploymentParameters.overProtocol())) { deploymentContentBuilder.withOverProtocol(deploymentParameters.overProtocol()); } if (isNotEmptyOrNull(deploymentParameters.targetsContainer())) { deploymentContentBuilder.withTargetsContainer(deploymentParameters.targetsContainer()); } if (deploymentParameters.shouldThrowExcetionClass() != IgnorePlaceholderException.class) { deploymentContentBuilder.withShouldThrowException(deploymentParameters.shouldThrowExcetionClass(), deploymentParameters.testable()); } return deploymentContentBuilder; }
public static DeploymentConfiguration.DeploymentContentBuilder populate(TestClass testClass, Archive<?> archive) { DeploymentParameters deploymentParameters = resolveDeployment(testClass); DeploymentConfiguration.DeploymentContentBuilder deploymentContentBuilder = new DeploymentConfiguration.DeploymentContentBuilder(archive); final DeploymentConfiguration.DeploymentBuilder deploymentBuilder = deploymentContentBuilder.withDeployment() .withManaged(deploymentParameters.managed()) .withOrder(deploymentParameters.order()) .withTestable(deploymentParameters.testable()); if (isNotEmptyOrNull(deploymentParameters.deploymentName())) { deploymentBuilder.withName(deploymentParameters.deploymentName()); } deploymentContentBuilder = deploymentBuilder.build(); if (isNotEmptyOrNull(deploymentParameters.overProtocol())) { deploymentContentBuilder.withOverProtocol(deploymentParameters.overProtocol()); } if (isNotEmptyOrNull(deploymentParameters.targetsContainer())) { deploymentContentBuilder.withTargetsContainer(deploymentParameters.targetsContainer()); } if (deploymentParameters.shouldThrowExcetionClass() != IgnorePlaceholderException.class) { deploymentContentBuilder.withShouldThrowException(deploymentParameters.shouldThrowExcetionClass(), deploymentParameters.testable()); } return deploymentContentBuilder; }
public DeploymentBuilder withDeployment() { return new DeploymentBuilder(this); }