View Javadoc

1   /*
2    * $Id: OutboundEndpointPropertyMessageProcessorTestCase.java 20320 2010-11-24 15:03:31Z dfeist $
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.endpoint.outbound;
12  
13  import org.mule.RequestContext;
14  import org.mule.api.MuleEvent;
15  import org.mule.api.config.MuleProperties;
16  import org.mule.api.endpoint.EndpointException;
17  import org.mule.api.endpoint.OutboundEndpoint;
18  import org.mule.api.lifecycle.InitialisationException;
19  import org.mule.api.processor.MessageProcessor;
20  import org.mule.endpoint.AbstractMessageProcessorTestCase;
21  
22  public class OutboundEndpointPropertyMessageProcessorTestCase extends AbstractMessageProcessorTestCase
23  {
24  
25      public void testProcess() throws InitialisationException, EndpointException, Exception
26      {
27          MessageProcessor mp = new OutboundEndpointPropertyMessageProcessor();
28          OutboundEndpoint endpoint = createTestOutboundEndpoint(null, null);
29  
30          MuleEvent event = mp.process(createTestOutboundEvent(endpoint));
31  
32          assertEquals(endpoint.getEndpointURI().getUri().toString(),
33                       event.getMessage().getOutboundProperty(MuleProperties.MULE_ENDPOINT_PROPERTY));
34          assertSame(event, RequestContext.getEvent());
35      }
36  
37  }