Package org.drools.pipeline.camel

Examples of org.drools.pipeline.camel.Person


    private AgendaEventListener ael;
    private WorkingMemoryEventListener wmel;

    @Test
    public void testSessionInsert() throws Exception {
        Person person = new Person();
        person.setName( "Bob" );

        template.sendBody( "direct:test-no-ep", person );
       
        ArgumentCaptor<ObjectInsertedEvent> oie = ArgumentCaptor.forClass( ObjectInsertedEvent.class );
        ArgumentCaptor<ActivationCreatedEvent> ace = ArgumentCaptor.forClass( ActivationCreatedEvent.class );
View Full Code Here


    @Test
    public void testSessionInsert() throws Exception {

        BatchExecutionCommandImpl cmd = new BatchExecutionCommandImpl();
        cmd.setLookup( "ksession1" );
        cmd.getCommands().add( new InsertObjectCommand( new Person( "lucaz",
                                                                    25 ),
                                                        "person1" ) );
        cmd.getCommands().add( new InsertObjectCommand( new Person( "hadrian",
                                                                    25 ),
                                                        "person2" ) );
        cmd.getCommands().add( new InsertObjectCommand( new Person( "baunax",
                                                                    21 ),
                                                        "person3" ) );
        cmd.getCommands().add( new FireAllRulesCommand() );

        StringWriter xmlReq = new StringWriter();
View Full Code Here

        assertNotNull( xmlResp );

        ExecutionResults resp = (ExecutionResults) getJaxbContext().createUnmarshaller().unmarshal( new ByteArrayInputStream( xmlResp ) );
        assertNotNull( resp );

        Person person = (Person) resp.getValue( "rider" );

        assertEquals( "salaboy",
                      person.getName() );

    }
View Full Code Here

    public void testInsertElements() throws Exception {

        BatchExecutionCommandImpl cmd = new BatchExecutionCommandImpl();
        cmd.setLookup( "ksession1" );
        InsertElementsCommand elems = new InsertElementsCommand( "elems" );
        elems.getObjects().add( new Person( "lucaz",
                                            25 ) );
        elems.getObjects().add( new Person( "hadrian",
                                            25 ) );
        elems.getObjects().add( new Person( "baunax",
                                            21 ) );
        elems.getObjects().add( "xxx" );

        cmd.getCommands().add( elems );
        cmd.getCommands().add( new FireAllRulesCommand() );
View Full Code Here

        //        jaxbDataFormat.setContextPath( sb.toString() );
        //        jaxbDataFormat.setPrettyPrint( true );
        JAXBContext jaxbContext = JAXBContext.newInstance( sb.toString() );

        List<GenericCommand< ? >> cmds = new ArrayList<GenericCommand< ? >>();
        cmds.add( new InsertObjectCommand( new Person( "darth",
                                                       21 ),
                                           "p" ) );
        cmds.add( new GetGlobalCommand( "xxx" ) );
        cmds.add( new SetGlobalCommand( "yyy",
                                        new Person( "yoda",
                                                    21 ) ) );
        BatchExecutionCommandImpl batch = new BatchExecutionCommandImpl( cmds );

        Marshaller marshaller = jaxbContext.createMarshaller();
        marshaller.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT,
View Full Code Here

        assertThat( ace.getValue().getActivation().getRule().getName(), is("rule1") );
    }

    @Test
    public void testSessionInsertEntryPoint() throws Exception {
        Person person = new Person();
        person.setName( "Bob" );

        template.sendBody( "direct:test-with-ep", person );
       
        ArgumentCaptor<ObjectInsertedEvent> oie = ArgumentCaptor.forClass( ObjectInsertedEvent.class );
        ArgumentCaptor<ActivationCreatedEvent> ace = ArgumentCaptor.forClass( ActivationCreatedEvent.class );
View Full Code Here

        assertThat( ace.getValue().getActivation().getRule().getName(), is("rule2") );
    }

    @Test
    public void testSessionInsertMessage() throws Exception {
        Person person = new Person();
        person.setName( "Bob" );

        template.sendBody( "direct:test-message", person );
       
        ArgumentCaptor<ObjectInsertedEvent> oie = ArgumentCaptor.forClass( ObjectInsertedEvent.class );
        ArgumentCaptor<ActivationCreatedEvent> ace = ArgumentCaptor.forClass( ActivationCreatedEvent.class );
View Full Code Here

        assertThat( ace.getValue().getActivation().getRule().getName(), is("rule3") );
    }

    @Test
    public void testSessionInsertExchange() throws Exception {
        Person person = new Person();
        person.setName( "Bob" );

        template.sendBody( "direct:test-exchange", person );
       
        ArgumentCaptor<ObjectInsertedEvent> oie = ArgumentCaptor.forClass( ObjectInsertedEvent.class );
        ArgumentCaptor<ActivationCreatedEvent> ace = ArgumentCaptor.forClass( ActivationCreatedEvent.class );
View Full Code Here

public class CamelEndpointTest extends DroolsCamelTestSupport {
    private String handle;

    @Test
    public void testSessionInsert() throws Exception {
        Person person = new Person();
        person.setName( "Mauricio" );

        InsertObjectCommand cmd = (InsertObjectCommand) CommandFactory.newInsert( person,
                                                                                  "salaboy" );

        ExecutionResults response = (ExecutionResults) template.requestBody( "direct:test-with-session",
View Full Code Here

                    response.getFactHandle( "salaboy" ) != null );
    }

    @Test
    public void testNoSessionInsert() throws Exception {
        Person person = new Person();
        person.setName( "Mauricio" );

        InsertObjectCommand cmd = (InsertObjectCommand) CommandFactory.newInsert( person,
                                                                                  "salaboy" );

        ExecutionResults response = (ExecutionResults) template.requestBodyAndHeader( "direct:test-no-session",
View Full Code Here

TOP

Related Classes of org.drools.pipeline.camel.Person

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.