private AttributeCol52 getAttributeCol52() { final AttributeCol52 column = new AttributeCol52(); column.setAttribute(attribute); return column; }
private AttributeCol52 getAttributeCol52() { final AttributeCol52 column = new AttributeCol52(); column.setAttribute(attribute); return column; }
@Test public void testDiffAttribute() { column1.setAttribute("attr1"); column2.setAttribute("attr2"); checkSingleDiff(FIELD_ATTRIBUTE, "attr1", "attr2", column1, column2); }
@Test public void appendAttributeColumn() throws VetoException { reset(modellerPresenter); final AttributeCol52 column = new AttributeCol52(); column.setAttribute(RuleAttributeWidget.AUTO_FOCUS_ATTR); dtPresenter.appendColumn(column); verify(synchronizer, times(1)).appendColumn(eq(column)); verify(refreshAttributesPanelEvent, times(1)).fire(any(RefreshAttributesPanelEvent.class)); verify(modellerPresenter, times(1)).updateLinks(); }
/** * Clones this attribute column instance. * @return The cloned instance. */ public AttributeCol52 cloneColumn() { AttributeCol52 cloned = new AttributeCol52(); cloned.setAttribute( getAttribute() ); cloned.setReverseOrder( isReverseOrder() ); cloned.setUseRowNumber( isUseRowNumber() ); cloned.cloneCommonColumnConfigFrom( this ); return cloned; }
private AttributeCol52 makeNewColumn(AttributeCol c) { AttributeCol52 nc = new AttributeCol52(); nc.setAttribute(c.attr); nc.setDefaultValue(new DTCellValue52(c.defaultValue)); nc.setHideColumn(c.hideColumn); nc.setReverseOrder(c.reverseOrder); nc.setUseRowNumber(c.useRowNumber); nc.setWidth(c.width); return nc; }
private void setupBooleanColumn(final ParameterizedCommand<AttributeCol52> cmdInit) throws VetoException { final AttributeCol52 booleanColumn = new AttributeCol52(); booleanColumn.setAttribute(GuidedDecisionTable52.ENABLED_ATTR); cmdInit.execute(booleanColumn); modelSynchronizer.appendColumn(booleanColumn); } }
@Test public void getValueListLookups() { final AttributeCol52 attribute = new AttributeCol52(); attribute.setAttribute(RuleAttributeWidget.ENABLED_ATTR); final Map<String, String> valueList = dtPresenter.getValueListLookups(attribute); assertNotNull(valueList); assertEquals(2, valueList.size()); assertTrue(valueList.containsKey("true")); assertTrue(valueList.containsKey("false")); }
@Test public void hasColumnDefinitionsWithAttributeColumn() { final AttributeCol52 attribute = new AttributeCol52(); attribute.setAttribute("attribute"); dtPresenter.getModel().getAttributeCols().add(attribute); assertTrue(dtPresenter.hasColumnDefinitions()); }
private void update(final AttributeCol52 originalColumn, final AttributeCol52 editedColumn) { originalColumn.setAttribute(editedColumn.getAttribute()); originalColumn.setReverseOrder(editedColumn.isReverseOrder()); originalColumn.setUseRowNumber(editedColumn.isUseRowNumber()); originalColumn.setHideColumn(editedColumn.isHideColumn()); originalColumn.setHeader(editedColumn.getHeader()); originalColumn.setDefaultValue(editedColumn.getDefaultValue()); }
@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 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 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 ); }
private void update(final AttributeCol52 originalColumn, final AttributeCol52 editedColumn) { originalColumn.setAttribute(editedColumn.getAttribute()); originalColumn.setReverseOrder(editedColumn.isReverseOrder()); originalColumn.setUseRowNumber(editedColumn.isUseRowNumber()); originalColumn.setHideColumn(editedColumn.isHideColumn()); originalColumn.setHeader(editedColumn.getHeader()); originalColumn.setDefaultValue(editedColumn.getDefaultValue()); }
@Test public void checkBooleanDefaultValueNotSet() throws VetoException { final AttributeCol52 column = new AttributeCol52(); column.setAttribute(RuleAttributeWidget.ENABLED_ATTR); modelSynchronizer.appendColumn(column); modelSynchronizer.appendRow(); assertFalse((Boolean) uiModel.getRow(0).getCells().get(2).getValue().getValue()); assertFalse(model.getData().get(0).get(2).getBooleanValue()); } }
@Test public void checkBooleanDefaultValueTrue() throws VetoException { final AttributeCol52 column = new AttributeCol52(); column.setAttribute(RuleAttributeWidget.ENABLED_ATTR); column.setDefaultValue(new DTCellValue52(true)); modelSynchronizer.appendColumn(column); modelSynchronizer.appendRow(); assertTrue((Boolean) uiModel.getRow(0).getCells().get(2).getValue().getValue()); assertTrue(model.getData().get(0).get(2).getBooleanValue()); }
@Before public void setUp() throws Exception { salienceAttribute = new AttributeCol52(); salienceAttribute.setAttribute(RuleAttributeWidget.SALIENCE_ATTR); resolvedHitMetadata = new MetadataCol52(); resolvedHitMetadata.setMetadata(GuidedDecisionTable52.HitPolicy.RESOLVED_HIT_METADATA_NAME); model.setHitPolicy(GuidedDecisionTable52.HitPolicy.RESOLVED_HIT); modelSynchronizer.appendColumn(salienceAttribute); modelSynchronizer.appendColumn(resolvedHitMetadata); rowsCount = 0; }