public String[] getValueList(BaseColumn col) { if ( col instanceof AttributeCol52 ) { return getValueList( (AttributeCol52) col ); } else if ( col instanceof ConditionCol52 ) { return getValueList( (ConditionCol52) col ); } else if ( col instanceof ActionSetFieldCol52 ) { return getValueList( (ActionSetFieldCol52) col ); } else if ( col instanceof ActionInsertFactCol52 ) { return getValueList( (ActionInsertFactCol52) col ); } return new String[0]; }
public String[] getValueList(BaseColumn col) { if ( col instanceof AttributeCol52 ) { return getValueList( (AttributeCol52) col ); } else if ( col instanceof ConditionCol52 ) { return getValueList( (ConditionCol52) col ); } else if ( col instanceof ActionSetFieldCol52 ) { return getValueList( (ActionSetFieldCol52) col ); } else if ( col instanceof ActionInsertFactCol52 ) { return getValueList( (ActionInsertFactCol52) col ); } return new String[0]; }
assertTrue( dt.getValueList( c1 ).length > 0 ); assertTrue( dt.getValueList( c1 ).length == 3 ); assertEquals( "age>10", dt.getValueList( c1 )[0] ); assertEquals( "age>20", dt.getValueList( c1 )[1] ); assertEquals( "age>30", dt.getValueList( c1 )[2] );
assertTrue( dt.getValueList( c1 ).length > 0 ); assertTrue( dt.getValueList( c1 ).length == 3 ); assertEquals( "getAge()>10", dt.getValueList( c1 )[0] ); assertEquals( "getAge()>20", dt.getValueList( c1 )[1] ); assertEquals( "getAge()>30", dt.getValueList( c1 )[2] );
@Test public void testNoConstraintLists() { GuidedDecisionTable52 dt = new GuidedDecisionTable52(); // add cols for LHS ConditionCol52 c1 = new ConditionCol52(); Pattern52 p1 = new Pattern52(); p1.setBoundName( "c1" ); p1.setFactType( "Driver" ); c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL ); p1.getChildColumns().add( c1 ); dt.getConditions().add( p1 ); ConditionCol52 c2 = new ConditionCol52(); Pattern52 p2 = new Pattern52(); p2.setBoundName( "c2" ); p2.setFactType( "Driver" ); c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL ); c2.setValueList( "a,b,c" ); p2.getChildColumns().add( c2 ); dt.getConditions().add( p1 ); SuggestionCompletionEngine sce = new SuggestionCompletionEngine(); sce.putDataEnumList( "Driver.name", new String[]{"bob", "michael"} ); assertEquals( 0, dt.getValueList( c1 ).length ); assertEquals( 3, dt.getValueList( c2 ).length ); }
c1__.getFactField() ) ); assertTrue( dt.hasValueList( c1__ ) ); r = dt.getValueList( c1__ ); assertEquals( 2, r.length ); c1___.getFactField() ) ); assertTrue( dt.hasValueList( c1___ ) ); r = dt.getValueList( c1___ ); assertEquals( 3, r.length ); dt.getValueList( c2 ).length ); ins_.getFactField() ) ); assertTrue( dt.hasValueList( ins_ ) ); r = dt.getValueList( ins_ ); assertEquals( 3, r.length ); dt.getValueList( asf_ ).length ); r = dt.getValueList( asf__ ); assertEquals( 3, r.length ); r = dt.getValueList( at ); assertEquals( 2, r.length );