@Override DTCellValue52 getCurrentValue() { //GUVNOR-1960: Always return a new instance return new DTCellValue52(); } }
@Override DTCellValue52 getCurrentValue() { //GUVNOR-1960: Always return a new instance return new DTCellValue52(); } }
protected List<DTCellValue52> makeRowData(final ColumnUtilities columnUtilities, final BaseColumn column) { final List<DTCellValue52> row = new ArrayList<>(); row.add(new DTCellValue52(1)); row.add(new DTCellValue52("desc")); final DataType.DataTypes dataType = columnUtilities.getDataType(column); row.add(makeCell(dataType)); return row; }
private void addRowNumberColumn() { ColumnValues cv = new RowNumberColumnValues(columns, EMPTY_VALUE, new DTCellValue52()); cv.setExpandColumn(false); this.expandedColumns.put(model.getRowNumberCol(), cv); this.columns.add(cv); }
private void addColumn(final ActionInsertFactCol52 a) { final ColumnValues cv = new ColumnValues(columns, EMPTY_VALUE, model.getTableFormat() == GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY ? a.getDefaultValue() : new DTCellValue52(Boolean.FALSE)); cv.setExpandColumn(false); this.expandedColumns.put(a, cv); this.columns.add(cv); }
private ArrayList<DTCellValue52> newRow(final DataType.DataTypes[] dataTypes) { final ArrayList<DTCellValue52> row = new ArrayList<>(); // Row number row.add(new DTCellValue52()); // Explanation row.add(new DTCellValue52()); for (final DataType.DataTypes dataType : dataTypes) { row.add(new DTCellValue52(dataType, true)); } return row; }
@Test public void testDiffDefaultValue() { column1.setDefaultValue(new DTCellValue52("default1")); column2.setDefaultValue(new DTCellValue52(7)); checkSingleDiff(FIELD_DEFAULT_VALUE, "default1", 7, column1, column2); }
private ActionRetractFactCol52 makeNewColumn(ActionRetractFactCol c) { ActionRetractFactCol52 nc = new ActionRetractFactCol52(); nc.setDefaultValue(new DTCellValue52(c.defaultValue)); nc.setHeader(c.header); nc.setHideColumn(c.hideColumn); nc.setWidth(c.width); return nc; }
private MetadataCol52 makeNewColumn(MetadataCol c) { MetadataCol52 nc = new MetadataCol52(); nc.setDefaultValue(new DTCellValue52(c.defaultValue)); nc.setHideColumn(c.hideColumn); nc.setMetadata(c.attr); nc.setWidth(c.width); return nc; }
@Test public void testDiffDefaultValueNewValueIsNull() { column1.setDefaultValue( new DTCellValue52( "default" ) ); column2.setDefaultValue( null ); checkSingleDiff( FIELD_DEFAULT_VALUE, "default", null, column1, column2 ); }
/** * Clones the configuration (width, header, hide, default value) of the argument into this instance. * @param model * column instance to be cloned */ public void cloneCommonColumnConfigFrom( DTColumnConfig52 model ) { setWidth( model.getWidth() ); setHideColumn( model.isHideColumn() ); setHeader( model.getHeader() ); setDefaultValue( model.getDefaultValue() != null ? new DTCellValue52( model.getDefaultValue() ) : null ); }
@Before public void setup() { column1 = new DTColumnConfig52(); column1.setHeader("header"); column1.setHideColumn(false); column1.setDefaultValue(new DTCellValue52("default")); column2 = new DTColumnConfig52(); column2.setHeader("header"); column2.setHideColumn(false); column2.setDefaultValue(new DTCellValue52("default")); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfSalience() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "salience" ); attributeCol52.setDefaultValue( new DTCellValue52( "123" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfActivationGroup() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "activation-group" ); attributeCol52.setDefaultValue( new DTCellValue52( "test" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfActivationGroup() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "activation-group" ); attributeCol52.setDefaultValue( new DTCellValue52( "test" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfSalience() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "salience" ); attributeCol52.setDefaultValue( new DTCellValue52( "123" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfActivationGroup() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "activation-group" ); attributeCol52.setDefaultValue( new DTCellValue52( "test" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }
@Test(expected = IllegalArgumentException.class) public void blockUseOfSalience() { final AttributeCol52 attributeCol52 = new AttributeCol52(); attributeCol52.setAttribute( "salience" ); attributeCol52.setDefaultValue( new DTCellValue52( "123" ) ); dtable.getAttributeCols() .add( attributeCol52 ); GuidedDTDRLPersistence.getInstance() .marshal( dtable ); }
@Test public void testDefaultValue() throws Exception { final DTCellValue52 defaultValue = new DTCellValue52(1); final DTCellValue52 clone = new DTCellValue52(defaultValue); assertEquals(DataType.DataTypes.NUMERIC_INTEGER, clone.getDataType()); assertNull(clone.getBooleanValue()); assertNull(clone.getDateValue()); assertEquals(1, clone.getNumericValue()); assertNull(clone.getStringValue()); }
@Test public void testDefaultValueNull() throws Exception { final DTCellValue52 defaultValue = null; final DTCellValue52 clone = new DTCellValue52(defaultValue); assertEquals(DataType.DataTypes.STRING, clone.getDataType()); assertNull(clone.getBooleanValue()); assertNull(clone.getDateValue()); assertNull(clone.getNumericValue()); assertNull(clone.getStringValue()); } }