1   /*
2    * $Id: ExceptionStrategyConfigTestCase.java 11468 2008-03-21 17:54:46Z rossmason $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  package org.mule.test.integration.exceptions;
11  
12  import org.mule.api.service.Service;
13  import org.mule.service.DefaultServiceExceptionStrategy;
14  import org.mule.tck.FunctionalTestCase;
15  
16  public class ExceptionStrategyConfigTestCase extends FunctionalTestCase
17  {
18      protected String getConfigResources()
19      {
20          return "org/mule/test/integration/exceptions/exception-strategy-config.xml";
21      }
22  
23      public void testConfig() throws Exception
24      {
25          Service service = muleContext.getRegistry().lookupService("testService1");
26          assertNotNull(service);
27          assertNotNull(service.getExceptionListener());
28          assertTrue(service.getExceptionListener() instanceof DefaultServiceExceptionStrategy);
29  
30          DefaultServiceExceptionStrategy es = (DefaultServiceExceptionStrategy)service.getExceptionListener();
31          assertFalse(es.isEnableNotifications());
32          assertNotNull(es.getCommitTxFilter());
33          assertEquals("java.io.*", es.getCommitTxFilter().getPattern());
34  
35          assertNotNull(es.getRollbackTxFilter());
36          assertEquals("org.mule.*, javax.*", es.getRollbackTxFilter().getPattern());
37  
38      }
39  }