View Javadoc
1   /*
2    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
3    * The software in this package is published under the terms of the CPAL v1.0
4    * license, a copy of which has been included with this distribution in the
5    * LICENSE.txt file.
6    */
7   package org.mule.test.integration.xml;
8   
9   import org.mule.DefaultMuleMessage;
10  import org.mule.api.MuleMessage;
11  import org.mule.module.client.MuleClient;
12  import org.mule.tck.junit4.FunctionalTestCase;
13  
14  import java.io.InputStream;
15  
16  import org.junit.Test;
17  import org.w3c.dom.Document;
18  
19  import static org.junit.Assert.assertNotNull;
20  import static org.junit.Assert.assertTrue;
21  
22  public class JaxenFilterTestCase extends FunctionalTestCase
23  {
24  
25      @Override
26      protected String getConfigResources()
27      {
28          return "org/mule/test/integration/xml/jaxen-routing-conf.xml";
29      }
30  
31      @Test
32      public void testJaxen() throws Exception
33      {
34          MuleClient client = new MuleClient(muleContext);
35          InputStream po = getClass().getResourceAsStream("/org/mule/test/integration/xml/purchase-order.xml");
36  
37          assertNotNull(po);
38  
39          MuleMessage msg = new DefaultMuleMessage(po, muleContext);
40          MuleMessage res = client.send("vm://in", msg);
41  
42          Object payload = res.getPayload();
43          assertTrue("payload is of type " + payload.getClass(), payload instanceof Document);
44      }
45  
46  }
47  
48