Package org.drools.ide.common.client.modeldriven.testing

Examples of org.drools.ide.common.client.modeldriven.testing.VerifyRuleFired


                                                             "42",
                                                             "==" )

                                        ) );

        assertions[1] = new VerifyRuleFired( "rule1",
                                             1,
                                             null );

        sc.getFixtures().addAll( Arrays.asList( assertions ) );
View Full Code Here


        assertions[0] = new VerifyFact( "c",
                                        ls( new VerifyField( "num",
                                                             "42",
                                                             "==" ) ) );

        assertions[1] = new VerifyRuleFired( "rule1",
                                             1,
                                             null );

        scenario.getFixtures().addAll( Arrays.asList( assertions ) );
View Full Code Here

                      ((VerifyField) vf.getFieldValues().get( 0 )).getExpected() );
        assertEquals( "rule1",
                      ((VerifyField) vf.getFieldValues().get( 0 )).getActualResult() );
        assertNotNull( ((VerifyField) vf.getFieldValues().get( 0 )).getExplanation() );

        VerifyRuleFired vr = (VerifyRuleFired) assertions[4];
        assertFalse( vr.getSuccessResult() );

        assertEquals( 2,
                      vr.getExpectedCount().intValue() );
        assertEquals( 0,
                      vr.getActualResult().intValue() );

    }
View Full Code Here

                                                             "rule2",
                                                             "==" )

                                        ) );

        assertions[2] = new VerifyRuleFired( "rule1",
                                             1,
                                             null );
        assertions[3] = new VerifyRuleFired( "rule2",
                                             1,
                                             null );
        assertions[4] = new VerifyRuleFired( "rule3",
                                             2,
                                             null );

        sc.getFixtures().addAll( Arrays.asList( assertions ) );
        return assertions;
View Full Code Here

        VerifyFact vf = new VerifyFact("d1", fields);

        sc.getFixtures().add(vf);

        VerifyRuleFired vf1 = new VerifyRuleFired("Life unverse and everything", new Integer(42), null);
        vf1.setActualResult( new Integer(42) );
        vf1.setSuccessResult( new Boolean(true) );
        vf1.setExplanation( "All good here." );

        VerifyRuleFired vf2 = new VerifyRuleFired("Everything else", null, new Boolean(true));
        vf2.setActualResult( new Integer(0) );
        vf2.setSuccessResult( new Boolean(false) );
        vf2.setExplanation( "Not so good here." );
        sc.getFixtures().add(vf1);
        sc.getFixtures().add(vf2);

    return sc;
  }
View Full Code Here

        VerifyFact vf = new VerifyFact("d1", fields);

        sc.fixtures.add(vf);

        VerifyRuleFired vf1 = new VerifyRuleFired("Life unverse and everything", new Integer(42), null);
        vf1.actualResult = new Integer(42);
        vf1.successResult = new Boolean(true);
        vf1.explanation = "All good here.";

        VerifyRuleFired vf2 = new VerifyRuleFired("Everything else", null, new Boolean(true));
        vf2.actualResult = new Integer(0);
        vf2.successResult = new Boolean(false);
        vf2.explanation = "Not so good here.";
        sc.fixtures.add(vf1);
        sc.fixtures.add(vf2);
View Full Code Here

public class ScenarioTest {

    @Test
    public void testInsertBetween() {
        Scenario sc = new Scenario();
        VerifyRuleFired vf = new VerifyRuleFired();
        sc.insertBetween( null,
                          vf );
        assertEquals( 1,
                      sc.getFixtures().size() );
        assertEquals( vf,
                      sc.getFixtures().get( 0 ) );

        VerifyRuleFired vf2 = new VerifyRuleFired();
        sc.getFixtures().add( vf2 );

        VerifyRuleFired vf3 = new VerifyRuleFired();
        sc.insertBetween( vf,
                          vf3 );
        assertEquals( 3,
                      sc.getFixtures().size() );
        assertEquals( vf,
                      sc.getFixtures().get( 0 ) );
        assertEquals( vf2,
                      sc.getFixtures().get( 1 ) );
        assertEquals( vf3,
                      sc.getFixtures().get( 2 ) );

        VerifyRuleFired vf4 = new VerifyRuleFired();
        sc.insertBetween( vf2,
                          vf4 );
        assertEquals( 4,
                      sc.getFixtures().size() );
        assertEquals( 3,
                      sc.getFixtures().indexOf( vf4 ) );
        assertEquals( 2,
                      sc.getFixtures().indexOf( vf3 ) );
        //assertEquals(vf4, sc.fixtures.get(3));
        assertEquals( 1,
                      sc.getFixtures().indexOf( vf2 ) );
        //assertEquals(vf2, sc.fixtures.get(2));
        assertEquals( 0,
                      sc.getFixtures().indexOf( vf ) );

        VerifyRuleFired vf5 = new VerifyRuleFired();
        sc.insertBetween( null,
                          vf5 );
        assertEquals( 5,
                      sc.getFixtures().size() );
        assertEquals( 4,
View Full Code Here

    @Test
    public void testRemoveFixture() {
        Scenario sc = new Scenario();

        VerifyRuleFired vf1 = new VerifyRuleFired();
        VerifyRuleFired vf2 = new VerifyRuleFired();
        VerifyRuleFired vf3 = new VerifyRuleFired();

        FactData fd = new FactData();

        sc.getFixtures().add( vf1 );
        sc.getFixtures().add( vf2 );
View Full Code Here

    @Test
    public void testCountSuccessFailures() {
        Scenario sc = new Scenario();
        sc.getFixtures().add( new FactData() );
        sc.getFixtures().add( new ExecutionTrace() );
        VerifyRuleFired vr = new VerifyRuleFired();
        vr.setSuccessResult( false );
        sc.getFixtures().add( vr );

        VerifyField vf = new VerifyField();
        vf.setSuccessResult( true );
        VerifyField vf2 = new VerifyField();
View Full Code Here

        VerifyFact vf = new VerifyFact("d1", fields);

        sc.getFixtures().add(vf);

        VerifyRuleFired vf1 = new VerifyRuleFired("Life unverse and everything", new Integer(42), null);
        vf1.setActualResult( new Integer(42) );
        vf1.setSuccessResult( new Boolean(true) );
        vf1.setExplanation( "All good here." );

        VerifyRuleFired vf2 = new VerifyRuleFired("Everything else", null, new Boolean(true));
        vf2.setActualResult( new Integer(0) );
        vf2.setSuccessResult( new Boolean(false) );
        vf2.setExplanation( "Not so good here." );
        sc.getFixtures().add(vf1);
        sc.getFixtures().add(vf2);

        return sc;
    }
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.testing.VerifyRuleFired

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.