Coverage Report - org.mule.tck.providers.AbstractMessageReceiverTestCase
 
Classes in this File Line Coverage Branch Coverage Complexity
AbstractMessageReceiverTestCase
0%
0/23
0%
0/4
1.5
 
 1  
 /*
 2  
  * $Id: AbstractMessageReceiverTestCase.java 7963 2007-08-21 08:53:15Z dirk.olmes $
 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  
 
 11  
 package org.mule.tck.providers;
 12  
 
 13  
 import org.mule.tck.AbstractMuleTestCase;
 14  
 import org.mule.tck.testmodels.fruit.Orange;
 15  
 import org.mule.umo.UMOComponent;
 16  
 import org.mule.umo.endpoint.UMOEndpoint;
 17  
 import org.mule.umo.endpoint.UMOImmutableEndpoint;
 18  
 import org.mule.umo.provider.UMOMessageReceiver;
 19  
 
 20  0
 public abstract class AbstractMessageReceiverTestCase extends AbstractMuleTestCase
 21  
 {
 22  
     protected UMOComponent component;
 23  
     protected UMOEndpoint endpoint;
 24  
 
 25  
     protected void doSetUp() throws Exception
 26  
     {
 27  0
         component = getTestComponent(getTestDescriptor("orange", Orange.class.getName()));
 28  0
         endpoint = getEndpoint();
 29  0
     }
 30  
 
 31  
     public void testCreate() throws Exception
 32  
     {
 33  0
         UMOComponent component = getTestComponent(getTestDescriptor("orange", Orange.class.getName()));
 34  0
         UMOEndpoint endpoint = getTestEndpoint("Test", UMOImmutableEndpoint.ENDPOINT_TYPE_SENDER);
 35  0
         UMOMessageReceiver receiver = getMessageReceiver();
 36  
 
 37  0
         assertNotNull(receiver.getEndpoint());
 38  0
         assertNotNull(receiver.getConnector());
 39  
 
 40  
         try
 41  
         {
 42  0
             receiver.setEndpoint(null);
 43  0
             fail("Provider cannot be set to null");
 44  
         }
 45  0
         catch (IllegalArgumentException e)
 46  
         {
 47  
             // expected
 48  0
         }
 49  
 
 50  
         try
 51  
         {
 52  0
             receiver.setComponent(null);
 53  0
             fail("component cannot be set to null");
 54  
         }
 55  0
         catch (IllegalArgumentException e)
 56  
         {
 57  
             // expected
 58  0
         }
 59  
 
 60  0
         receiver.setComponent(component);
 61  0
         assertNotNull(receiver.getComponent());
 62  0
         receiver.setEndpoint(endpoint);
 63  0
         assertNotNull(receiver.getEndpoint());
 64  
 
 65  0
         receiver.dispose();
 66  0
     }
 67  
 
 68  
     public abstract UMOMessageReceiver getMessageReceiver() throws Exception;
 69  
 
 70  
     /**
 71  
      * Implementations of this method should ensure that the correct connector is set
 72  
      * on the endpoint
 73  
      * 
 74  
      * @return
 75  
      * @throws Exception
 76  
      */
 77  
     public abstract UMOEndpoint getEndpoint() throws Exception;
 78  
 }