use of org.kie.workbench.common.services.verifier.api.client.api.WebWorkerException 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()));
}
}
use of org.kie.workbench.common.services.verifier.api.client.api.WebWorkerException in project kie-wb-common by kiegroup.
the class ReceiverTest method webWorkerException.
@Test
public void webWorkerException() {
returnObject = new WebWorkerException("error");
messageHandlerArgumentCaptor.getValue().onMessage(mock(MessageEvent.class));
verify(reporter, never()).sendStatus(any());
verify(reporter).sendReport(setArgumentCaptor.capture());
verify(worker).terminate();
final Set<Issue> issues = setArgumentCaptor.getValue();
assertEquals(1, issues.size());
assertTrue(issues.iterator().next() instanceof IllegalVerifierStateIssue);
}
Aggregations