1   /*
2    * $Id: FeaturesTestCase.java 10494 2008-01-23 21:09:56Z acooke $
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.transport.cxf;
12  
13  import org.mule.tck.FunctionalTestCase;
14  import org.mule.api.endpoint.ImmutableEndpoint;
15  
16  import java.util.Map;
17  import java.util.List;
18  
19  import org.apache.cxf.feature.LoggingFeature;
20  
21  public class FeaturesTestCase extends FunctionalTestCase
22  {
23  
24      protected String getConfigResources()
25      {
26          return "features-test.xml";
27      }
28  
29      public void testFeatures() throws Exception
30      {
31          ImmutableEndpoint endpoint = muleContext.getRegistry().lookupEndpointBuilder("endpoint").buildInboundEndpoint();
32          assertNotNull(endpoint);
33          Map properties = endpoint.getProperties();
34          assertNotNull(properties);
35          assertEquals(1, properties.size());
36          assertNotNull(properties.get("features"));
37          assertTrue(properties.get("features") instanceof List);
38          List features = (List) properties.get("features");
39          assertEquals(2, features.size());
40          assertTrue(features.get(0) instanceof LoggingFeature);
41      }
42  
43  }