Package org.drools.guvnor.client.modeldriven.testing

Examples of org.drools.guvnor.client.modeldriven.testing.ExecutionTrace


      } else if (fx instanceof RetractFact) {
        RetractFact f = (RetractFact)fx;
        this.workingMemory.retract(this.factHandles.get(f.name));
        this.populatedData.remove(f.name);
      } else if (fx instanceof ExecutionTrace) {
        ExecutionTrace executionTrace = (ExecutionTrace)fx;
        //create the listener to trace rules

        if (listener != null) wm.removeEventListener(listener); //remove the old
        listener = new TestingEventListener();
View Full Code Here


        RetractFact f = (RetractFact)fx;
        this.workingMemory.retract(this.factHandles.get(f.name));
        this.populatedData.remove(f.name);
      } else if (fx instanceof ExecutionTrace) {
                doPopulate(toPopulate);
        ExecutionTrace executionTrace = (ExecutionTrace)fx;
        //create the listener to trace rules

        if (listener != null) wm.removeEventListener(listener); //remove the old
        listener = new TestingEventListener();
View Full Code Here


    sc = new Scenario();

    sc.fixtures.add(vf);
    ExecutionTrace ex = new ExecutionTrace();
    sc.fixtures.add(ex);
    sc.insertBetween(null, vf2);
    assertEquals(0, sc.fixtures.indexOf(vf));
    assertEquals(1, sc.fixtures.indexOf(vf2));
    assertEquals(2, sc.fixtures.indexOf(ex));
    assertEquals(3, sc.fixtures.size());

    sc.insertBetween(ex, vf3);
    assertEquals(4, sc.fixtures.size());
    assertEquals(0, sc.fixtures.indexOf(vf));
    assertEquals(1, sc.fixtures.indexOf(vf2));
    assertEquals(2, sc.fixtures.indexOf(ex));
    assertEquals(3, sc.fixtures.indexOf(vf3));


    ExecutionTrace ex2 = new ExecutionTrace();
    sc.fixtures.add(ex2);
    sc.insertBetween(ex, vf4);
    assertEquals(6, sc.fixtures.size());
    assertEquals(0, sc.fixtures.indexOf(vf));
    assertEquals(1, sc.fixtures.indexOf(vf2));
View Full Code Here

        Scenario sc = new Scenario();

        sc.globals.add(new FactData("A", "A", new ArrayList(), false));
        sc.fixtures.add(new FactData("B", "B", new ArrayList(), true));
        sc.fixtures.add(new FactData("C", "C", new ArrayList(), true));
        ExecutionTrace ex1 = new ExecutionTrace();
        sc.fixtures.add(ex1);
        sc.fixtures.add(new VerifyFact());
        sc.fixtures.add(new RetractFact());
        sc.fixtures.add(new FactData("D", "D", new ArrayList(), false));
        sc.fixtures.add(new FactData("E", "E", new ArrayList(), false));
        ExecutionTrace ex2 = new ExecutionTrace();
        sc.fixtures.add(ex2);
        sc.fixtures.add(new VerifyFact());
        sc.fixtures.add(new FactData("F", "F", new ArrayList(), false));
        ExecutionTrace ex3 = new ExecutionTrace();
        sc.fixtures.add(ex3);

        assertEquals( 11,
                      sc.fixtures.size() );
View Full Code Here

    Scenario sc = new Scenario();
    sc.globals.add(new FactData("X", "x", new ArrayList(), false));

    sc.fixtures.add(new FactData("Q", "q", new ArrayList(), true));
    sc.fixtures.add(new FactData("Z", "z", new ArrayList(), false));
    ExecutionTrace ex1 = new ExecutionTrace();

    sc.fixtures.add(ex1);
    sc.fixtures.add(new RetractFact("z"));
    sc.fixtures.add(new FactData("Y", "y", new ArrayList(), false));

    ExecutionTrace ex2 = new ExecutionTrace();
    sc.fixtures.add(ex2);

    List l = sc.getFactNamesInScope(ex1, true);

    assertEquals(3, l.size());
View Full Code Here

    sc.fixtures.add(fd1);
    FactData fd2 = new FactData("Q", "q", new ArrayList(), false);
    sc.fixtures.add(fd2);
    FactData fd3 = new FactData("Z", "z", new ArrayList(), false);
    sc.fixtures.add(fd3);
    ExecutionTrace ex1 = new ExecutionTrace();
    FactData fd4 = new FactData("I", "i", new ArrayList(), false);
    sc.globals.add(fd4);

    sc.fixtures.add(ex1);
    sc.fixtures.add(new RetractFact("z"));
View Full Code Here

  public void testIsFactNameUsed() {
    Scenario sc = new Scenario();
    sc.globals.add(new FactData("X", "x", null, false));
    sc.fixtures.add(new FactData("Q", "q", null, false));
    sc.fixtures.add(new ExecutionTrace());

    assertTrue(sc.isFactNameExisting("x"));
    assertTrue(sc.isFactNameExisting("q"));
    assertFalse(sc.isFactNameExisting("w"));
View Full Code Here

  }

  public void testCountSuccessFailures() {
    Scenario sc = new Scenario();
    sc.fixtures.add(new FactData());
    sc.fixtures.add(new ExecutionTrace());
    VerifyRuleFired vr = new VerifyRuleFired();
    vr.successResult = false;
    sc.fixtures.add(vr);

    VerifyField vf = new VerifyField();
View Full Code Here

    public void testTestingEventListener() throws Exception {
        Scenario sc = new Scenario();
        sc.rules.add( "foo" );
        sc.rules.add( "bar" );
        ExecutionTrace ext = new ExecutionTrace();

        sc.fixtures.add( ext );

        MockWorkingMemory wm = new MockWorkingMemory();
        ScenarioRunner run = new ScenarioRunner( sc,
View Full Code Here

        Thread.sleep( 100 );
        long future = tm.getNow().getTimeInMillis();
        assertTrue( future > time );

        ExecutionTrace ext = new ExecutionTrace();
        ext.scenarioSimulatedDate = new Date( "10-Jul-1974" );
        sc.fixtures.add( ext );
        run = new ScenarioRunner( sc,
                                  null,
                                  wm );
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.modeldriven.testing.ExecutionTrace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.