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.transformers.xml.xquery;
8   
9   import org.mule.util.IOUtils;
10  
11  import java.io.InputStream;
12  
13  import org.custommonkey.xmlunit.XMLUnit;
14  
15  public class InlineXQueryTransformerByteArrayTestCase extends InlineXQueryTransformerTestCase
16  {
17      private byte[] srcData;
18      private String resultData;
19  
20      @Override
21      protected void doSetUp() throws Exception
22      {
23          XMLUnit.setIgnoreWhitespace(true);
24          srcData = IOUtils.toByteArray(IOUtils.getResourceAsStream("cdcatalog-utf-8.xml", getClass()));
25          
26          InputStream resourceStream = IOUtils.getResourceAsStream("cdcatalog-result-utf-8.xml", getClass());
27          resultData = new String(IOUtils.toByteArray(resourceStream), "UTF-8");
28      }
29  
30      @Override
31      public Object getTestData()
32      {
33          return srcData;
34      }
35  
36      @Override
37      public Object getResultData()
38      {
39          return resultData;
40      }
41  }