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.module.xml.functional;
8   
9   import org.mule.tck.junit4.FunctionalTestCase;
10  
11  import java.io.IOException;
12  import java.io.InputStream;
13  
14  import org.apache.commons.io.IOUtils;
15  
16  import static org.junit.Assert.assertNotNull;
17  
18  public abstract class AbstractXmlFunctionalTestCase extends FunctionalTestCase
19  {
20  
21      public static final long TIMEOUT = 5000L;
22  
23      protected String getConfigAsString() throws IOException
24      {
25          return getResourceAsString(getConfigResources());
26      }
27  
28      protected String getResourceAsString(String resource) throws IOException
29      {
30          InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
31          assertNotNull(resource, is);
32          return IOUtils.toString(is);
33      }
34  
35  }