View Javadoc

1   /*
2    * $Id: ExceptionNotificationTestCase.java 22421 2011-07-15 05:05:06Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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  
11  package org.mule.context.notification;
12  
13  import org.mule.module.client.MuleClient;
14  
15  import java.util.Arrays;
16  import java.util.Collection;
17  
18  import org.junit.runners.Parameterized.Parameters;
19  
20  import static org.junit.Assert.assertNotNull;
21  
22  public class ExceptionNotificationTestCase extends AbstractNotificationTestCase
23  {
24      @Parameters
25      public static Collection<Object[]> parameters()
26      {
27          return Arrays.asList(new Object[][]{
28              {ConfigVariant.SERVICE, "org/mule/test/integration/notifications/exception-notification-test-service.xml"},
29              {ConfigVariant.FLOW, "org/mule/test/integration/notifications/exception-notification-test-flow.xml"}
30          });
31      }
32  
33      public ExceptionNotificationTestCase(ConfigVariant variant, String configResources)
34      {
35          super(variant, configResources);
36      }
37  
38      @Override
39      public void doTest() throws Exception
40      {
41          MuleClient client = new MuleClient(muleContext);
42          assertNotNull(client.send("vm://in-1", "hello world", null));
43      }
44  
45      @Override
46      public RestrictedNode getSpecification()
47      {
48          return new Node(ExceptionNotification.class, ExceptionNotification.EXCEPTION_ACTION);
49      }
50  
51      @Override
52      public void validateSpecification(RestrictedNode spec) throws Exception
53      {
54          verifyAllNotifications(spec, ExceptionNotification.class,
55                  ExceptionNotification.EXCEPTION_ACTION, ExceptionNotification.EXCEPTION_ACTION);
56      }
57  }