Search in sources :

Example 1 with Issues

use of org.drools.verifier.api.reporting.Issues in project drools-wb by kiegroup.

the class Receiver method init.

private void init(final DrlInitialize initialize) {
    try {
        final AnalyzerBuilder analyzerBuilder = new AnalyzerBuilder().with(initialize).with(checkRunner).with(new Reporter() {

            @Override
            public void sendReport(final Set<Issue> issues) {
                latestReport = new Issues(initialize.getUuid(), issues);
                poster.post(latestReport);
            }

            @Override
            public void sendStatus(final Status status) {
                poster.post(status);
            }
        });
        analyzer = analyzerBuilder.buildAnalyzer();
        index = analyzerBuilder.getIndex();
        configuration = analyzerBuilder.getConfiguration();
        analyzer.resetChecks();
        analyzer.analyze();
    } catch (final Exception e) {
        poster.post(new WebWorkerException("Initialization failed: " + e.getMessage()));
    }
}
Also used : RequestStatus(org.kie.workbench.common.services.verifier.api.client.api.RequestStatus) Status(org.drools.verifier.api.Status) Issue(org.drools.verifier.api.reporting.Issue) Issues(org.drools.verifier.api.reporting.Issues) Reporter(org.drools.verifier.core.main.Reporter) WebWorkerException(org.kie.workbench.common.services.verifier.api.client.api.WebWorkerException) WebWorkerException(org.kie.workbench.common.services.verifier.api.client.api.WebWorkerException) BuildException(org.drools.workbench.services.verifier.plugin.client.builders.BuildException)

Example 2 with Issues

use of org.drools.verifier.api.reporting.Issues in project kie-wb-common by kiegroup.

the class ReceiverTest method issues.

@Test
public void issues() {
    returnObject = new Issues("id", new HashSet<>());
    messageHandlerArgumentCaptor.getValue().onMessage(mock(MessageEvent.class));
    verify(reporter).sendReport(anySet());
}
Also used : Issues(org.drools.verifier.api.reporting.Issues) MessageEvent(com.google.gwt.webworker.client.MessageEvent) HashSet(java.util.HashSet) Test(org.junit.Test)

Aggregations

Issues (org.drools.verifier.api.reporting.Issues)2 MessageEvent (com.google.gwt.webworker.client.MessageEvent)1 HashSet (java.util.HashSet)1 Status (org.drools.verifier.api.Status)1 Issue (org.drools.verifier.api.reporting.Issue)1 Reporter (org.drools.verifier.core.main.Reporter)1 BuildException (org.drools.workbench.services.verifier.plugin.client.builders.BuildException)1 Test (org.junit.Test)1 RequestStatus (org.kie.workbench.common.services.verifier.api.client.api.RequestStatus)1 WebWorkerException (org.kie.workbench.common.services.verifier.api.client.api.WebWorkerException)1