Package org.switchyard.test

Examples of org.switchyard.test.Invoker$ExchangeHandlerProxy


        QName serviceName = new QName("RulesFired");
        BPMExchangeHandler handler = new BPMExchangeHandler(bci_model, serviceDomain, serviceName);
        Service service = serviceDomain.registerService(serviceName, new InOnlyService("process"), handler);
        serviceDomain.registerServiceReference(service.getName(), service.getInterface(), service.getProviderHandler());
        handler.start();
        new Invoker(serviceDomain, serviceName).operation("process").sendInOnly(holder);
        handler.stop();
        Assert.assertEquals("rules fired", holder.getValue());
    }
View Full Code Here


        QName serviceName = new QName("SignalProcess");
        BPMExchangeHandler handler = new BPMExchangeHandler(bci_model, serviceDomain, serviceName);
        Service signalService = serviceDomain.registerService(serviceName, JavaService.fromClass(SignalProcess.class), handler);
        serviceDomain.registerServiceReference(signalService.getName(), signalService.getInterface(), signalService.getProviderHandler());
        handler.start();
        Invoker processInvoker = new Invoker(serviceDomain, serviceName);
        Holder holderOne = new Holder();
        holderOne.setValue("HolderOne");
        Message processResponse = processInvoker.operation("process").sendInOut(holderOne);
        Long processInstanceId = (Long)processResponse.getContext().getPropertyValue(PROCESSS_INSTANCE_ID_PROPERTY);
        Invoker signalInvoker = new Invoker(serviceDomain, serviceName);
        Holder holderTwo = new Holder();
        holderTwo.setValue("HolderTwo");
        Message signalResponse = signalInvoker.operation("signal").property(PROCESSS_INSTANCE_ID_PROPERTY, processInstanceId).sendInOut(holderTwo);
        Holder holderResponse = signalResponse.getContent(Holder.class);
        handler.stop();
        Assert.assertEquals(holderOne.getValue(), testAssertionMap.get("ServiceOne"));
        Assert.assertEquals(holderTwo.getValue(), testAssertionMap.get("ServiceTwo"));
        Assert.assertEquals(holderTwo.getValue(), holderResponse.getValue());
View Full Code Here

    private SwitchYardTestKit _testKit;

    @Test
    public void testInject() {
        Invoker invoker = _testKit.newInvoker("InjectService.doSomething");
        SynchronousInOutHandler handler = new SynchronousInOutHandler();
        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");
View Full Code Here

TOP

Related Classes of org.switchyard.test.Invoker$ExchangeHandlerProxy

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.