org.jboss.arquillian.core.api.Event Java Examples

The following examples show how to use org.jboss.arquillian.core.api.Event. 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: ScreenshooterLifecycleObserver.java    From arquillian-recorder with Apache License 2.0 6 votes vote down vote up
public boolean decide(org.jboss.arquillian.core.spi.event.Event event, TestResult testResult) {

            boolean taking = false;

            for (final RecorderStrategy<?> recorderStrategy : recorderStrategyRegister.getAll()) {
                if (recorderStrategy instanceof AnnotationScreenshootingStrategy && !hasScreenshotAnnotation(event)) {
                    continue;
                }
                if (testResult == null) {
                    taking = recorderStrategy.isTakingAction(event);
                } else {
                    taking = recorderStrategy.isTakingAction(event, testResult);
                }
            }

            return taking;
        }
 
Example #2
Source File: ScreenshooterLifecycleObserver.java    From arquillian-recorder with Apache License 2.0 5 votes vote down vote up
private boolean hasScreenshotAnnotation(org.jboss.arquillian.core.spi.event.Event event) {
    if (event instanceof Before) {
        return ScreenshotAnnotationScanner.getScreenshotAnnotation(((Before) event).getTestMethod()) != null;
    } else if (event instanceof AfterTestLifecycleEvent) {
        return ScreenshotAnnotationScanner
            .getScreenshotAnnotation(((AfterTestLifecycleEvent) event).getTestMethod()) != null;
    }
    return false;
}
 
Example #3
Source File: ReporterLifecycleObserver.java    From arquillian-recorder with Apache License 2.0 5 votes vote down vote up
private void report(org.jboss.arquillian.core.spi.event.Event event, ArquillianDescriptor descriptor) {
    if (shouldReport(event, configuration.get().getReportAfterEvery())) {
        List<ExtensionReport> extensionReports = reporter.get().getReport().getExtensionReports();
        if (extensionReports.isEmpty()) {
            extensionReports.addAll(getExtensionReports(descriptor));
        }

        reporter.get().getLastTestClassReport().setStop(new Date(System.currentTimeMillis()));
        reporter.get().getLastTestSuiteReport().setStop(new Date(System.currentTimeMillis()));

        exportReportEvent.fire(new ExportReport(reporter.get().getReport()));
    }
}
 
Example #4
Source File: ReporterLifecycleObserver.java    From arquillian-recorder with Apache License 2.0 5 votes vote down vote up
private boolean shouldReport(org.jboss.arquillian.core.spi.event.Event event, String frequency) {
    if (event instanceof AfterClass && ReportFrequency.CLASS.toString().equals(frequency)
            || (event instanceof After && ReportFrequency.METHOD.toString().equals(frequency)) ) {
        return true;
    }
    return false;
}
 
Example #5
Source File: KeycloakContainerDeployController.java    From keycloak with Apache License 2.0 5 votes vote down vote up
@Override
public void deployManaged(DeployManagedDeployments event) throws Exception {
    forEachManagedDeployment(new ContainerDeployController.Operation<Container, Deployment>() {
        @Inject
        private Event<DeploymentEvent> event;

        @Override
        public void perform(Container container, Deployment deployment) throws Exception {
            if (runOnServerDeploymentOnRemote(deployment)) return;
            if (container.getState().equals(Container.State.STARTED)) {
                event.fire(new DeployDeployment(container, deployment));
            }
        }
    });
}
 
Example #6
Source File: RedmineGovernorRecorder.java    From arquillian-governor with Apache License 2.0 4 votes vote down vote up
public void setPropertyReportEvent(Event<PropertyReportEvent> propertyReportEvent) {
    this.propertyReportEvent = propertyReportEvent;
}
 
Example #7
Source File: JiraGovernorRecorder.java    From arquillian-governor with Apache License 2.0 4 votes vote down vote up
public void setPropertyReportEvent(Event<PropertyReportEvent> propertyReportEvent) {
    this.propertyReportEvent = propertyReportEvent;
}
 
Example #8
Source File: GitHubGovernorRecorder.java    From arquillian-governor with Apache License 2.0 4 votes vote down vote up
public void setPropertyReportEvent(Event<PropertyReportEvent> propertyReportEvent) {
    this.propertyReportEvent = propertyReportEvent;
}