use of org.kie.soup.project.datamodel.imports.Import in project drools-wb by kiegroup.
the class DecisionTableAnalyzerSubsumptionResolverTest method testRedundantRows002.
@Test
public void testRedundantRows002() throws Exception {
GuidedDecisionTable52 table52 = new ExtendedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withStringColumn("application", "LoanApplication", "amount", ">").withStringColumn("person", "Person", "name", "==").withStringColumn("income", "IncomeSource", "type", "==").withActionSetField("application", "approved", DataType.TYPE_STRING).withData(new Object[][] { { 1, "description", "131000", "Toni", "Asset", "true" }, { 2, "description", "131000", "Toni", "Asset", "true" }, { 3, "description", "100001", "Michael", "Job", "true" } }).buildTable();
Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
analyzer.resetChecks();
analyzer.analyze();
assertContains(analyzerProvider.getAnalysisReport(), REDUNDANT_ROWS, Severity.WARNING, 1, 2);
}
use of org.kie.soup.project.datamodel.imports.Import in project drools-wb by kiegroup.
the class DecisionTableAnalyzerTest method testRedundancy.
@Test
public void testRedundancy() throws Exception {
table52 = new LimitedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withIntegerColumn("a", "Person", "age", "==", 0).withAction("a", "Person", "approved", new DTCellValue52() {
{
setBooleanValue(true);
}
}).withAction("a", "Person", "approved", new DTCellValue52() {
{
setBooleanValue(true);
}
}).withData(new Object[][] { { 1, "description", true, true, false }, { 2, "description", true, false, true } }).buildTable();
fireUpAnalyzer();
assertContains(analyzerProvider.getAnalysisReport(), REDUNDANT_ROWS, Severity.WARNING, 1, 2);
assertNotNull(analyzerProvider.getStatus());
}
use of org.kie.soup.project.datamodel.imports.Import in project drools-wb by kiegroup.
the class DecisionTableAnalyzerConflictResolverLimitedDTableTest method testConflict.
@Test
public void testConflict() throws Exception {
table52 = new LimitedGuidedDecisionTableBuilder("org.test", new ArrayList<Import>(), "mytable").withIntegerColumn("a", "Person", "age", "==", 0).withAction("a", "approved", DataType.TYPE_BOOLEAN, new DTCellValue52() {
{
setBooleanValue(true);
}
}).withAction("a", "approved", DataType.TYPE_BOOLEAN, new DTCellValue52() {
{
setBooleanValue(false);
}
}).withData(new Object[][] { { 1, "description", true, true, false }, { 2, "description", true, false, true } }).buildTable();
fireUpAnalyzer();
assertContains(analyzerProvider.getAnalysisReport(), CONFLICTING_ROWS, Severity.WARNING, 2);
assertContains(analyzerProvider.getAnalysisReport(), CONFLICTING_ROWS, Severity.WARNING, 1);
}
use of org.kie.soup.project.datamodel.imports.Import in project kie-wb-common by kiegroup.
the class ExternalDataObjectsItemPresenterTest method testSetup.
@Test
public void testSetup() {
final Import import_ = new Import("type");
externalDataObjectsItemPresenter.setup(import_, mock(ExternalDataObjectsPresenter.class));
verify(view).init(eq(externalDataObjectsItemPresenter));
verify(view).setTypeName(eq("type"));
assertEquals(import_, externalDataObjectsItemPresenter.getObject());
}
use of org.kie.soup.project.datamodel.imports.Import in project kie-wb-common by kiegroup.
the class ExternalDataObjectsItemPresenterTest method testSetupOfType.
private void testSetupOfType(final String type) {
final Import import_ = new Import(type);
externalDataObjectsItemPresenter.setup(import_, mock(ExternalDataObjectsPresenter.class));
verify(view).init(eq(externalDataObjectsItemPresenter));
verify(view).setTypeName(eq(type));
assertEquals(import_, externalDataObjectsItemPresenter.getObject());
}
Aggregations