Examples of Cheesery


Examples of org.drools.compiler.Cheesery

         final List results = new ArrayList();
         ksession.setGlobal( "results",
                             results );

         final Cheesery cheesery = new Cheesery();
         ksession.insert( cheesery );

         ksession.fireAllRules();

         assertEquals( 1,
                       results.size() );
         assertEquals( 1,
                       cheesery.getCheeses().size() );
         assertEquals( results.get( 0 ),
                       cheesery.getCheeses().get( 0 ) );
     }
View Full Code Here

Examples of org.drools.guvnor.models.testscenarios.backend.Cheesery

    @Test
    public void testCallMethodNoArgumentOnFact() throws Exception {
        HashMap<String, Object> populatedData = new HashMap<String, Object>();
        MethodExecutor methodExecutor = new MethodExecutor( populatedData );

        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

Examples of org.drools.workbench.models.testscenarios.backend.Cheesery

                                     false );
        factPopulator.add( new NewFactPopulator( populatedData, typeResolver, lst ) );

        factPopulator.populate();

        Cheesery listChesse = (Cheesery) populatedData.get( "listChesse" );
        Cheese f1 = (Cheese) populatedData.get( "f1" );
        Cheese f2 = (Cheese) populatedData.get( "f2" );
        Cheese f3 = (Cheese) populatedData.get( "f3" );

        assertEquals( 3, listChesse.getCheeses().size() );
        assertTrue( listChesse.getCheeses().contains( f1 ) );
        assertTrue( listChesse.getCheeses().contains( f2 ) );
        assertTrue( listChesse.getCheeses().contains( f3 ) );

    }
View Full Code Here

Examples of org.mvel2.tests.core.res.Cheesery

    ParserContext ctx = new ParserContext();
    ctx.addPackageImport("org.mvel2.tests.core.res");

    ExpressionCompiler compiler = new ExpressionCompiler("new Cheesery(\"bobbo\", new Cheese(\"cheddar\", 15))");

    Cheesery p1 = new Cheesery("bobbo",
        new Cheese("cheddar",
            15));
    Cheesery p2 = (Cheesery) executeExpression(compiler.compile(ctx),
        new DefaultLocalVariableResolverFactory());

    assertEquals(p1,
        p2);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.