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

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


        assertEquals(Boolean.FALSE, ((VerifyField)vf.fieldValues.get(0)).successResult);

    }

    public void testVerifyFactsWithOperator() throws Exception {
        ScenarioRunner runner = new ScenarioRunner( new Scenario(),
                                                    null,
                                                    new MockWorkingMemory() );
        Cheese f1 = new Cheese( "cheddar",
                                42 );
        runner.populatedData.put( "f1",
View Full Code Here


        assertFalse( ((VerifyField) vf.fieldValues.get( 0 )).successResult );

    }

    public void testVerifyFactsWithExpression() throws Exception {
        ScenarioRunner runner = new ScenarioRunner( new Scenario(),
                                                    null,
                                                    new MockWorkingMemory() );
        Cheese f1 = new Cheese( "cheddar",
                                42 );
        runner.populatedData.put( "f1",
View Full Code Here

        assertTrue( ((VerifyField) vf.fieldValues.get( 0 )).successResult );
    }

    public void testVerifyFactExplanation() throws Exception {
        ScenarioRunner runner = new ScenarioRunner( new Scenario(),
                                                    null,
                                                    new MockWorkingMemory() );
        Cheese f1 = new Cheese();
        f1.setType( null );
        runner.populatedData.put( "f1",
View Full Code Here

                      vfl.explanation );

    }

    public void testVerifyFieldAndActualIsNull() throws Exception {
        ScenarioRunner runner = new ScenarioRunner( new Scenario(),
                                                    null,
                                                    new MockWorkingMemory() );
        Cheese f1 = new Cheese();
        f1.setType( null );
        runner.populatedData.put( "f1",
View Full Code Here

                      vfl.actualResult );

    }

    public void testDummyRunNoRules() throws Exception {
        Scenario sc = new Scenario();
        FactData[] facts = new FactData[]{new FactData( "Cheese",
                                                        "c1",
                                                        ls( new FieldData( "type",
                                                                           "cheddar" ),
                                                            new FieldData( "price",
View Full Code Here

                          2 );
        firingCounts.put( "bar",
                          1 );
        // and baz, we leave out

        ScenarioRunner runner = new ScenarioRunner( new Scenario(),
                                                    null,
                                                    new MockWorkingMemory() );
        VerifyRuleFired v = new VerifyRuleFired();
        v.ruleName = "foo";
        v.expectedFire = true;
View Full Code Here

                      v.actualResult.intValue() );

    }

    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 );
View Full Code Here

        assertTrue( sc.rules.contains( "foo" ) );
        assertTrue( sc.rules.contains( "bar" ) );
    }

    public void testWithGlobals() throws Exception {
        Scenario sc = new Scenario();
        FactData[] facts = new FactData[]{new FactData( "Cheese",
                                                        "c2",
                                                        ls( new FieldData( "type",
                                                                           "stilton" ) ),
                                                        false )};
View Full Code Here

    }

    @SuppressWarnings("deprecation")
    // F**** dates in java. What a mess. Someone should die.
    public void testSimulatedDate() throws Exception {
        Scenario sc = new Scenario();
        MockWorkingMemory wm = new MockWorkingMemory();
        ScenarioRunner run = new ScenarioRunner( sc,
                                                 null,
                                                 wm );
        TimeMachine tm = run.workingMemory.getTimeMachine();
View Full Code Here

                      tm.getNow().getTimeInMillis() );

    }

    public void testVerifyRuleFired() throws Exception {
        ScenarioRunner runner = new ScenarioRunner( new Scenario(),
                                                    null,
                                                    new MockWorkingMemory() );

        VerifyRuleFired vr = new VerifyRuleFired( "qqq",
                                                  42,
View Full Code Here

TOP

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

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.