Examples of Cheese


Examples of org.drools.camel.testdomain.Cheese

                        outXml );

        List resultsList = (List) result.getValue( "out-list" );
        assertEquals( 1,
                      resultsList.size() );
        assertEquals( new Cheese( "stilton",
                                  25 ),
                      resultsList.get( 0 ) );

    }
View Full Code Here

Examples of org.drools.camel.testdomain.Cheese

        ExecutionResults result = unmarshalOutXml( outXml,
                                                   ExecutionResults.class );

        List list = (List) result.getValue( "list1" );
        Cheese stilton25 = new Cheese( "stilton",
                                       30 );
        Cheese stilton30 = new Cheese( "stilton",
                                       35 );

        Set expectedList = new HashSet();
        expectedList.add( stilton25 );
        expectedList.add( stilton30 );
View Full Code Here

Examples of org.drools.camel.testdomain.Cheese

        getContent( "testQuery.expected.1" ); // just to force a tostring for comparison

        ExecutionResults batchResult = unmarshalOutXml( outXml,
                                                        ExecutionResults.class );

        Cheese stilton1 = new Cheese( "stilton",
                                      1 );
        Cheese cheddar1 = new Cheese( "cheddar",
                                      1 );
        Cheese stilton2 = new Cheese( "stilton",
                                      2 );
        Cheese cheddar2 = new Cheese( "cheddar",
                                      2 );

        Set set = new HashSet();
        List list = new ArrayList();
        list.add( stilton1 );
View Full Code Here

Examples of org.drools.camel.testdomain.Cheese

                                    ((FactHandle) result.getFactHandle( "outBrie" )).toExternalForm() ),
                        outXml );

        // brie should not have been added to the list
        List list = (List) result.getValue( "list1" );
        Cheese stilton25 = new Cheese( "stilton",
                                       30 );
        Cheese stilton30 = new Cheese( "stilton",
                                       35 );

        Set expectedList = new HashSet();
        expectedList.add( stilton25 );
        expectedList.add( stilton30 );

        assertEquals( expectedList,
                      new HashSet( list ) );

        // brie should not have changed
        Cheese brie10 = new Cheese( "brie",
                                    10 );
        brie10.setOldPrice( 5 );
        assertEquals( brie10,
                      result.getValue( "outBrie" ) );
    }
View Full Code Here

Examples of org.drools.camel.testdomain.Cheese

        String outXml = execContent( "testExecutionNodeLookup.in.1" );
        ExecutionResults results = unmarshalOutXml( outXml,
                                                    ExecutionResults.class );

        Cheese stilton = (Cheese) results.getValue( "outStilton" );
        assertEquals( 30,
                      stilton.getPrice() );

        FactHandle factHandle = (FactHandle) results.getFactHandle( "outStilton" );
        stilton = (Cheese) ksession.getObject( factHandle );
        assertEquals( 30,
                      stilton.getPrice() );

        assertXMLEqual( getContent( "testExecutionNodeLookup.expected.1",
                                    factHandle.toExternalForm() ),
                        outXml );
    }
View Full Code Here

Examples of org.drools.camel.testdomain.Cheese

                                    ((FactHandle) result.getFactHandle( "changes" )).toExternalForm(),
                                    ((FactHandle) result.getFactHandle( "person" )).toExternalForm() ),
                        outXml );

        ChangeCollector collector = (ChangeCollector) result.getValue( "changes" );
        Cheese c = (Cheese) collector.getChanges().get( 0 );
        assertEquals( 42,
                      c.getPrice() );

        result = execContent( "testListenForChanges.in.3",
                              ExecutionResults.class );

        collector = (ChangeCollector) result.getValue( "changes" );
View Full Code Here

Examples of org.drools.camel.testdomain.Cheese

                                              String.class );
        ExecutionResults result = template.requestBody( "direct:unmarshal",
                                                        outXml,
                                                        ExecutionResults.class );

        Cheese stilton = (Cheese) result.getValue( "outStilton" );
        assertEquals( 30,
                      stilton.getPrice() );

        FactHandle factHandle = (FactHandle) result.getFactHandle( "outStilton" );
        stilton = (Cheese) ksession.getObject( factHandle );
        assertEquals( 30,
                      stilton.getPrice() );

        String expectedXml = "";
        expectedXml += "<execution-results>\n";
        expectedXml += "  <result identifier=\"outStilton\">\n";
        expectedXml += "    <org.drools.camel.testdomain.Cheese>\n";
View Full Code Here

Examples of org.drools.camel.testdomain.Cheese

                                                        ExecutionResults.class );

        assertNull( result.getValue( "outStilton" ) );

        FactHandle factHandle = (FactHandle) result.getFactHandle( "outStilton" );
        Cheese stilton = (Cheese) ksession.getObject( factHandle );
        assertEquals( 30,
                      stilton.getPrice() );

        String expectedXml = "";
        expectedXml += "<execution-results>\n";
        expectedXml += "  <fact-handle identifier=\"outStilton\" external-form=\"" + ((InternalFactHandle) result.getFactHandle( "outStilton" )).toExternalForm() + "\" /> \n";
        expectedXml += "</execution-results>\n";
View Full Code Here

Examples of org.drools.camel.testdomain.Cheese

                                              String.class );
        ExecutionResults result = template.requestBody( "direct:unmarshal",
                                                        outXml,
                                                        ExecutionResults.class );

        Cheese stilton = (Cheese) result.getValue( "outStilton" );
        assertEquals( 30,
                      stilton.getPrice() );

        FactHandle factHandle = (FactHandle) result.getFactHandle( "outStilton" );
        inXml = "";
        inXml += "<batch-execution>";
        inXml += "  <get-object out-identifier='outStilton' fact-handle='" + factHandle.toExternalForm() + "' />";
        inXml += "</batch-execution>";
        outXml = template.requestBody( "direct:exec",
                                       inXml,
                                       String.class );
        result = template.requestBody( "direct:unmarshal",
                                       outXml,
                                       ExecutionResults.class );
        stilton = (Cheese) result.getValue( "outStilton" );
        assertEquals( 30,
                      stilton.getPrice() );
    }
View Full Code Here

Examples of org.drools.camel.testdomain.Cheese

                                              String.class );
        ExecutionResults result = template.requestBody( "direct:unmarshal",
                                                        outXml,
                                                        ExecutionResults.class );

        Cheese stilton = (Cheese) result.getValue( "outStilton" );
        assertEquals( 30,
                      stilton.getPrice() );

        FactHandle factHandle = (FactHandle) result.getFactHandle( "outStilton" );
        inXml = "";
        inXml += "<batch-execution>";
        inXml += "  <retract fact-handle='" + factHandle.toExternalForm() + "' />";
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.