Examples of waitForOKMessage()


Examples of org.switchyard.MockHandler.waitForOKMessage()

        Exchange exchange = service.createExchange(consumer);
        exchange.send(exchange.createMessage());
       
        // wait, since this is async
        provider.waitForOKMessage();
        consumer.waitForOKMessage();
    }

    @Test
    public void testInOutFault() throws Exception {
       
View Full Code Here

Examples of org.switchyard.MockHandler.waitForOKMessage()

            msg.setContent(input);
            exchange.send(msg);

            // wait for message and verify validation
            provider.waitForOKMessage();
            Assert.assertEquals(provider.getMessages().poll().getMessage().getContent(), input);
        } finally {
            // Must remove this validator, otherwise it's there for the following test... will be
            // fixed once we get rid of the static service domain.
            _domain.getValidatorRegistry().removeValidator(helloValidate);
View Full Code Here

Examples of org.switchyard.MockHandler.waitForOKMessage()

            msg.setContent(input);
            exchange.send(msg);

            // wait for message and verify transformation
            provider.waitForOKMessage();
            Assert.assertEquals(provider.getMessages().poll().getMessage().getContent(), output);
        } finally {
            // Must remove this transformer, otherwise it's there for the following test... will be
            // fixed once we get rid of the static service domain.
            _domain.getTransformerRegistry().removeTransformer(helloTransform);
View Full Code Here

Examples of org.switchyard.MockHandler.waitForOKMessage()

        MockHandler replyHandler = new MockHandler();
        ServiceReference service = _domain.createInOutService(
                new QName("OutPhase"), new MockHandler().forwardInToOut());
        Exchange exchange = service.createExchange(replyHandler);
        exchange.send(exchange.createMessage());
        replyHandler.waitForOKMessage();
        Assert.assertEquals(ExchangePhase.OUT, exchange.getPhase());
    }
   
    @Test
    public void testPhaseIsOutAfterFaultMessage() {
View Full Code Here

Examples of org.switchyard.test.MockHandler.waitForOKMessage()

        MockHandler handler = new MockHandler();
        Exchange ex = _consumerService.operation(METHOD_NAME).createExchange(handler);
        Message requestMsg = ex.createMessage().setContent(INPUT);
        requestMsg.getContext().setProperty("SomeRequestHeader", "BAR");
        ex.send(requestMsg);
        handler.waitForOKMessage();
        Assert.assertEquals(200, ex.getContext().getProperty(HttpContextMapper.HTTP_RESPONSE_STATUS).getValue());
    }

    @Test
    public void httpFault() throws Exception {
View Full Code Here

Examples of org.switchyard.test.MockHandler.waitForOKMessage()

        InboundHandler<?> handler = createInboundHandler(_serviceName, "direct:input", "input",
                new V1MessageComposerModel(SwitchYardNamespace.DEFAULT.uri()).setClazz(Composer.class.getName()));
        handler.start();

        sendBody("direct:input", PAYLOAD);
        mock.waitForOKMessage();
        List<Exchange> exchanges = new ArrayList<Exchange>();
        mock.getMessages().drainTo(exchanges);
        assertEquals(1, exchanges.size());
        assertEquals(Composer.COMPOSE_PREFIX + PAYLOAD, exchanges.get(0).getMessage().getContent());
View Full Code Here

Examples of org.switchyard.test.MockHandler.waitForOKMessage()

        InboundHandler<?> handler = createInboundHandler(_serviceName, "direct:input", "direct",
                new V1ContextMapperModel(SwitchYardNamespace.DEFAULT.uri()).setClazz(Mapper.class.getName()));
        handler.start();

        sendBody("direct:input", PAYLOAD);
        mock.waitForOKMessage();
        List<Exchange> exchanges = new ArrayList<Exchange>();
        mock.getMessages().drainTo(exchanges);
        assertEquals(1, exchanges.size());
        Exchange exchange = exchanges.get(0);
        Property property = exchange.getContext().getProperty(Mapper.PROPERTY);
View Full Code Here

Examples of org.switchyard.test.MockHandler.waitForOKMessage()

        InboundHandler<?> handler = createInboundHandler(_serviceName, "direct:input", "input",
                new V1StaticOperationSelectorModel(SwitchYardNamespace.DEFAULT.uri()).setOperationName(OPERATION_NAME));
        handler.start();

        sendBody("direct:input", PAYLOAD);
        mock.waitForOKMessage();
        List<Exchange> exchanges = new ArrayList<Exchange>();
        mock.getMessages().drainTo(exchanges);
        assertEquals(1, exchanges.size());
        assertEquals(OPERATION_NAME, exchanges.get(0).getContract().getProviderOperation().getName());
View Full Code Here

Examples of org.switchyard.test.MockHandler.waitForOKMessage()

    public void sendReply() throws Exception {
        MockHandler handler = new MockHandler();
        handler.setWaitTimeout(3000);
        Exchange ex = sendReply.createExchange(handler);
        ex.send(ex.createMessage().setContent(TEST_IN_CONTENT));
        Assert.assertEquals(1, handler.waitForOKMessage().getMessages().size());
        Assert.assertEquals(TEST_OUT_CONTENT,
                handler.getMessages().poll().getMessage().getContent());
    }
   
    @Test
View Full Code Here

Examples of org.switchyard.test.MockHandler.waitForOKMessage()

        handler.setWaitTimeout(3000);
        Exchange ex = attachments.createExchange(handler);
        ex.send(ex.createMessage()
                .setContent(TEST_IN_CONTENT)
                .addAttachment(TEST_IN_ATTACHMENT, new DummyDataSource(TEST_IN_ATTACHMENT)));
        Assert.assertEquals(1, handler.waitForOKMessage().getMessages().size());
        Message reply = handler.getMessages().poll().getMessage();
        DataSource attachOut = reply.getAttachment(TEST_OUT_ATTACHMENT);
        Assert.assertNotNull(attachOut);
        Assert.assertEquals(TEST_OUT_ATTACHMENT, attachOut.getName());
    }
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.