ColumnUtilities extends ColumnUtilitiesBase { public static boolean canAcceptOtherwiseValues(final BaseColumn column) { if (!(column instanceof ConditionCol52)) { return false; } final ConditionCol52 cc = (ConditionCol52) column; if (cc.getConstraintValueType() != BaseSingleFieldConstraint.TYPE_LITERAL) { return false; } if (cc.getOperator() == null) { return false; } if (cc.getOperator().equals("==")) { return true; } if (cc.getOperator().equals("!=")) { return true; } return false; } ColumnUtilities(final GuidedDecisionTable52 model,
                           final AsyncPackageDataModelOracle oracle); static void setColumnLabelStyleWhenHidden(final ColumnLabelWidget label,
                                                     final boolean isHidden); static boolean canAcceptOtherwiseValues(final BaseColumn column); String[] getValueList(final BaseColumn col); boolean hasValueList(final AttributeCol52 col);  }
@Test public void testCanAcceptOtherwisePredicate() throws Exception { column.setConstraintValueType(BaseSingleFieldConstraint.TYPE_PREDICATE); assertFalse(ColumnUtilities.canAcceptOtherwiseValues(column)); }
@Test public void testCanAcceptOtherwiseEqual() throws Exception { column.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL); column.setOperator("=="); assertTrue(ColumnUtilities.canAcceptOtherwiseValues(column)); }
@Test public void testCanAcceptOtherwiseNotEqual() throws Exception { column.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL); column.setOperator("!="); assertTrue(ColumnUtilities.canAcceptOtherwiseValues(column)); }
@Test public void testCanAcceptOtherwiseWrongOperator() throws Exception { column.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL); column.setOperator("<"); assertFalse(ColumnUtilities.canAcceptOtherwiseValues(column)); }