@Override public void onValueChange(final ValueChangeEvent<String> event) { String binding = txtBinding.getText(); chosenPatternSelection.setBoundName(binding); presenter.stateChanged(); validateBinding(); } });
@Override public void onValueChange(final ValueChangeEvent<String> event) { String binding = txtBinding.getText(); chosenPatternSelection.setBoundName(binding); presenter.stateChanged(); validateBinding(); } });
@Override public void makeResult(final GuidedDecisionTable52 model) { //Ensure every Pattern is bound int fi = 1; for (Pattern52 p : model.getPatterns()) { if (!getValidator().isPatternValid(p)) { String binding = NEW_FACT_PREFIX + (fi++); p.setBoundName(binding); while (!getValidator().isPatternBindingUnique(p)) { binding = NEW_FACT_PREFIX + (fi++); p.setBoundName(binding); } } } }
private Pattern52 mockFactPattern(final String binding) { final Pattern52 p = new Pattern52(); p.setBoundName(binding); return p; }
@Test public void testDiffBoundName() { column1.setBoundName("$var1"); column2.setBoundName("$var2"); checkSingleDiff(FIELD_BOUND_NAME, "$var1", "$var2", column1, column2); }
private Pattern52 boundApplicantPattern(final String boundName) { Pattern52 pattern = new Pattern52(); pattern.setBoundName(boundName); pattern.setFactType("Applicant"); return pattern; }
private Pattern52 boundAddressPattern(final String boundName) { Pattern52 pattern = new Pattern52(); pattern.setBoundName(boundName); pattern.setFactType("Address"); return pattern; }
protected Pattern52 whenThereIsAPattern(final String factType, final String binding) { final Pattern52 p = new Pattern52(); p.setFactType(factType); p.setBoundName(binding); dtable.getConditions().add(p); return p; }
protected Pattern52 findPattern(String boundName, String factType) { for (Pattern52 pattern : patterns) { if (pattern.getBoundName().equals(boundName) && pattern.getFactType().equals(factType)) { return pattern; } } Pattern52 pattern = new Pattern52(); pattern.setBoundName(boundName); pattern.setFactType(factType); patterns.add(pattern); return pattern; }
protected Pattern52 findPattern(String boundName, String factType) { for (Pattern52 pattern : patterns) { if (pattern.getBoundName().equals(boundName) && pattern.getFactType().equals(factType)) { return pattern; } } Pattern52 pattern = new Pattern52(); pattern.setBoundName(boundName); pattern.setFactType(factType); patterns.add(pattern); return pattern; }
protected void setupPatternAndCondition() { final Pattern52 p = new Pattern52(); p.setFactType("Person"); p.setBoundName("$p"); final ConditionCol52 cc = new ConditionCol52(); cc.setFactField("name"); cc.setOperator("=="); cc.setFieldType(DataType.TYPE_STRING); p.getChildColumns().add(cc); model.getConditions().add(p); when(dmo.getFieldType(eq("Person"), eq("name"))).thenReturn(DataType.TYPE_STRING); }
@Test public void testGetValueSetFieldColumn() throws Exception { pattern.setFactType(FACT_TYPE); pattern.setBoundName("$a"); when(model.getConditions()).thenReturn(Arrays.asList(pattern)); final ActionSetFieldCol52 column = new ActionSetFieldCol52(); column.setFactField(FIELD_NAME); column.setBoundName("$a"); column.setValueList("a,1,1.1, ,-1, 123,456 , -789 "); when(oracle.getFieldType(FACT_TYPE, FIELD_NAME)).thenReturn("Integer"); final String[] valueList = utilities.getValueList(column); Assertions.assertThat(valueList).containsExactly("1", "-1", "123", "456", "-789"); }
/** * Clones this pattern instance. * @return The cloned instance. */ public Pattern52 clonePattern() { Pattern52 cloned = new Pattern52(); cloned.setBoundName( getBoundName() ); cloned.setChildColumns( new ArrayList<ConditionCol52>( getChildColumns() ) ); cloned.setEntryPointName( getEntryPointName() ); cloned.setFactType( getFactType() ); cloned.setNegated( isNegated() ); cloned.setWindow( getWindow() ); return cloned; }
/** * Update this pattern instance properties with the given ones from other pattern instance. * @param other The pattern to obtain the properties to set. */ public void update( Pattern52 other ) { setBoundName( other.getBoundName() ); setChildColumns( other.getChildColumns() ); setEntryPointName( other.getEntryPointName() ); setFactType( other.getFactType() ); setNegated( other.isNegated() ); setWindow( other.getWindow() ); }
@Test public void testPatternsSelectionModel() throws Exception { verify(view.chosenPatternsContainer).add(chosenPatternWidgetCaptor.capture()); selectionModel = (MultiSelectionModel<Pattern52>) chosenPatternWidgetCaptor.getValue().getSelectionModel(); person = new Pattern52(); person.setFactType("Person"); selectionModel.setSelected(person, true); assertTrue(selectionModel.isSelected(person)); person.setBoundName("p"); assertTrue(selectionModel.isSelected(person)); } }
private Pattern52 wrappedPattern() { editingPattern.setFactType(patternWrapper().getFactType()); editingPattern.setBoundName(patternWrapper().getBoundName()); editingPattern.setNegated(patternWrapper().isNegated()); editingPattern.setEntryPointName(patternWrapper().getEntryPointName()); return editingPattern; }
private Pattern52 wrappedPattern() { editingPattern.setFactType(patternWrapper().getFactType()); editingPattern.setBoundName(patternWrapper().getBoundName()); editingPattern.setNegated(patternWrapper().isNegated()); editingPattern.setEntryPointName(patternWrapper().getEntryPointName()); return editingPattern; }
@Override public Pattern52 editingPattern() { editingPattern.setFactType(patternWrapper().getFactType()); editingPattern.setBoundName(patternWrapper().getBoundName()); editingPattern.setNegated(patternWrapper().isNegated()); editingPattern.setEntryPointName(patternWrapper().getEntryPointName()); return editingPattern; }
@Override public Pattern52 editingPattern() { editingPattern.setFactType(patternWrapper().getFactType()); editingPattern.setBoundName(patternWrapper().getBoundName()); editingPattern.setNegated(patternWrapper().isNegated()); editingPattern.setEntryPointName(patternWrapper().getEntryPointName()); return editingPattern; }
@Before public void setup() { column1 = new Pattern52(); column1.setFactType("Fact"); column1.setBoundName("$var"); column1.setNegated(false); column1.setWindow(new CEPWindow()); column1.setEntryPointName("entryPoint"); column2 = new Pattern52(); column2.setFactType("Fact"); column2.setBoundName("$var"); column2.setNegated(false); column2.setWindow(new CEPWindow()); column2.setEntryPointName("entryPoint"); }