use of org.drools.workbench.services.verifier.plugin.client.Coordinate in project drools-wb by kiegroup.
the class DTableUpdateManagerTest method testFillNullAction.
@Test
public void testFillNullAction() throws Exception, UpdateException {
ArrayList<Coordinate> coordinates = new ArrayList<Coordinate>();
Coordinate coordinate = new Coordinate(1, 3);
coordinates.add(coordinate);
table52.getData().get(1).get(3).setBooleanValue(false);
updateManager.update(table52, coordinates);
verify(analyzer).update(anySet());
}
use of org.drools.workbench.services.verifier.plugin.client.Coordinate in project drools-wb by kiegroup.
the class DTableUpdateManagerTest method testSetConditionToNull.
@Test
public void testSetConditionToNull() throws Exception, UpdateException {
ArrayList<Coordinate> coordinates = new ArrayList<Coordinate>();
Coordinate coordinate = new Coordinate(0, 2);
coordinates.add(coordinate);
table52.getData().get(0).get(2).setNumericValue((Integer) null);
updateManager.update(table52, coordinates);
verify(analyzer).update(anySet());
}
use of org.drools.workbench.services.verifier.plugin.client.Coordinate in project drools-wb by kiegroup.
the class DTableUpdateManagerTest method testFillNullConditionWithNull.
@Test
public void testFillNullConditionWithNull() throws Exception, UpdateException {
ArrayList<Coordinate> coordinates = new ArrayList<Coordinate>();
Coordinate coordinate = new Coordinate(1, 2);
coordinates.add(coordinate);
table52.getData().get(1).get(2).setNumericValue((Integer) null);
updateManager.update(table52, coordinates);
verify(analyzer, never()).update(anySet());
}
use of org.drools.workbench.services.verifier.plugin.client.Coordinate in project drools-wb by kiegroup.
the class DecisionTableAnalyzerFromFileTest method testUpdateNotNullColumn.
@Test
public void testUpdateNotNullColumn() throws Exception, UpdateException {
final String xml = loadResource("Is Null Table.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
// First run
analyzer.resetChecks();
analyzer.analyze();
assertContains(analyzerProvider.getAnalysisReport(), RULE_HAS_NO_RESTRICTIONS_AND_WILL_ALWAYS_FIRE, Severity.NOTE);
// Update
table52.getData().get(0).get(2).setBooleanValue(true);
final List<Coordinate> updates = new ArrayList<>();
updates.add(new Coordinate(0, 2));
analyzerProvider.getUpdateManager(table52, analyzer).update(table52, updates);
// Update
table52.getData().get(1).get(2).setBooleanValue(true);
final List<Coordinate> updates2 = new ArrayList<>();
updates2.add(new Coordinate(1, 2));
analyzerProvider.getUpdateManager(table52, analyzer).update(table52, updates2);
assertDoesNotContain(RULE_HAS_NO_RESTRICTIONS_AND_WILL_ALWAYS_FIRE, analyzerProvider.getAnalysisReport());
}
use of org.drools.workbench.services.verifier.plugin.client.Coordinate in project drools-wb by kiegroup.
the class DecisionTableAnalyzerFromFileTest method testFileLargeFileGDSTWithUpdate.
@Test
public void testFileLargeFileGDSTWithUpdate() throws Exception, UpdateException {
long baseline = System.currentTimeMillis();
final String xml = loadResource("Large file.gdst");
final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
long now = System.currentTimeMillis();
System.out.println("Loading of model took.. " + (now - baseline) + " ms");
baseline = now;
final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
now = System.currentTimeMillis();
System.out.println("Indexing took.. " + (now - baseline) + " ms");
analyzer.resetChecks();
analyzer.analyze();
assertOnlyContains(analyzerProvider.getAnalysisReport(), SINGLE_HIT_LOST, EMPTY_RULE);
now = System.currentTimeMillis();
System.out.println("Initial analysis took.. " + (now - baseline) + " ms");
baseline = now;
table52.getData().get(2).get(6).clearValues();
final List<Coordinate> updates = new ArrayList<>();
updates.add(new Coordinate(2, 6));
analyzerProvider.getUpdateManager(table52, analyzer).update(table52, updates);
assertOnlyContains(analyzerProvider.getAnalysisReport(), SINGLE_HIT_LOST, EMPTY_RULE);
now = System.currentTimeMillis();
System.out.println("Partial analysis took.. " + (now - baseline) + " ms");
}
Aggregations