Search in sources :

Example 1 with DMNMetadata

use of org.drools.workbench.screens.scenariosimulation.model.DMNMetadata in project drools-wb by kiegroup.

the class DMNTypeServiceImplTest method getDMNMetadata.

@Test
public void getDMNMetadata() {
    DMNMetadata dmnMetadata = dmnTypeServiceImpl.getDMNMetadata(mock(Path.class), "");
    assertEquals(NAMESPACE, dmnMetadata.getDmnNamespace());
    assertEquals(MODEL_NAME, dmnMetadata.getDmnName());
}
Also used : Path(org.uberfire.backend.vfs.Path) DMNMetadata(org.drools.workbench.screens.scenariosimulation.model.DMNMetadata) Test(org.junit.Test)

Example 2 with DMNMetadata

use of org.drools.workbench.screens.scenariosimulation.model.DMNMetadata in project drools-wb by kiegroup.

the class ScenarioSimulationEditorBusinessCentralWrapperTest method getDMNMetadata.

@Test
public void getDMNMetadata() {
    ArgumentCaptor<ErrorCallback> errorCallbackArgumentCaptor = ArgumentCaptor.forClass(ErrorCallback.class);
    String dmnPath = "src/test.dmn";
    String dmnName = "DMN-NAME";
    String dmnNameSpace = "DMN-namespace";
    modelLocal.getSettings().setDmnFilePath(dmnPath);
    when(dmnTypeServiceMock.getDMNMetadata(eq(pathMock), eq(dmnPath))).thenReturn(new DMNMetadata(dmnName, dmnNameSpace));
    scenarioSimulationEditorBusinessClientWrapper.getDMNMetadata();
    verify(dmnTypeServiceCaller, times(1)).call(isA(RemoteCallback.class), errorCallbackArgumentCaptor.capture());
    verify(dmnTypeServiceMock, times(1)).getDMNMetadata(eq(pathMock), eq(dmnPath));
    verify(scenarioSimulationEditorPresenterMock, times(1)).reloadSettingsDock();
    assertEquals(dmnName, modelLocal.getSettings().getDmnName());
    assertEquals(dmnNameSpace, modelLocal.getSettings().getDmnNamespace());
    errorCallbackArgumentCaptor.getValue().error("ERROR", new Throwable());
    verify(scenarioSimulationEditorPresenterMock, times(1)).sendNotification(eq("ERROR"), eq(NotificationEvent.NotificationType.ERROR));
}
Also used : ErrorCallback(org.jboss.errai.common.client.api.ErrorCallback) HasBusyIndicatorDefaultErrorCallback(org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback) ScenarioSimulationHasBusyIndicatorDefaultErrorCallback(org.drools.workbench.screens.scenariosimulation.client.handlers.ScenarioSimulationHasBusyIndicatorDefaultErrorCallback) DMNMetadata(org.drools.workbench.screens.scenariosimulation.model.DMNMetadata) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback) Test(org.junit.Test) AbstractScenarioSimulationEditorTest(org.drools.workbench.screens.scenariosimulation.client.editor.AbstractScenarioSimulationEditorTest)

Aggregations

DMNMetadata (org.drools.workbench.screens.scenariosimulation.model.DMNMetadata)2 Test (org.junit.Test)2 AbstractScenarioSimulationEditorTest (org.drools.workbench.screens.scenariosimulation.client.editor.AbstractScenarioSimulationEditorTest)1 ScenarioSimulationHasBusyIndicatorDefaultErrorCallback (org.drools.workbench.screens.scenariosimulation.client.handlers.ScenarioSimulationHasBusyIndicatorDefaultErrorCallback)1 ErrorCallback (org.jboss.errai.common.client.api.ErrorCallback)1 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)1 Path (org.uberfire.backend.vfs.Path)1 HasBusyIndicatorDefaultErrorCallback (org.uberfire.ext.widgets.common.client.callbacks.HasBusyIndicatorDefaultErrorCallback)1