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

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


            }

            @Override
            public Fixture getFixture() {
                String factName = valueWidget.getItemText( valueWidget.getSelectedIndex() );
                return new CallMethod( factName );
            }
View Full Code Here


        Cheesery listChesse = new Cheesery();
        listChesse.setTotalAmount(1000);
        populatedData.put("cheese",
                listChesse);
        CallMethod mCall = new CallMethod();
        mCall.setVariable("cheese");
        mCall.setMethodName("setTotalAmountToZero");

        methodExecutor.executeMethod(mCall);

        assertTrue(listChesse.getTotalAmount() == 0);
    }
View Full Code Here

        Cheesery listChesse = new Cheesery();
        listChesse.setTotalAmount(1000);
        populatedData.put("cheese",
                listChesse);
        CallMethod mCall = new CallMethod();
        mCall.setVariable("cheese");
        mCall.setMethodName("addToTotalAmount");
        CallFieldValue field = new CallFieldValue();
        field.value = "5";
        mCall.addFieldValue(field);

        methodExecutor.executeMethod(mCall);
        assertTrue(listChesse.getTotalAmount() == 1005);
    }
View Full Code Here

        populatedData.put("cheese",
                listChesse);
        Cheesery.Maturity m = new Cheesery.Maturity();
        populatedData.put("m",
                m);
        CallMethod mCall = new CallMethod();
        mCall.setVariable("cheese");
        mCall.setMethodName("setGoodMaturity");
        CallFieldValue field = new CallFieldValue();
        field.value = "=m";
        mCall.addFieldValue(field);

        methodExecutor.executeMethod(mCall);

        assertTrue(listChesse.getMaturity().equals(m));
        assertTrue(listChesse.getMaturity() == m);
View Full Code Here

        populatedData.put("cheese",
                listChesse);
        Cheesery.Maturity m = new Cheesery.Maturity("veryYoung");
        populatedData.put("m",
                m);
        CallMethod mCall = new CallMethod();
        mCall.setVariable("cheese");
        mCall.setMethodName("setAgeToMaturity");
        CallFieldValue field = new CallFieldValue();
        field.value = "=m";
        mCall.addFieldValue(field);
        CallFieldValue field2 = new CallFieldValue();
        field2.value = "veryold";
        mCall.addFieldValue(field2);

        methodExecutor.executeMethod(mCall);
        assertTrue(m.getAge().equals("veryold"));
    }
View Full Code Here

            } else if (fixture instanceof RetractFact) {
                RetractFact retractFact = (RetractFact) fixture;
                this.workingMemory.retract(this.factHandles.get(retractFact.getName()));
                this.populatedData.remove(retractFact.getName());
            } else if (fixture instanceof CallMethod) {
                CallMethod aCall = (CallMethod) (fixture);
                Object targetInstance = populatedData.get(aCall.getVariable());
                executeMethodOnObject(aCall,
                        targetInstance);
            } else if (fixture instanceof ActivateRuleFlowGroup) {
                String ruleFlowGroupName = ((ActivateRuleFlowGroup) fixture).getName();
                workingMemory.getAgenda().getRuleFlowGroup(ruleFlowGroupName).setAutoDeactivate(false);
View Full Code Here

TOP

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

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.