use of org.drools.workbench.screens.scenariosimulation.client.TestProperties.HEADER_ROWS_HEIGHT in project drools-wb by kiegroup.
the class ScenarioGridTest method setup.
@Before
public void setup() {
simulation = getSimulation();
when(scenarioGridColumnMock.getPropertyHeaderMetaData()).thenReturn(propertyHeaderMetadataMock);
when(scenarioGridModelMock.getAbstractScesimModel()).thenReturn(Optional.of(simulation));
when(scenarioGridModelMock.getGridWidget()).thenReturn(GridWidget.SIMULATION);
when(scenarioGridModelMock.getScenarioExpressionCellTextAreaSingletonDOMElementFactory()).thenReturn(expressionCellTextAreaSingletonDOMElementFactoryMock);
when(scenarioGridModelMock.getCollectionEditorSingletonDOMElementFactory()).thenReturn(collectionEditorSingletonDOMElementFactory);
factIdentifierGiven = FactIdentifier.create("GIVEN", "GIVEN");
factIdentifierInteger = FactIdentifier.create("Integer", "java.lang.Integer");
factMappingDescription = new FactMapping(EXPRESSION_ALIAS_DESCRIPTION, FactIdentifier.DESCRIPTION, ExpressionIdentifier.DESCRIPTION);
factMappingGiven = new FactMapping(EXPRESSION_ALIAS_GIVEN, factIdentifierGiven, new ExpressionIdentifier("GIVEN", FactMappingType.GIVEN));
factMappingInteger = new FactMapping(EXPRESSION_ALIAS_INTEGER, factIdentifierInteger, new ExpressionIdentifier("GIVEN", FactMappingType.GIVEN));
scenarioGridSpy = spy(new ScenarioGrid(scenarioGridModelMock, scenarioGridLayerMock, scenarioGridRendererMock, scenarioContextMenuRegistryMock) {
@Override
protected <T extends AbstractScesimData> void appendRow(int rowIndex, T scesimData) {
// do nothing
}
@Override
protected ScenarioSimulationBuilders.HeaderBuilder getHeaderBuilderLocal(String instanceTitle, String propertyTitle, String columnId, String columnGroup, FactMappingType factMappingType) {
return headerBuilderMock;
}
@Override
protected ScenarioGridColumn getScenarioGridColumnLocal(ScenarioSimulationBuilders.HeaderBuilder headerBuilder, String placeHolder) {
return scenarioGridColumnMock;
}
@Override
protected BaseGridRendererHelper getBaseGridRendererHelper() {
return rendererHelperMock;
}
@Override
public Viewport getViewport() {
return viewportMock;
}
@Override
protected ScenarioHeaderMetaData getColumnScenarioHeaderMetaData(final ScenarioGridColumn scenarioGridColumn, final int rowIndex) {
return propertyHeaderMetadataMock;
}
@Override
protected EnableTestToolsEvent getEnableTestToolsEvent(final ScenarioGrid scenarioGrid, final ScenarioGridColumn scenarioGridColumn, final ScenarioHeaderMetaData scenarioHeaderMetaData, int uiColumnIndex, String group) {
return new EnableTestToolsEvent();
}
@Override
public Layer getLayer() {
return scenarioGridLayerMock;
}
});
when(rendererHelperMock.getRenderingInformation()).thenReturn(renderingInformationMock);
when(renderingInformationMock.getHeaderRowsHeight()).thenReturn(HEADER_ROWS_HEIGHT);
when(renderingInformationMock.getFloatingBlockInformation()).thenReturn(floatingBlockInformationMock);
when(propertyHeaderMetadataMock.getColumnGroup()).thenReturn(GRID_COLUMN_GROUP);
scenarioGridSpy.setEventBus(eventBusMock);
}
Aggregations