Package org.mule.test.config

Source Code of org.mule.test.config.ExceptionStrategyConfigTestCase

/*
* $Id: ExceptionStrategyConfigTestCase.java 21903 2011-05-13 19:40:30Z tcarlson $
* --------------------------------------------------------------------------------------
* Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
*
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/

package org.mule.test.config;

import org.mule.api.service.Service;
import org.mule.exception.DefaultMessagingExceptionStrategy;
import org.mule.tck.FunctionalTestCase;

public class ExceptionStrategyConfigTestCase extends FunctionalTestCase
{
    protected String getConfigResources()
    {
        return "org/mule/test/exceptions/exception-strategy-config.xml";
    }

    public void testConfig() throws Exception
    {
        Service service = muleContext.getRegistry().lookupService("testService1");
        assertNotNull(service);
        assertNotNull(service.getExceptionListener());
        assertTrue(service.getExceptionListener() instanceof DefaultMessagingExceptionStrategy);

        DefaultMessagingExceptionStrategy es = (DefaultMessagingExceptionStrategy)service.getExceptionListener();
        assertFalse(es.isEnableNotifications());
        assertNotNull(es.getCommitTxFilter());
        assertEquals("java.io.*", es.getCommitTxFilter().getPattern());

        assertNotNull(es.getRollbackTxFilter());
        assertEquals("org.mule.*, javax.*", es.getRollbackTxFilter().getPattern());

    }
}
TOP

Related Classes of org.mule.test.config.ExceptionStrategyConfigTestCase

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.