Search in sources :

Example 1 with IllegalVerifierStateIssue

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

the class Receiver method shutdown.

public void shutdown() {
    if (worker != null) {
        worker.terminate();
    }
    final HashSet<Issue> issues = new HashSet<>();
    issues.add(new IllegalVerifierStateIssue());
    reporter.sendReport(issues);
}
Also used : Issue(org.drools.verifier.api.reporting.Issue) IllegalVerifierStateIssue(org.drools.verifier.api.reporting.IllegalVerifierStateIssue) IllegalVerifierStateIssue(org.drools.verifier.api.reporting.IllegalVerifierStateIssue) HashSet(java.util.HashSet)

Example 2 with IllegalVerifierStateIssue

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

the class IssuePresenterTest method testIllegalVerifierState.

@Test
public void testIllegalVerifierState() {
    final Issue issue = new IllegalVerifierStateIssue();
    screen.show(issue);
    verify(view).setIssueTitle("VerifierFailedTitle");
    ArgumentCaptor<SafeHtml> safeHtmlArgumentCaptor = ArgumentCaptor.forClass(SafeHtml.class);
    verify(view).setExplanation(safeHtmlArgumentCaptor.capture());
    assertEquals("<p>VerifierFailed</p>", safeHtmlArgumentCaptor.getValue().asString());
    verify(view).setLines("");
}
Also used : Issue(org.drools.verifier.api.reporting.Issue) IllegalVerifierStateIssue(org.drools.verifier.api.reporting.IllegalVerifierStateIssue) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) IllegalVerifierStateIssue(org.drools.verifier.api.reporting.IllegalVerifierStateIssue) Test(org.junit.Test)

Example 3 with IllegalVerifierStateIssue

use of org.drools.verifier.api.reporting.IllegalVerifierStateIssue 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);
}
Also used : Issue(org.drools.verifier.api.reporting.Issue) IllegalVerifierStateIssue(org.drools.verifier.api.reporting.IllegalVerifierStateIssue) MessageEvent(com.google.gwt.webworker.client.MessageEvent) WebWorkerException(org.kie.workbench.common.services.verifier.api.client.api.WebWorkerException) IllegalVerifierStateIssue(org.drools.verifier.api.reporting.IllegalVerifierStateIssue) Test(org.junit.Test)

Aggregations

IllegalVerifierStateIssue (org.drools.verifier.api.reporting.IllegalVerifierStateIssue)3 Issue (org.drools.verifier.api.reporting.Issue)3 Test (org.junit.Test)2 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1 MessageEvent (com.google.gwt.webworker.client.MessageEvent)1 HashSet (java.util.HashSet)1 WebWorkerException (org.kie.workbench.common.services.verifier.api.client.api.WebWorkerException)1