View Javadoc

1   /*
2    * $Id: AbstractXmlFunctionalTestCase.java 22421 2011-07-15 05:05:06Z 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.module.xml.functional;
12  
13  
14  import org.mule.tck.AbstractServiceAndFlowTestCase;
15  
16  import java.io.IOException;
17  import java.io.InputStream;
18  
19  import org.apache.commons.io.IOUtils;
20  
21  import static org.junit.Assert.assertNotNull;
22  
23  public abstract class AbstractXmlFunctionalTestCase extends AbstractServiceAndFlowTestCase
24  {
25      public AbstractXmlFunctionalTestCase(ConfigVariant variant,
26  			String configResources) {
27  		super(variant, configResources);
28  	}
29  
30  	public static final long TIMEOUT = 3000L;
31  
32      protected String getConfigAsString() throws IOException
33      {
34          return getResourceAsString(getConfigResources());
35      }
36  
37      protected String getResourceAsString(String resource) throws IOException
38      {
39          InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
40          assertNotNull(resource, is);
41          return IOUtils.toString(is);
42      }
43  }