Refine search
private void registerDeploymentDronePoint(DronePoint dronePoint, Object testCase) { if (deploymentDronePointsRegistry.get() == null) { deploymentDronePointsRegistry.set(injector.get().inject(new DeploymentDronePointsRegistry())); } deploymentDronePointsRegistry.get().addDronePoint(dronePoint, testCase); }
public void afterDeploy(@Observes AfterDeploy afterDeploy) { DeploymentDronePointsRegistry deplDronePoints = this.deploymentDronePointsRegistry.get(); if (deplDronePoints != null) { String deplName = afterDeploy.getDeployment().getName(); Map<DronePoint<?>, Object> filteredDronePoints = deplDronePoints.filterDeploymentDronePoints(deplName); for (DronePoint dronePoint : filteredDronePoints.keySet()) { if (!droneContext.get().get(dronePoint).hasFutureInstance()) { createDroneConfigurationCommand.fire(new PrepareDrone(dronePoint)); } // in case that deployment is done before the enrichment, then only prepare the DronePoint - Enrichment will be done later as a part of the standard process Object testClass = filteredDronePoints.get(dronePoint); if (testClass != null) { // in case that deployment is done after the standard enrichment, we have to enrich the class manually DroneTestEnricher droneTestEnricher = injector.get().inject(new DroneTestEnricher()); droneTestEnricher.enrichTestClass(testClassInstance.get().getJavaClass(), testClass, false); } } } }
public void register(@Observes DockerClientExecutor executor, CubeDockerConfiguration configuration, Injector injector, CubeRegistry registry) { //TODO, add key here generation here DockerCompositions containerConfigurations = configuration.getDockerContainersContent(); for (Map.Entry<String, CubeContainer> containerConfiguration : containerConfigurations.getContainers() .entrySet()) { registry.addCube( injector.inject( new DockerCube( containerConfiguration.getKey(), containerConfiguration.getValue(), executor))); } } }
private <T> T createServiceInstance(Class<T> service) { T serviceInst = SecurityActions.newInstance( service, new Class<?>[] {}, new Object[] {}); injector.inject(serviceInst); return serviceInst; }
public void afterDeploy(@Observes AfterDeploy afterDeploy) { DeploymentDronePointsRegistry deplDronePoints = this.deploymentDronePointsRegistry.get(); if (deplDronePoints != null) { String deplName = afterDeploy.getDeployment().getName(); Map<DronePoint<?>, Object> filteredDronePoints = deplDronePoints.filterDeploymentDronePoints(deplName); for (DronePoint dronePoint : filteredDronePoints.keySet()) { if (!droneContext.get().get(dronePoint).hasFutureInstance()) { createDroneConfigurationCommand.fire(new PrepareDrone(dronePoint)); } // in case that deployment is done before the enrichment, then only prepare the DronePoint - Enrichment will be done later as a part of the standard process Object testClass = filteredDronePoints.get(dronePoint); if (testClass != null) { // in case that deployment is done after the standard enrichment, we have to enrich the class manually DroneTestEnricher droneTestEnricher = injector.get().inject(new DroneTestEnricher()); droneTestEnricher.enrichTestClass(testClassInstance.get().getJavaClass(), testClass, false); } } } }
public void register(@Observes DockerClientExecutor executor, CubeDockerConfiguration configuration, Injector injector, CubeRegistry registry) { //TODO, add key here generation here DockerCompositions containerConfigurations = configuration.getDockerContainersContent(); for (Map.Entry<String, CubeContainer> containerConfiguration : containerConfigurations.getContainers() .entrySet()) { registry.addCube( injector.inject( new DockerCube( containerConfiguration.getKey(), containerConfiguration.getValue(), executor))); } } }
private <T> T createServiceInstance(Class<T> service) { T serviceInst = SecurityActions.newInstance( service, new Class<?>[] {}, new Object[] {}); injector.inject(serviceInst); return serviceInst; }
public void managerStarted(@Observes ManagerStarted event) { try { DroneContext context = injector.get().inject(new DroneContextImpl()); droneContext.set(context); } catch (TypeNotPresentException e) { log.log(Level.SEVERE, "Unable to create Drone Context due to missing services on classpath. Please make sure to use Arquillian Core 1.1.4.Final or later."); throw new IllegalStateException( "Unable to create Drone Context due to missing services on classpath. Please make sure to use Arquillian Core 1.1.4.Final or later.", e); } }
private void registerDeploymentDronePoint(DronePoint dronePoint, Object testCase) { if (deploymentDronePointsRegistry.get() == null) { deploymentDronePointsRegistry.set(injector.get().inject(new DeploymentDronePointsRegistry())); } deploymentDronePointsRegistry.get().addDronePoint(dronePoint, testCase); }
public void register(@Observes final OpenShiftClient client, final CubeRegistry registry, final Configuration conf, final Injector injector) { if (!(conf instanceof CubeOpenShiftConfiguration)) { return; } CubeOpenShiftConfiguration configuration = (CubeOpenShiftConfiguration) conf; if (!hasDefinitionStream(configuration)) { return; } for (HasMetadata item : client.getClientExt().load(getDefinitionStream(configuration)).get()) { if (item instanceof Pod) { registry.addCube(injector.inject(new BuildablePodCube((Pod) item, client, configuration))); } else if (item instanceof Service) { registry.addCube(injector.inject(new ServiceCube((Service) item, client, configuration))); } } }
public Scenario given(String name) { if(!proxies.containsKey(name)) { throw new IllegalArgumentException("No known proxy with name " + name); } ToxicScenario toxicScenario = new ToxicScenario(proxies.get(name)); return injector.inject(toxicScenario); }