View Javadoc

1   /*
2    * $Id: AbstractEndpointTestCase.java 22414 2011-07-14 13:24:46Z 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.config.spring.parsers.endpoint;
12  
13  import org.mule.api.MuleException;
14  import org.mule.api.endpoint.EndpointURI;
15  import org.mule.api.endpoint.ImmutableEndpoint;
16  import org.mule.tck.junit4.FunctionalTestCase;
17  
18  import static org.junit.Assert.assertEquals;
19  import static org.junit.Assert.assertNotNull;
20  
21  public abstract class AbstractEndpointTestCase extends FunctionalTestCase
22  {
23  
24      public ImmutableEndpoint doTest(String name) throws MuleException
25      {
26          ImmutableEndpoint endpoint = muleContext.getEndpointFactory().getInboundEndpoint(name);
27          assertNotNull(endpoint);
28          EndpointURI uri = endpoint.getEndpointURI();
29          assertNotNull(uri);
30          assertEquals("foo", uri.getAddress());
31          assertEquals("test", uri.getScheme());
32          return endpoint;
33      }
34  
35  }