use of org.guvnor.common.services.shared.metadata.model.Overview in project drools-wb by kiegroup.
the class GuidedDecisionTableModellerPresenterTest method makeDecisionTableContent.
private GuidedDecisionTableEditorContent makeDecisionTableContent() {
final GuidedDecisionTable52 model = mock(GuidedDecisionTable52.class);
final PackageDataModelOracleBaselinePayload dmoBaseline = mock(PackageDataModelOracleBaselinePayload.class);
final Set<PortableWorkDefinition> workItemDefinitions = Collections.emptySet();
final Overview overview = mock(Overview.class);
final GuidedDecisionTableEditorContent dtContent = new GuidedDecisionTableEditorContent(model, workItemDefinitions, overview, dmoBaseline);
return dtContent;
}
use of org.guvnor.common.services.shared.metadata.model.Overview in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenter_AuditLogTest method setupPresenter.
private void setupPresenter() {
dtPresenter = new GuidedDecisionTablePresenter(identity, null, null, null, null, null, refreshAttributesPanelEvent, refreshMetaDataPanelEvent, refreshConditionsPanelEvent, refreshActionsPanelEvent, refreshMenusEvent, null, null, gridWidgetColumnFactory, oracleFactory, synchronizer, beanManager, lockManager, null, null, decisionTableAnalyzerProvider, enumLoaderUtilities, pluginHandler, authorizationManager, sessionInfo) {
@Override
void initialiseLockManager() {
// Do nothing for tests
}
@Override
GuidedDecisionTableView makeView(final Set<PortableWorkDefinition> workItemDefinitions) {
return view;
}
@Override
void initialiseModels() {
// Do nothing for tests
}
};
final AsyncPackageDataModelOracle dmo = mock(AsyncPackageDataModelOracle.class);
final PackageDataModelOracleBaselinePayload dmoBaseline = mock(PackageDataModelOracleBaselinePayload.class);
final Set<PortableWorkDefinition> workItemDefinitions = Collections.emptySet();
final Overview overview = mock(Overview.class);
dtContent = new GuidedDecisionTableEditorContent(model, workItemDefinitions, overview, dmoBaseline);
when(oracleFactory.makeAsyncPackageDataModelOracle(any(Path.class), any(GuidedDecisionTable52.class), eq(dmoBaseline))).thenReturn(dmo);
dtPresenter.setContent(null, mock(PlaceRequest.class), dtContent, modellerPresenter, false);
when(view.getLayer()).thenReturn(mock(Layer.class));
}
use of org.guvnor.common.services.shared.metadata.model.Overview in project drools-wb by kiegroup.
the class GuidedDecisionTableEditorPresenterTest method testGetMetadataSupplier.
@Test
public void testGetMetadataSupplier() {
final GuidedDecisionTableView.Presenter document = mock(GuidedDecisionTableView.Presenter.class);
final Overview overview = mock(Overview.class);
final Metadata expectedMetadata = mock(Metadata.class);
doReturn(document).when(presenter).getActiveDocument();
doReturn(overview).when(document).getOverview();
doReturn(expectedMetadata).when(overview).getMetadata();
final Metadata actualMetadata = presenter.getMetadataSupplier().get();
assertEquals(expectedMetadata, actualMetadata);
}
use of org.guvnor.common.services.shared.metadata.model.Overview in project drools-wb by kiegroup.
the class GuidedDecisionTableGraphEditorPresenterTest method testOnDecisionTableSelectedWhenPresenterIsNotNull.
@Test
public void testOnDecisionTableSelectedWhenPresenterIsNotNull() {
final GuidedDecisionTableView.Presenter dtPresenter = mock(GuidedDecisionTableView.Presenter.class);
final Overview overview = mock(Overview.class);
final AsyncPackageDataModelOracle oracle = mock(AsyncPackageDataModelOracle.class);
final GuidedDecisionTable52 model = new GuidedDecisionTable52();
final GuidedDecisionTablePresenter.Access access = new GuidedDecisionTablePresenter.Access();
final DecisionTableSelectedEvent event = new DecisionTableSelectedEvent(dtPresenter);
final ObservablePath path = mock(ObservablePath.class);
doNothing().when(presenter).initialiseKieEditorTabs(dtPresenter, overview, oracle, model.getImports(), false);
doNothing().when(presenter).initialiseEditorTabsWhenNoDocuments();
doReturn(true).when(modeller).isDecisionTableAvailable(dtPresenter);
doReturn(Optional.of(dtPresenter)).when(modeller).getActiveDecisionTable();
doReturn(overview).when(dtPresenter).getOverview();
doReturn(oracle).when(dtPresenter).getDataModelOracle();
doReturn(model).when(dtPresenter).getModel();
doReturn(access).when(dtPresenter).getAccess();
doReturn(path).when(dtPresenter).getLatestPath();
presenter.registerDocument(dtPresenter);
presenter.onDecisionTableSelected(event);
verify(presenter, never()).initialiseEditorTabsWhenNoDocuments();
verify(presenter).addColumnsTab();
verify(presenter).enableColumnsTab(dtPresenter);
}
use of org.guvnor.common.services.shared.metadata.model.Overview in project drools-wb by kiegroup.
the class GuidedDecisionTableGraphEditorPresenterTest method testLoadDocumentGraphEmptyModel.
@Test
public void testLoadDocumentGraphEmptyModel() throws Exception {
final ObservablePath documentPath = mock(ObservablePath.class);
final Overview overview = mock(Overview.class);
final GuidedDecisionTableEditorGraphModel graphModel = mock(GuidedDecisionTableEditorGraphModel.class);
final GuidedDecisionTableEditorGraphContent graphContent = mock(GuidedDecisionTableEditorGraphContent.class);
when(documentPath.getFileName()).thenReturn("GDT");
when(versionRecordManager.getCurrentPath()).thenReturn(documentPath);
when(dtGraphService.loadContent(documentPath)).thenReturn(graphContent);
when(versionRecordManager.getPathToLatest()).thenReturn(documentPath);
when(graphContent.getOverview()).thenReturn(overview);
when(graphContent.getModel()).thenReturn(graphModel);
presenter.loadDocumentGraph(documentPath);
verify(view).showLoading();
verify(view).hideBusyIndicator();
verify(view).refreshTitle(startsWith("GDT"));
// initialise when no documents
verify(editMenuItem).setEnabled(false);
verify(viewMenuItem).setEnabled(false);
verify(insertMenuItem).setEnabled(false);
verify(radarMenuItem).setEnabled(false);
verify(kieEditorWrapperView).clear();
verify(kieEditorWrapperView).addMainEditorPage(view);
verify(kieEditorWrapperView).addOverviewPage(eq(overviewWidget), any(com.google.gwt.user.client.Command.class));
verify(overviewWidget).setContent(overview, documentPath);
}
Aggregations