Package org.switchyard.test

Examples of org.switchyard.test.TestDataSource


        assertThat(title, is(equalTo("Fletch")));
    }

    @Test
    public void sendOneWayMessageThroughCamelToTestAttachment() throws Exception {
        DataSource ds = new TestDataSource("10", "text/plain", "Fletch-Data");
        _getDataForItem.attachment(ds.getName(), ds);
        final String data = _getDataForItem.sendInOut(ds.getName()).getContent(String.class);
        assertThat(data, is(equalTo("Fletch-Data")));
    }
View Full Code Here


        QName serviceName = new QName("AccessAttachment");
        RulesExchangeHandler handler = new RulesExchangeHandler(rci_model, serviceDomain, serviceName);
        Service service = serviceDomain.registerService(serviceName, JavaService.fromClass(AccessAttachment.class), handler);
        serviceDomain.registerServiceReference(service.getName(), service.getInterface(), service.getProviderHandler());
        handler.start();
        DataSource attachment = new TestDataSource("someAttach", "text/plain", "someAttachData");
        new Invoker(serviceDomain, serviceName).operation("process").attachment(attachment.getName(), attachment).sendInOnly(holder);
        handler.stop();
        Assert.assertEquals("someAttachData", holder.getValue());
    }
View Full Code Here

        QName serviceName = new QName("AccessAttachment");
        BPMExchangeHandler handler = new BPMExchangeHandler(bci_model, serviceDomain, serviceName);
        Service service = serviceDomain.registerService(serviceName, JavaService.fromClass(AccessAttachment.class), handler);
        serviceDomain.registerServiceReference(service.getName(), service.getInterface(), service.getProviderHandler());
        handler.start();
        DataSource attachment = new TestDataSource("someAttach", "text/plain", "someAttachData");
        new Invoker(serviceDomain, serviceName).operation("process").attachment(attachment.getName(), attachment).sendInOnly(holder);
        handler.stop();
        Assert.assertEquals("someAttachData", holder.getValue());
    }
View Full Code Here

        Exchange exchange = invoker.createExchange(handler);
        Message message = exchange.createMessage();
        Context context = exchange.getContext(message);
        context.setProperty("someProp", "somePropVal");
        message.setContent("blah");
        DataSource attach = new TestDataSource("someAttach", "text/plain", "someAttachData");
        message.addAttachment(attach.getName(), attach);
        exchange.send(message);
        Exchange outExchange = handler.waitForOut();
        Assert.assertEquals("true, true, true", outExchange.getMessage().getContent());
    }
View Full Code Here

TOP

Related Classes of org.switchyard.test.TestDataSource

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.