Search in sources :

Example 6 with Coordinate

use of org.drools.workbench.services.verifier.plugin.client.Coordinate in project drools-wb by kiegroup.

the class DTableUpdateManagerTest method testSetBooleanActionToNewBoolean.

@Test
public void testSetBooleanActionToNewBoolean() throws Exception, UpdateException {
    final ArrayList<Coordinate> coordinates = new ArrayList<Coordinate>();
    final Coordinate coordinate = new Coordinate(0, 3);
    coordinates.add(coordinate);
    table52.getData().get(0).get(3).setBooleanValue(false);
    updateManager.update(table52, coordinates);
    verify(analyzer).update(anySet());
}
Also used : Coordinate(org.drools.workbench.services.verifier.plugin.client.Coordinate) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 7 with Coordinate

use of org.drools.workbench.services.verifier.plugin.client.Coordinate in project drools-wb by kiegroup.

the class DTableUpdateManagerTest method testSetActionToNull.

@Test
public void testSetActionToNull() throws Exception, UpdateException {
    ArrayList<Coordinate> coordinates = new ArrayList<Coordinate>();
    Coordinate coordinate = new Coordinate(0, 3);
    coordinates.add(coordinate);
    table52.getData().get(0).get(3).setBooleanValue(null);
    updateManager.update(table52, coordinates);
    verify(analyzer).update(anySet());
}
Also used : Coordinate(org.drools.workbench.services.verifier.plugin.client.Coordinate) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 8 with Coordinate

use of org.drools.workbench.services.verifier.plugin.client.Coordinate in project drools-wb by kiegroup.

the class DTableUpdateManagerTest method testSetIntegerConditionToNewInteger.

@Test
public void testSetIntegerConditionToNewInteger() 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(123);
    updateManager.update(table52, coordinates);
    verify(analyzer).update(anySet());
}
Also used : Coordinate(org.drools.workbench.services.verifier.plugin.client.Coordinate) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 9 with Coordinate

use of org.drools.workbench.services.verifier.plugin.client.Coordinate in project drools-wb by kiegroup.

the class DTableUpdateManagerTest method testFillNullCondition.

@Test
public void testFillNullCondition() 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(123);
    updateManager.update(table52, coordinates);
    verify(analyzer).update(anySet());
}
Also used : Coordinate(org.drools.workbench.services.verifier.plugin.client.Coordinate) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Example 10 with Coordinate

use of org.drools.workbench.services.verifier.plugin.client.Coordinate in project drools-wb by kiegroup.

the class DecisionTableAnalyzerFromFileTest method testFileLargeFileGDSTWithDeletes.

@Test
public void testFileLargeFileGDSTWithDeletes() throws Exception, UpdateException {
    final String xml = loadResource("Large file.gdst");
    final GuidedDecisionTable52 table52 = GuidedDTXMLPersistence.getInstance().unmarshal(xml);
    final Analyzer analyzer = analyzerProvider.makeAnalyser(table52);
    analyzer.resetChecks();
    analyzer.analyze();
    assertOnlyContains(analyzerProvider.getAnalysisReport(), SINGLE_HIT_LOST, EMPTY_RULE);
    long baseline = System.currentTimeMillis();
    for (int iterations = 0; iterations < 10; iterations++) {
        analyzer.removeRule(100);
        table52.getData().remove(100);
        List<Coordinate> canBeUpdated = new ArrayList<>();
        canBeUpdated.add(new Coordinate(0, 0));
        analyzerProvider.getUpdateManager(table52, analyzer).update(table52, canBeUpdated);
        long now = System.currentTimeMillis();
        System.out.println("Partial analysis took.. " + (now - baseline) + " ms");
        baseline = now;
        assertOnlyContains(analyzerProvider.getAnalysisReport(), SINGLE_HIT_LOST, EMPTY_RULE);
    }
}
Also used : GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) Coordinate(org.drools.workbench.services.verifier.plugin.client.Coordinate) ArrayList(java.util.ArrayList) Analyzer(org.drools.workbench.services.verifier.core.main.Analyzer) Test(org.junit.Test)

Aggregations

Coordinate (org.drools.workbench.services.verifier.plugin.client.Coordinate)22 ArrayList (java.util.ArrayList)21 Test (org.junit.Test)19 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)3 Analyzer (org.drools.workbench.services.verifier.core.main.Analyzer)3 HashSet (java.util.HashSet)1 Set (java.util.Set)1 Mockito.anySet (org.mockito.Mockito.anySet)1