# Class TestUtil

java.lang.Object
htsjdk.samtools.util.TestUtil

public class TestUtil extends Object

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`BASE_URL_FOR_HTTP_TESTS`
Base url where all test files for http tests are found
`static final int`
`RANDOM_SEED`

## Constructor Summary

Constructors
Constructor
Description
`TestUtil()`

## Method Summary

Modifier and Type
Method
Description
`static File`
`getTempDirecory(String prefix, String suffix)`
Deprecated.
Use properly spelled method.
`static File`
`getTempDirectory(String prefix, String suffix)`
`static void`
`recursiveDelete(File directory)`
Deprecated.
Since 3/19, prefer `IOUtil.recursiveDelete(Path)`
`static <T extends Serializable>
T`
`serializeAndDeserialize(T input)`
Serialize and Deserialize an object Useful for testing if serialization is correctly handled for a class.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### RANDOM_SEED

public static final int RANDOM_SEED

See Also:
  - Constant Field Values

### BASE_URL_FOR_HTTP_TESTS

public static final String BASE_URL_FOR_HTTP_TESTS
Base url where all test files for http tests are found

See Also:
  - Constant Field Values

## Constructor Details

### TestUtil

public TestUtil()

## Method Details

### getTempDirectory

public static File getTempDirectory(String prefix, String suffix)

### getTempDirecory

@Deprecated public static File getTempDirecory(String prefix, String suffix)
Deprecated.
Use properly spelled method. `getTempDirectory(String, String)`

### serializeAndDeserialize

public static <T extends Serializable> T serializeAndDeserialize(T input) throws IOException, ClassNotFoundException
Serialize and Deserialize an object Useful for testing if serialization is correctly handled for a class.

Type Parameters:
  `T` - any Serializable type
Parameters:
  `input` - an object to serialize and then deserialize
Returns:
  a copy of the initial object
Throws:
  `IOException`
  `ClassNotFoundException`

### recursiveDelete

@Deprecated public static void recursiveDelete(File directory)
Deprecated.
Since 3/19, prefer `IOUtil.recursiveDelete(Path)`
Little test utility to help tests that create multiple levels of subdirectories clean up after themselves.

Parameters:
  `directory` - The directory to be deleted (along with its subdirectories)