@Before public void setUp() throws Exception { model = new GuidedDecisionTable52(); actionSetFieldsPage.model = model; }
@Before public void setUp() throws Exception { model = new GuidedDecisionTable52(); }
@Before public void setup() { this.dtable = new GuidedDecisionTable52(); }
@Before public void setup() { model = spy(new GuidedDecisionTable52()); when(presenter.getModel()).thenReturn(model); when(page.plugin()).thenReturn(plugin); }
@Before public void setUp() throws Exception { actionColumns = new ArrayList<>(); conditionColumns = new ArrayList<>(); patterns = new ArrayList<>(); pattern = new Pattern52(); connection = mock(VerifierWebWorkerConnection.class); updateManager = mock(DTableUpdateManager.class); model = new GuidedDecisionTable52(); decisionTableAnalyzer = new DecisionTableAnalyzer(model, updateManager, connection); }
@Before public void setup() { when(page.plugin()).thenReturn(plugin); model = new GuidedDecisionTable52(); when(plugin.getPresenter()).thenReturn(presenter); when(translationService.format(YouMustEnterAColumnHeaderValueDescription)) .thenReturn(ENTER_COLUMN_DESCRIPTION); when(translationService.format(ThatColumnNameIsAlreadyInUsePleasePickAnother)) .thenReturn(PICK_ANOTHER); }
@Before public void setup() { wizard = makeNewGuidedDecisionTableColumnWizard(); plugin = spy(makeConditionColumnPlugin()); model = new GuidedDecisionTable52(); doReturn(model).when(presenter).getModel(); doReturn(oracle).when(presenter).getDataModelOracle(); doNothing().when(plugin).fireChangeEvent(any(WizardPage.class)); wizard.start(plugin); }
@Before public void setup() { this.model = new GuidedDecisionTable52(); this.serviceCaller = new CallerMock<>(service); final ColumnDefinitionBuilder wrapped = getBuilder(); this.builder = spy(wrapped); when(service.toSource(any(Path.class), any(GuidedDecisionTable52.class))).thenAnswer((InvocationOnMock invocation) -> { final GuidedDecisionTable52 model = (GuidedDecisionTable52) invocation.getArguments()[1]; return GuidedDTDRLPersistence.getInstance().marshal(model); }); when(dtPresenter.getModel()).thenReturn(model); when(dtPresenter.getDataModelOracle()).thenReturn(dmo); }
protected void generateActionColumn( final GuidedDecisionTableView.Presenter dtPresenter, final BaseColumn column, final Callback<String> afterGenerationCallback ) { final GuidedDecisionTable52 existingModel = dtPresenter.getModel(); final GuidedDecisionTable52 partialModel = new GuidedDecisionTable52(); final ColumnUtilities columnUtilities = new ColumnUtilities( existingModel, dtPresenter.getDataModelOracle() ); final ActionCol52 ac = (ActionCol52) column; partialModel.getActionCols().add( ac ); partialModel.getData().add( makeRowData( columnUtilities, ac ) ); generateDefinitionOnServer( partialModel, dtPresenter.getCurrentPath(), ( String drl ) -> afterGenerationCallback.callback( getRHS( drl ) ) ); }
@Before public void setUp() throws Exception { dtable = new GuidedDecisionTable52(); dtable.setTableName( "Rule order table" ); dtable.setHitPolicy( GuidedDecisionTable52.HitPolicy.RULE_ORDER ); }
@Test public void testEmpty() throws Exception { table52 = new GuidedDecisionTable52(); fireUpAnalyzer(); assertTrue(analyzerProvider.getAnalysisReport().isEmpty()); }
@Test public void testDefault() throws Exception { assertEquals( GuidedDecisionTable52.HitPolicy.NONE, new GuidedDecisionTable52().getHitPolicy() ); }
@Test public void onlyOneDecisionTableThereforeNoLinks() { manager.link(new GuidedDecisionTable52(), null, (s, t) -> fail("There should be no links")); }
@Test public void onlyOneDecisionTableThereforeNoLinks() { manager.link(new GuidedDecisionTable52(), null, (s, t) -> fail("There should be no links")); }
@Test public void testEmpty() throws Exception { table52 = new GuidedDecisionTable52(); fireUpAnalyzer(); assertTrue(analyzerProvider.getAnalysisReport().isEmpty()); }
@Before public void setUp() throws Exception { dtable = new GuidedDecisionTable52(); dtable.setTableName( "Unique hit policy table" ); dtable.setHitPolicy( GuidedDecisionTable52.HitPolicy.UNIQUE_HIT ); }
@Before public void setUp() throws Exception { dtable = new GuidedDecisionTable52(); dtable.setTableName( "Resolved hit policy table" ); dtable.setHitPolicy( GuidedDecisionTable52.HitPolicy.RESOLVED_HIT ); dtable.setData( DataUtilities.makeDataLists( new Object[][]{ new Object[]{1, "desc-row1"}, new Object[]{2, "desc-row2"}, new Object[]{3, "desc-row3"} } ) ); }
@Before public void setUp() throws Exception { dtable = new GuidedDecisionTable52(); dtable.setTableName( "First hit policy table" ); dtable.setHitPolicy( GuidedDecisionTable52.HitPolicy.FIRST_HIT ); dtable.setData( DataUtilities.makeDataLists( new Object[][]{ new Object[]{1, "desc-row1"}, new Object[]{2, "desc-row2"}, new Object[]{3, "desc-row3"} } ) ); }
public static GuidedDecisionTable52 makeTableWithAttributeCol(final String packageName, final Collection<Import> imports, final String tableName) { final GuidedDecisionTable52 dt = new GuidedDecisionTable52(); dt.setPackageName(packageName); dt.getImports().getImports().addAll(imports); dt.setTableName(tableName); AttributeCol52 attr = new AttributeCol52(); attr.setAttribute("ruleflow-group"); dt.getAttributeCols().add(attr); dt.setData(DataUtilities.makeDataLists(new String[][]{ new String[]{"1", "desc", "myRuleFlowGroup"} })); return dt; }
@Test public void testRoundTrip() { final GuidedDecisionTable52 dt = new GuidedDecisionTable52(); dt.setHitPolicy( GuidedDecisionTable52.HitPolicy.FIRST_HIT ); final String xml = GuidedDTXMLPersistence.getInstance() .marshal( dt ); assertNotNull( xml ); assertTrue( xml.contains( "<hitPolicy>FIRST_HIT</hitPolicy>" ) ); final GuidedDecisionTable52 dt_ = GuidedDTXMLPersistence.getInstance() .unmarshal( xml ); assertEquals( GuidedDecisionTable52.HitPolicy.FIRST_HIT, dt_.getHitPolicy() ); }