Package org.mule.tck.testmodels.mule

Examples of org.mule.tck.testmodels.mule.TestExceptionStrategy


        }
        latch = new Latch();
        systemExceptionCounter.set(0);
        serviceExceptionCounter.set(0);

        TestExceptionStrategy systemExceptionListener = new TestExceptionStrategy();
        systemExceptionListener.setExceptionCallback(new ExceptionCallback()
        {
            public void onException(Throwable t)
            {
                systemExceptionCounter.incrementAndGet();
                latch.countDown();
            }
        });
        muleContext.setExceptionListener(systemExceptionListener);

        TestExceptionStrategy serviceExceptionListener =
            (TestExceptionStrategy) muleContext.getRegistry().lookupModel("TestModel").getExceptionListener();
        serviceExceptionListener.setExceptionCallback(new ExceptionCallback()
        {
            public void onException(Throwable t)
            {
                serviceExceptionCounter.incrementAndGet();
                latch.countDown();
View Full Code Here


     *
     * @throws Exception
     */
    public void testUsesTransformersCorrectly() throws Exception
    {
        TestExceptionStrategy exceptionStrategy = new TestExceptionStrategy();
        muleContext.setExceptionListener(exceptionStrategy);

        MuleClient client = new MuleClient(muleContext);
        MuleMessage result = client.send("http://localhost:28181/ScratchCardServiceV1", msg, null);
        assertNotNull("The result shouln't have been null", result);
        final String payloadAsString = result.getPayloadAsString();
        assertNotNull("The payloadAsString shouln't have been null", payloadAsString);
        assertFalse("There shouldn't be a fault in the payload: " + payloadAsString,
            payloadAsString.contains("<soap:Fault>"));

        final Latch latch = new Latch();
        exceptionStrategy.setExceptionCallback(new ExceptionCallback()
        {
            public void onException(Throwable t)
            {
                connectorExceptionCounter.incrementAndGet();
                latch.countDown();
View Full Code Here

    @Before
    @Override
    protected void doSetUp() throws Exception
    {
        super.doSetUp();
        muleContext.setExceptionListener(new TestExceptionStrategy());
    }
View Full Code Here

                                                            // exception doesn't
                                                            // happen more than once
                exceptionLatch.countDown();
            }
        };
        TestExceptionStrategy exceptionStrategy = (TestExceptionStrategy) muleContext.getRegistry()
            .lookupService(serviceName)
            .getExceptionListener();
        exceptionStrategy.setExceptionCallback(exceptionCallback);

        TestExceptionStrategy globalExceptionStrategy = (TestExceptionStrategy) muleContext.getExceptionListener();
        globalExceptionStrategy.setExceptionCallback(exceptionCallback);

        assertTrue(exceptionLatch.await(10, TimeUnit.SECONDS));
        receive(scenarioNotReceive);
    }
View Full Code Here

    }

    @Test
    public void startingSslMessageReceiverWithoutKeystoreShouldThrowConnectException() throws Exception
    {
        TestExceptionStrategy exceptionListener = new TestExceptionStrategy();
        exceptionListener.setExceptionCallback(this);

        muleContext.setExceptionListener(exceptionListener);
        muleContext.start();

        assertNotNull(exceptionFromSystemExceptionHandler);
View Full Code Here

    @Override
    protected void doSetUp() throws Exception
    {
        super.doSetUp();
        muleContext.setExceptionListener(new TestExceptionStrategy());
    }
View Full Code Here

                                                            // exception doesn't
                                                            // happen more than once
                exceptionLatch.countDown();
            }
        };
        TestExceptionStrategy exceptionStrategy = (TestExceptionStrategy) muleContext.getRegistry()
            .lookupService(serviceName)
            .getExceptionListener();
        exceptionStrategy.setExceptionCallback(exceptionCallback);

        TestExceptionStrategy globalExceptionStrategy = (TestExceptionStrategy) muleContext.getExceptionListener();
        globalExceptionStrategy.setExceptionCallback(exceptionCallback);

        assertTrue(exceptionLatch.await(10, TimeUnit.SECONDS));
        receive(scenarioNotReceive);
    }
View Full Code Here

     * @throws Exception
     */
    @Test
    public void testUsesTransformersCorrectly() throws Exception
    {
        TestExceptionStrategy exceptionStrategy = new TestExceptionStrategy();
        muleContext.setExceptionListener(exceptionStrategy);

        MuleClient client = muleContext.getClient();
        MuleMessage result = client.send("http://localhost:28181/ScratchCardServiceV1", msg, null);
        assertNotNull("The result shouln't have been null", result);
        final String payloadAsString = result.getPayloadAsString();
        assertNotNull("The payloadAsString shouln't have been null", payloadAsString);
        assertFalse("There shouldn't be a fault in the payload: " + payloadAsString,
            payloadAsString.contains("<soap:Fault>"));

        final Latch latch = new Latch();
        exceptionStrategy.setExceptionCallback(new ExceptionCallback()
        {
            @Override
            public void onException(Throwable t)
            {
                connectorExceptionCounter.incrementAndGet();
View Full Code Here

        }
        latch = new Latch();
        systemExceptionCounter.set(0);
        serviceExceptionCounter.set(0);

        TestExceptionStrategy systemExceptionListener = new TestExceptionStrategy();
        systemExceptionListener.setExceptionCallback(new ExceptionCallback()
        {
            public void onException(Throwable t)
            {
                systemExceptionCounter.incrementAndGet();
                latch.countDown();
            }
        });
        muleContext.setExceptionListener(systemExceptionListener);

        TestExceptionStrategy serviceExceptionListener =
            (TestExceptionStrategy) muleContext.getRegistry().lookupModel("TestModel").getExceptionListener();
        serviceExceptionListener.setExceptionCallback(new ExceptionCallback()
        {
            public void onException(Throwable t)
            {
                serviceExceptionCounter.incrementAndGet();
                latch.countDown();
View Full Code Here

    }

    @Test
    public void startingSslMessageReceiverWithoutKeystoreShouldThrowConnectException() throws Exception
    {
        TestExceptionStrategy exceptionListener = new TestExceptionStrategy();
        exceptionListener.setExceptionCallback(this);

        muleContext.setExceptionListener(exceptionListener);
        muleContext.start();

        assertNotNull(exceptionFromSystemExceptionHandler);
View Full Code Here

TOP

Related Classes of org.mule.tck.testmodels.mule.TestExceptionStrategy

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.