Package org.jboss.arquillian.drone.spi.filter

Examples of org.jboss.arquillian.drone.spi.filter.DeploymentFilter


        }
    }

    public void beforeUndeploy(@Observes BeforeUnDeploy event) {
        DroneContext context = droneContext.get();
        DeploymentFilter deploymentFilter = new DeploymentFilter(Pattern.quote(event.getDeployment().getName()));
        LifecycleFilter lifecycleFilter = new LifecycleFilter(DronePoint.Lifecycle.DEPLOYMENT);
        FilterableResult<Object> dronePoints = context.find(Object.class)
                .filter(deploymentFilter)
                .filter(lifecycleFilter);
View Full Code Here


    @Test
    public void testDeploymentFiltering() {
        LifecycleFilter lifecycleFilter = new LifecycleFilter(DronePoint.Lifecycle.DEPLOYMENT);

        assertThat(context.find(MockDrone.class)
                .filter(new DeploymentFilter(".*"))
                .size(), is(3));
        assertThat(context.find(MockDrone.class)
                .filter(new DeploymentFilter(".*"))
                .filter(lifecycleFilter)
                .size(), is(2));

        assertThat(context.find(MockDrone.class)
                .filter(new DeploymentFilter())
                .size(), is(3));
        assertThat(context.find(MockDrone.class)
                .filter(new DeploymentFilter())
                .filter(lifecycleFilter)
                .size(), is(2));

        assertThat(context.find(MockDrone.class)
                .filter(new DeploymentFilter("deployment_.*"))
                .size(), is(3));
        assertThat(context.find(MockDrone.class)
                .filter(new DeploymentFilter("deployment_.*"))
                .filter(lifecycleFilter)
                .size(), is(2));

        assertThat(context.find(MockDrone.class)
                .filter(new DeploymentFilter("invalid_.*"))
                .size(), is(0));

        assertThat(context.find(MockDrone.class)
                .filter(new DeploymentFilter(AnnotationMocks.DEPLOYMENT_1))
                .single(), is(defaultDeploymentDronePoint));
        assertThat(context.find(MockDrone.class)
                .filter(new DeploymentFilter(AnnotationMocks.DEPLOYMENT_2))
                .filter(lifecycleFilter)
                .single(), is(differentDeploymentDronePoint));
    }
View Full Code Here

        }
    }

    public void beforeUndeploy(@Observes BeforeUnDeploy event) {
        DroneContext context = droneContext.get();
        DeploymentFilter deploymentFilter = new DeploymentFilter(Pattern.quote(event.getDeployment().getName()));
        List<InjectionPoint<?>> injectionPoints = context.find(Object.class, deploymentFilter);

        for (InjectionPoint<?> injectionPoint : injectionPoints) {
            destroyDroneCommand.fire(new DestroyDrone(injectionPoint));
        }
View Full Code Here

TOP

Related Classes of org.jboss.arquillian.drone.spi.filter.DeploymentFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.