org.jboss.arquillian.container.spi.event.UnDeployManagedDeployments Java Examples

The following examples show how to use org.jboss.arquillian.container.spi.event.UnDeployManagedDeployments. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SuiteDeployer.java    From arquillian-suite-extension with Apache License 2.0 5 votes vote down vote up
/**
 * Method ignoring UnDeployManagedDeployments events at runtime.
 *
 * Only at undeploy container we will undeploy all.
 *
 * @param eventContext Event to check
 */
public void blockUnDeployManagedDeploymentsWhenNeeded(@Observes EventContext<UnDeployManagedDeployments> eventContext) {
    if (!extensionEnabled()) {
        eventContext.proceed();
    }
    else if (undeployDeployments) {
        undeployDeployments = false;
        debug("NOT Blocking UnDeployManagedDeployments event {0}", eventContext.getEvent().toString());
        eventContext.proceed();
    } else {
        // Do nothing with event.
        debug("Blocking UnDeployManagedDeployments event {0}", eventContext.getEvent().toString());
    }
}
 
Example #2
Source File: SuiteDeployer.java    From arquillian-suite-extension with Apache License 2.0 5 votes vote down vote up
/**
 * Undeploy event.
 *
 * @param event event to observe
 */
public void undeploy(@Observes final BeforeStop event) {
    if (extensionEnabled()) {
        debug("Catching BeforeStop event {0}", event.toString());
        undeployDeployments = true;
        undeployEvent.fire(new UnDeployManagedDeployments());
    }
}
 
Example #3
Source File: KeycloakContainerEventsController.java    From keycloak with Apache License 2.0 5 votes vote down vote up
@Override
public void execute(@Observes(precedence = 0) AfterClass event) {
    try {
        container.fire(new UnDeployManagedDeployments());
    } finally {
        container.fire(new StopClassContainers());
    }
    if (event.getTestClass().isAnnotationPresent(RestartContainer.class)) {
        afterOriginalContainerStop(event.getTestClass().getAnnotation(RestartContainer.class));
    }
}
 
Example #4
Source File: ArquillianSuiteExtension.java    From appengine-tck with Apache License 2.0 4 votes vote down vote up
public void blockUnDeployManagedDeployments(@Observes EventContext<UnDeployManagedDeployments> ignored) {
    // We need to block UnDeployManagedDeployments event
}