org.activemath.omdocjdom.tests
Class OJTestUtils

java.lang.Object
  extended by org.activemath.omdocjdom.tests.OJTestUtils

public class OJTestUtils
extends Object

A handful of methods for use in general OMDocJDom-based tests.


Constructor Summary
OJTestUtils()
           
 
Method Summary
static File getFile(Class clazz, String resourceName)
          Creates a temporary file with exactly the content of the indicated resource name (supposed to be reached as a stream from the class-loader aside of this class.
static File getFile(String resourceName)
           
static void unspoolFile(InputStream in, File fOut)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OJTestUtils

public OJTestUtils()
Method Detail

getFile

public static File getFile(Class clazz,
                           String resourceName)
                    throws IOException
Creates a temporary file with exactly the content of the indicated resource name (supposed to be reached as a stream from the class-loader aside of this class. The file name requested ends with the resource name (providing thus The file is requested to be deleted on clean-exit.

Parameters:
resourceName - The name of the resource ot be fetched with Class.getResourceAsStream(java.lang.String)
Returns:
The temporary File object created by copying the resource
Throws:
IOException - In case anything goes wrong, e.g. the resource was not found or the temporary file could not be written to.

getFile

public static File getFile(String resourceName)
                    throws IOException
Throws:
IOException

unspoolFile

public static void unspoolFile(InputStream in,
                               File fOut)
                        throws IOException
Throws:
IOException