View Javadoc

1   /*
2    * $Id: AbstractXmlFunctionalTestCase.java 20321 2010-11-24 15:21:24Z dfeist $
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.module.xml.functional;
12  
13  import org.mule.tck.FunctionalTestCase;
14  
15  import java.io.IOException;
16  import java.io.InputStream;
17  
18  import org.apache.commons.io.IOUtils;
19  
20  public abstract class AbstractXmlFunctionalTestCase extends FunctionalTestCase
21  {
22  
23      public static final long TIMEOUT = 3000L;
24  
25      protected String getConfigAsString() throws IOException
26      {
27          return getResourceAsString(getConfigResources());
28      }
29  
30      protected String getResourceAsString(String resource) throws IOException
31      {
32          InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
33          assertNotNull(resource, is);
34          return IOUtils.toString(is);
35      }
36  
37  }