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

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


    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

                                      "p",
                                      new ArrayList(),
                                      false ) );
        sc.fixtures.addAll( Arrays.asList( facts ) );

        ExecutionTrace executionTrace = new ExecutionTrace();

        sc.rules.add( "rule1" );
        sc.rules.add( "rule2" );
        sc.inclusive = true;
        sc.fixtures.add( executionTrace );
View Full Code Here

                                      "p",
                                      new ArrayList(),
                                      false ) );
        sc.fixtures.addAll( Arrays.asList( facts ) );

        ExecutionTrace executionTrace = new ExecutionTrace();

        sc.rules.add( "rule1" );
        sc.rules.add( "rule2" );
        sc.inclusive = true;
        sc.fixtures.add( executionTrace );
View Full Code Here

                                                        false )

        };
        sc.fixtures.addAll( Arrays.asList( facts ) );

        ExecutionTrace executionTrace = new ExecutionTrace();

        sc.rules.add( "rule1" );
        sc.inclusive = true;
        sc.fixtures.add( executionTrace );
View Full Code Here

        sc.fixtures.add( new FactData( "Cheese",
                                       "c1",
                                       ls( new FieldData( "price",
                                                          "1" ) ),
                                       false ) );
        ExecutionTrace ex = new ExecutionTrace();
        sc.fixtures.add( ex );
        sc.fixtures.add( new FactData( "Cheese",
                                       "c2",
                                       ls( new FieldData( "price",
                                                          "2" ) ),
                                       false ) );
        sc.fixtures.add( new VerifyFact( "c1",
                                         ls( new VerifyField( "type",
                                                              "rule1",
                                                              "==" ) ) ) );
        ex = new ExecutionTrace();
        sc.fixtures.add( ex );
        sc.fixtures.add( new VerifyFact( "c1",
                                         ls( new VerifyField( "type",
                                                              "rule2",
                                                              "==" ) ) ) );
View Full Code Here

                                       "c1",
                                       ls( new FieldData( "price",
                                                          "1" ) ),
                                       false ) );

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

        sc.fixtures.add( new VerifyFact( "c1",
                                         ls( new VerifyField( "type",
                                                              "rule1",
                                                              "==" ) ) ) );

        sc.fixtures.add( new FactData( "Cheese",
                                       "c1",
                                       ls( new FieldData( "price",
                                                          "42" ) ),
                                       true ) );
        sc.fixtures.add( new ExecutionTrace() );

        sc.fixtures.add( new VerifyFact( "c1",
                                         ls( new VerifyField( "type",
                                                              "rule3",
                                                              "==" ) ) ) );
View Full Code Here

        sc.fixtures.add( new FactData( "Cheese",
                                       "c2",
                                       ls( new FieldData( "price",
                                                          "42" ) ),
                                       false ) );
        sc.fixtures.add( new ExecutionTrace() );

        sc.fixtures.add( new VerifyFact( "c1",
                                         ls( new VerifyField( "type",
                                                              "XXX",
                                                              "==" ) ) ) );

        sc.fixtures.add( new RetractFact( "c2" ) );
        sc.fixtures.add( new ExecutionTrace() );

        sc.fixtures.add( new VerifyFact( "c1",
                                         ls( new VerifyField( "type",
                                                              "rule4",
                                                              "==" ) ) ) );
View Full Code Here

        sc.globals.add( new FactData( "Person",
                                      "p",
                                      new ArrayList(),
                                      false ) );

        ExecutionTrace executionTrace = new ExecutionTrace();
        sc.rules.add( "rule1" );
        sc.rules.add( "rule2" );
        sc.inclusive = true;
        sc.fixtures.add( executionTrace );
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

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.