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

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


        fdl = (List) first.get("X");
        assertEquals(2, fdl.size());
        fd = (FactData) fdl.get(0);
        assertEquals("a", fd.getName());

        CallFixtureMap callMap = (CallFixtureMap)fx.get(1);
        assertEquals(2, callMap.size());
        assertTrue(callMap.containsKey("x"));
        FixtureList lcall1 = callMap.get("x");
        CallMethod c1 = (CallMethod)lcall1.get(0);
        assertTrue(c1.getVariable().equals("x"));
        assertTrue(c1.getMethodName().equals("hello"));
        CallMethod c2 = (CallMethod)lcall1.get(1);
        assertTrue(c2.getVariable().equals("x"));
        assertTrue(c2.getMethodName().equals("helloItherWay"));
        assertTrue(callMap.containsKey("v"));
        FixtureList lcall2 = callMap.get("v");
        CallMethod c3= (CallMethod)lcall2.get(0);
        assertTrue(c3.getVariable().equals("v"));
        assertTrue(c3.getMethodName().equals("helloAgain"));


        assertEquals(ex1, fx.get(2));

        List ruleFired = (List) fx.get(3);
        assertEquals(2, ruleFired.size());
        assertEquals(vr1, ruleFired.get(0));
        assertEquals(vr2, ruleFired.get(1));

        List verifyFact = (List) fx.get(4);
        assertEquals(2, verifyFact.size());
        assertEquals(vf1, verifyFact.get(0));
        assertEquals(vf2, verifyFact.get(1));



        Map second = (Map) fx.get(5);
        assertEquals(3, second.size());
        assertTrue(second.containsKey("Z"));
        assertTrue(second.containsKey("Q"));
        fdl = (List) second.get("Q");
        assertEquals(2, fdl.size());

        assertTrue(second.containsKey("retract"));
        List retracts = (List) second.get("retract");
        assertEquals(1, retracts.size());
        RetractFact ret = (RetractFact) retracts.get(0);
        assertEquals("y", ret.getName());


        CallFixtureMap third = (CallFixtureMap)fx.get(6);
        assertEquals(1, third.size());
        assertTrue(third.containsKey("x"));
        FixtureList lcall3 = third.get("x");
        CallMethod c4= (CallMethod)lcall3.get(0);
        assertTrue(c4.getVariable().equals("x"));
        assertTrue(c4.getMethodName().equals("hello"));
        assertEquals(ex2, fx.get(7));
View Full Code Here


     */
    public List<Fixture> lumpyMap(List<Fixture> fixtures) {
        List<Fixture> output = new ArrayList<Fixture>();

        FixturesMap dataInput = new FixturesMap();
        CallFixtureMap callOnDataInput = new CallFixtureMap();
        FixtureList verifyFact = new FixtureList();
        FixtureList verifyRule = new FixtureList();
        FixtureList retractFacts = new FixtureList();
        for ( Fixture fixture : fixtures ) {
            if ( fixture instanceof FactData ) {
                accumulateDataForFactData( dataInput, (FactData) fixture );
            } else if ( fixture instanceof CallMethod ) {
                accumulateCallMethod( callOnDataInput, (CallMethod) fixture );
            } else if ( fixture instanceof ActivateRuleFlowGroup ) {
                accumulateDataForActivateRuleFlowGroup( dataInput, fixture );
            } else if ( fixture instanceof RetractFact ) {
                retractFacts.add( (RetractFact) fixture );
            } else if ( fixture instanceof VerifyRuleFired ) {
                verifyRule.add( (VerifyRuleFired) fixture );
            } else if ( fixture instanceof VerifyFact ) {
                verifyFact.add( (VerifyFact) fixture );
            } else if ( fixture instanceof ExecutionTrace ) {
                gatherFixtures( output, dataInput, callOnDataInput, verifyFact, verifyRule, retractFacts, false );

                output.add( fixture );

                verifyRule = new FixtureList();
                verifyFact = new FixtureList();
                retractFacts = new FixtureList();
                callOnDataInput = new CallFixtureMap();
                dataInput = new FixturesMap();
            }
        }
        gatherFixtures( output, dataInput, callOnDataInput, verifyFact, verifyRule, retractFacts, true );

View Full Code Here

     */
    public List<Fixture> lumpyMap(List<Fixture> fixtures) {
        List<Fixture> output = new ArrayList<Fixture>();

        FixturesMap dataInput = new FixturesMap();
        CallFixtureMap callOnDataInput = new CallFixtureMap();
        FixtureList verifyFact = new FixtureList();
        FixtureList verifyRule = new FixtureList();
        FixtureList retractFacts = new FixtureList();
        for ( Fixture fixture : fixtures ) {
            if ( fixture instanceof FactData ) {
                accumulateDataForFactData( dataInput, (FactData) fixture );
            } else if ( fixture instanceof CallMethod ) {
                accumulateCallMethod( callOnDataInput, (CallMethod) fixture );
            } else if ( fixture instanceof ActivateRuleFlowGroup ) {
                accumulateDataForActivateRuleFlowGroup( dataInput, fixture );
            } else if ( fixture instanceof RetractFact ) {
                retractFacts.add( (RetractFact) fixture );
            } else if ( fixture instanceof VerifyRuleFired ) {
                verifyRule.add( (VerifyRuleFired) fixture );
            } else if ( fixture instanceof VerifyFact ) {
                verifyFact.add( (VerifyFact) fixture );
            } else if ( fixture instanceof ExecutionTrace ) {
                gatherFixtures( output, dataInput, callOnDataInput, verifyFact, verifyRule, retractFacts, false );

                output.add( fixture );

                verifyRule = new FixtureList();
                verifyFact = new FixtureList();
                retractFacts = new FixtureList();
                callOnDataInput = new CallFixtureMap();
                dataInput = new FixturesMap();
            }
        }
        gatherFixtures( output, dataInput, callOnDataInput, verifyFact, verifyRule, retractFacts, true );

View Full Code Here

     */
    public List<Fixture> lumpyMap(List<Fixture> fixtures) {
        List<Fixture> output = new ArrayList<Fixture>();

        FixturesMap dataInput = new FixturesMap();
        CallFixtureMap callOnDataInput = new CallFixtureMap();
        FixtureList verifyFact = new FixtureList();
        FixtureList verifyRule = new FixtureList();
        FixtureList retractFacts = new FixtureList();
        for ( Fixture fixture : fixtures ) {
            if ( fixture instanceof FactData ) {
                accumulateDataForFactData( dataInput, (FactData) fixture );
            } else if ( fixture instanceof CallMethod ) {
                accumulateCallMethod( callOnDataInput, (CallMethod) fixture );
            } else if ( fixture instanceof ActivateRuleFlowGroup ) {
                accumulateDataForActivateRuleFlowGroup( dataInput, fixture );
            } else if ( fixture instanceof RetractFact ) {
                retractFacts.add( (RetractFact) fixture );
            } else if ( fixture instanceof VerifyRuleFired ) {
                verifyRule.add( (VerifyRuleFired) fixture );
            } else if ( fixture instanceof VerifyFact ) {
                verifyFact.add( (VerifyFact) fixture );
            } else if ( fixture instanceof ExecutionTrace ) {
                gatherFixtures( output, dataInput, callOnDataInput, verifyFact, verifyRule, retractFacts, false );

                output.add( fixture );

                verifyRule = new FixtureList();
                verifyFact = new FixtureList();
                retractFacts = new FixtureList();
                callOnDataInput = new CallFixtureMap();
                dataInput = new FixturesMap();
            }
        }
        gatherFixtures( output, dataInput, callOnDataInput, verifyFact, verifyRule, retractFacts, true );

View Full Code Here

        fdl = (List) first.get("X");
        assertEquals(2, fdl.size());
        fd = (FactData) fdl.get(0);
        assertEquals("a", fd.getName());

        CallFixtureMap callMap = (CallFixtureMap)fx.get(1);
        assertEquals(2, callMap.size());
        assertTrue(callMap.containsKey("x"));
        FixtureList lcall1 = callMap.get("x");
        CallMethod c1 = (CallMethod)lcall1.get(0);
        assertTrue(c1.getVariable().equals("x"));
        assertTrue(c1.getMethodName().equals("hello"));
        CallMethod c2 = (CallMethod)lcall1.get(1);
        assertTrue(c2.getVariable().equals("x"));
        assertTrue(c2.getMethodName().equals("helloItherWay"));
        assertTrue(callMap.containsKey("v"));
        FixtureList lcall2 = callMap.get("v");
        CallMethod c3= (CallMethod)lcall2.get(0);
        assertTrue(c3.getVariable().equals("v"));
        assertTrue(c3.getMethodName().equals("helloAgain"));


        assertEquals(ex1, fx.get(2));

        List ruleFired = (List) fx.get(3);
        assertEquals(2, ruleFired.size());
        assertEquals(vr1, ruleFired.get(0));
        assertEquals(vr2, ruleFired.get(1));

        List verifyFact = (List) fx.get(4);
        assertEquals(2, verifyFact.size());
        assertEquals(vf1, verifyFact.get(0));
        assertEquals(vf2, verifyFact.get(1));



        Map second = (Map) fx.get(5);
        assertEquals(3, second.size());
        assertTrue(second.containsKey("Z"));
        assertTrue(second.containsKey("Q"));
        fdl = (List) second.get("Q");
        assertEquals(2, fdl.size());

        assertTrue(second.containsKey("retract"));
        List retracts = (List) second.get("retract");
        assertEquals(1, retracts.size());
        RetractFact ret = (RetractFact) retracts.get(0);
        assertEquals("y", ret.getName());


        CallFixtureMap third = (CallFixtureMap)fx.get(6);
        assertEquals(1, third.size());
        assertTrue(third.containsKey("x"));
        FixtureList lcall3 = third.get("x");
        CallMethod c4= (CallMethod)lcall3.get(0);
        assertTrue(c4.getVariable().equals("x"));
        assertTrue(c4.getMethodName().equals("hello"));
        assertEquals(ex2, fx.get(7));
View Full Code Here

TOP

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

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.