Examples of waitForFaultMessage()


Examples of org.switchyard.MockHandler.waitForFaultMessage()

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

Examples of org.switchyard.MockHandler.waitForFaultMessage()

        msg.setContent(input);

        exchange.send(msg);

        invokerHandler.waitForFaultMessage();
        Object content = invokerHandler.getFaults().poll().getMessage().getContent();
        Assert.assertTrue(content instanceof HandlerException);
       
        boolean failed = ((HandlerException)content).getMessage().contains("Validator 'org.switchyard.tests.ValidationTest$2' failed: validation fail test");
        Assert.assertTrue(failed);
View Full Code Here

Examples of org.switchyard.MockHandler.waitForFaultMessage()

        ServiceReference ref = registerInOnlyService("inOut", new ErrorExchangeHandler());
        MockHandler consumer = new MockHandler();
        Exchange exchange = ref.createExchange(consumer);
        exchange.send(exchange.createMessage().setContent("test"));
       
        Assert.assertEquals(1, consumer.waitForFaultMessage().getFaults().size());
    }

    /**
     * Basic dispatcher test which verifies erroneous interceptor.
     */
 
View Full Code Here

Examples of org.switchyard.MockHandler.waitForFaultMessage()

        msg.setContent(input);

        exchange.send(msg);

        invokerHandler.waitForFaultMessage();
        Object content = invokerHandler.getFaults().poll().getMessage().getContent();
        Assert.assertTrue(content instanceof HandlerException);
        String testString = "Transformations not applied.  Required payload type of 'toB'.  Actual payload type is 'fromA'.  You must define and register a Transformer to transform between these types.";
        boolean transformsApplied = ((HandlerException)content).getMessage().contains(testString);
        Assert.assertTrue(transformsApplied);
View Full Code Here

Examples of org.switchyard.MockHandler.waitForFaultMessage()

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

Examples of org.switchyard.MockHandler.waitForFaultMessage()

        Exchange exchange = service.createExchange(consumer);
        exchange.send(exchange.createMessage());

        // wait, since this is async
        provider.waitForOKMessage();
        consumer.waitForFaultMessage();

        // Now try send another message on the Exchange... should result in an IllegalStateException...
        try {
            exchange.send(exchange.createMessage());
        } catch(IllegalStateException e) {
View Full Code Here

Examples of org.switchyard.MockHandler.waitForFaultMessage()

        MockDomain domain = new MockDomain();
        ServiceReference reference = domain.createInOnlyService(new QName("bar"));
        Dispatcher dispatch = domain.getBus().createDispatcher(reference);
        Exchange ex = new ExchangeImpl(domain, dispatch).consumer(reference, new InOnlyOperation("foo"));
        _chain.handleFault(ex);
        Assert.assertNotNull(goodHandler.waitForFaultMessage());
    }
   
    @Test
    public void testReplace() {
        MockHandler m1 = new MockHandler();
View Full Code Here

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

    public void authenticationMissing() throws Exception {
        MockHandler handler = new MockHandler();
        Exchange ex = _proxyConsumerService2.operation(METHOD_NAME).createExchange(handler);
        Message requestMsg = ex.createMessage().setContent(INPUT);
        ex.send(requestMsg);
        handler.waitForFaultMessage();
        String response = ex.getMessage().getContent(String.class);
        Assert.assertTrue(response.contains("407 Proxy Authentication Required"));
    }

    @Test
View Full Code Here

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

    public void httpFault() throws Exception {
        MockHandler handler = new MockHandler();
        Exchange ex = _consumerService2.operation(METHOD_NAME).createExchange(handler);
        Message requestMsg = ex.createMessage().setContent(INPUT);
        ex.send(requestMsg);
        handler.waitForFaultMessage();
        Assert.assertEquals(404, ex.getContext().getProperty(HttpContextMapper.HTTP_RESPONSE_STATUS).getValue());
    }

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

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

        MockHandler handler = new MockHandler();
        Exchange ex = _consumerService11.operation("sayHello").createExchange(handler);

        Message requestMsg = ex.createMessage().setContent(input);
        ex.send(requestMsg);
        handler.waitForFaultMessage();
        Exchange exchange = handler.getFaults().iterator().next();
        Property faultInfoProperty = exchange.getContext().getProperty(SOAPComposition.SOAP_FAULT_INFO);
        Assert.assertNotNull(faultInfoProperty);
        Assert.assertEquals(faultStr, faultInfoProperty.getValue().toString());
    }
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.