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

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


        sc.globals.add(d3);
        sc.globals.add(d4);
        sc.rules.add("rule1");
        sc.rules.add("rule2");

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

        List fields = new ArrayList();
        VerifyField vfl = new VerifyField("age", "42", "==");
        vfl.actualResult = "43";
        vfl.successResult = new Boolean(false);
View Full Code Here


                      sc.getFixtures().indexOf( vf5 ) );

        sc = new Scenario();

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

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

        ExecutionTrace ex2 = new ExecutionTrace();
        sc.getFixtures().add( ex2 );
        sc.insertBetween( ex,
                          vf4 );
        assertEquals( 6,
                      sc.getFixtures().size() );
View Full Code Here

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

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

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

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

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

        List l = sc.getFactNamesInScope( ex1,
                                         true );
View Full Code Here

        FactData fd3 = new FactData( "Z",
                                     "z",
                                     new ArrayList(),
                                     false );
        sc.getFixtures().add( fd3 );
        ExecutionTrace ex1 = new ExecutionTrace();
        FactData fd4 = new FactData( "I",
                                     "i",
                                     new ArrayList(),
                                     false );
        sc.getGlobals().add( fd4 );
View Full Code Here

                                           false ) );
        sc.getFixtures().add( new FactData( "Q",
                                            "q",
                                            null,
                                            false ) );
        sc.getFixtures().add( new ExecutionTrace() );

        assertTrue( sc.isFactNameReserved( "x" ) );
        assertTrue( sc.isFactNameReserved( "q" ) );
        assertFalse( sc.isFactNameReserved( "w" ) );
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();
View Full Code Here

    @Test
    public void testTrimUneededSection() {
        Scenario sc = getDemo();
        Scenario orig = getDemo();
        sc.getFixtures().add(new ExecutionTrace());

        int origSize = orig.getFixtures().size();

        assertEquals(origSize + 1, sc.getFixtures().size());
        String xml = ScenarioXMLPersistence.getInstance().marshal(sc);
View Full Code Here

    @Test
    public void testNewScenario() {
        FactData d1 = new FactData("Driver", "d1", ls(new FieldData[] {new FieldData("age", "42"), new FieldData("name", "david")}), false);
        Scenario sc = new Scenario();
        sc.getFixtures().add(d1);
        sc.getFixtures().add(new ExecutionTrace());

        int size = sc.getFixtures().size();

        String xml = ScenarioXMLPersistence.getInstance().marshal(sc);
        Scenario sc_ = ScenarioXMLPersistence.getInstance().unmarshal(xml);

        assertEquals(size, sc_.getFixtures().size());

        sc = new Scenario();
        sc.getFixtures().add(new ExecutionTrace());
        xml = ScenarioXMLPersistence.getInstance().marshal(sc);
        sc_ = ScenarioXMLPersistence.getInstance().unmarshal(xml);
        assertEquals(1, sc_.getFixtures().size());
    }
View Full Code Here

        sc.getGlobals().add(d3);
        sc.getGlobals().add(d4);
        sc.getRules().add("rule1");
        sc.getRules().add("rule2");

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

        List fields = new ArrayList();
        VerifyField vfl = new VerifyField("age", "42", "==");
        vfl.setActualResult( "43" );
        vfl.setSuccessResult( new Boolean(false) );
View Full Code Here

TOP

Related Classes of org.drools.ide.common.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.