View Javadoc

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