Package org.drools.workbench.models.testscenarios.shared

Examples of org.drools.workbench.models.testscenarios.shared.FixtureList


    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(fixture);
            } else if (fixture instanceof VerifyRuleFired) {
                verifyRule.add(fixture);
            } else if (fixture instanceof VerifyFact) {
                verifyFact.add(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


        return map;
    }

    private void accumulateDataForFactData(Map<String, FixtureList> dataInput, FactData fd) {
        if (!dataInput.containsKey(fd.getType())) {
            dataInput.put(fd.getType(), new FixtureList());
        }
        dataInput.get(fd.getType()).add(fd);

    }
View Full Code Here

        return listExecutionTrace;
    }

    private void accumulateDataForActivateRuleFlowGroup(Map<String, FixtureList> dataInput, Fixture f) {
        if (!dataInput.containsKey(ScenarioHelper.ACTIVATE_RULE_FLOW_GROUP)) {
            dataInput.put(ScenarioHelper.ACTIVATE_RULE_FLOW_GROUP, new FixtureList());
        }
        dataInput.get(ScenarioHelper.ACTIVATE_RULE_FLOW_GROUP).add(f);

    }
View Full Code Here

    }

    private void accumulateCallMethod(Map<String, FixtureList> dataInput, CallMethod fd) {
        if (!dataInput.containsKey(fd.getVariable())) {
            dataInput.put(fd.getVariable(), new FixtureList());
        }
        dataInput.get(fd.getVariable()).add(fd);

    }
View Full Code Here

                                  final Scenario scenario,
                                  final ScenarioParentWidget parent,
                                  PackageDataModelOracle dmo) {

        for (Map.Entry<String, FixtureList> e : given.entrySet()) {
            FixtureList itemList = given.get(e.getKey());
            for (Fixture f : itemList) {
                CallMethod mCall = (CallMethod) f;
                add(new CallMethodWidget(e.getKey(), parent, scenario, mCall,
                        listExecutionTrace.get(executionTraceLine), dmo));
            };
View Full Code Here

                      final Scenario scenario,
                      PackageDataModelOracle dmo,
                      final ScenarioParentWidget parent) {

        for (Map.Entry<String, FixtureList> e : given.entrySet()) {
            FixtureList itemList = given.get(e.getKey());
            if (e.getKey().equals(ScenarioHelper.RETRACT_KEY)) {
                add(new RetractWidget(
                        itemList,
                        scenario,
                        parent));
            } else if (e.getKey().equals(ScenarioHelper.ACTIVATE_RULE_FLOW_GROUP)) {
                add(new ActivateRuleFlowWidget(
                        itemList,
                        scenario,
                        parent));
            } else {
                if (itemList.getFirstFactData().isModify()) {
                    add(new ModifyFactWidget(
                            e.getKey(),
                            itemList,
                            scenario,
                            dmo,
View Full Code Here

                                             1,
                                             scenarioWidgetComponentCreator.createCallMethodOnGivenPanel( listExecutionTrace,
                                                                                                          executionTraceLine,
                                                                                                          (CallFixtureMap) fixture ) );
            } else {
                FixtureList fixturesList = (FixtureList) fixture;
                Fixture first = fixturesList.get( 0 );

                if ( first instanceof VerifyFact ) {
                    createWidgetForEditorLayout( editorLayout,
                                                 layoutRow,
                                                 1,
View Full Code Here

                                             1,
                                             scenarioWidgetComponentCreator.createCallMethodOnGivenPanel( listExecutionTrace,
                                                                                                          executionTraceLine,
                                                                                                          (CallFixtureMap) fixture ) );
            } else {
                FixtureList fixturesList = (FixtureList) fixture;
                Fixture first = fixturesList.get( 0 );

                if ( first instanceof VerifyFact ) {
                    createWidgetForEditorLayout( editorLayout,
                                                 layoutRow,
                                                 1,
View Full Code Here

                                             1,
                                             scenarioWidgetComponentCreator.createCallMethodOnGivenPanel( listExecutionTrace,
                                                                                                          executionTraceLine,
                                                                                                          (CallFixtureMap) fixture ) );
            } else {
                FixtureList fixturesList = (FixtureList) fixture;
                Fixture first = fixturesList.get( 0 );

                if ( first instanceof VerifyFact ) {
                    createWidgetForEditorLayout( editorLayout,
                                                 layoutRow,
                                                 1,
View Full Code Here

                                             scenarioWidgetComponentCreator.createCallMethodOnGivenPanel( listExecutionTrace,
                                                                                                          executionTraceLine,
                                                                                                          (CallFixtureMap) fixture )
                                           );
            } else {
                FixtureList fixturesList = (FixtureList) fixture;
                Fixture first = fixturesList.get( 0 );

                if ( first instanceof VerifyFact ) {
                    createWidgetForEditorLayout( editorLayout,
                                                 layoutRow,
                                                 1,
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.testscenarios.shared.FixtureList

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.