org.eclipse.ease.lang.unittest

## Class UnitTestHelper

- java.lang.Object
- - org.eclipse.ease.lang.unittest.UnitTestHelper

    public class UnitTestHelper
    extends java.lang.Object

### Constructor Summary

Constructors
Constructor and Description
`UnitTestHelper()`

### Method Summary

All Methods Static Methods Concrete Methods
`static ITestSuite` `createRuntimeSuite(ITestSuiteDefinition definition)` Create a runtime representation of a given test suite definition.
`static java.util.List<ITestEntity>` `createTestStructure(java.util.Map<java.lang.Object,java.lang.String> acceptedFiles)` Creates a test structure for a given set of test files.
`static void` `createWorkspaceMarker(ITestResult result, TestEntity testEntity)` Create error markers in the workspace.
`static java.util.Collection<ITestFile>` `getTestFiles(ITestContainer testContainer)`
`static java.util.Map<java.lang.Object,java.lang.String>` `getTestFilesFromFilter(java.lang.String[] filters, java.lang.Object suite)` Find all matching files for given filters.
`static ITestSuiteDefinition` `loadTestSuite(java.io.InputStream stream)`
`static void` `removeErrorMarkers(IFile file)` Remove all test assertion error markers from a given resource.
`static byte[]` `serializeTestSuite(ITestSuiteDefinition testSuiteDefinition)` Serialize a testsuite definition to a byte array.

### Methods inherited from class java.lang.Object

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

### Constructor Detail

#### UnitTestHelper

    public UnitTestHelper()

### Method Detail

#### createWorkspaceMarker

    public static void createWorkspaceMarker(ITestResult result,
                                             TestEntity testEntity)

Create error markers in the workspace.

Parameters:
  `result` - result to create markers for
  `testEntity` -

#### removeErrorMarkers

    public static void removeErrorMarkers(IFile file)

Remove all test assertion error markers from a given resource.

Parameters:
  `file` - resource to remove markers from

#### getTestFilesFromFilter

    public static java.util.Map<java.lang.Object,java.lang.String> getTestFilesFromFilter(java.lang.String[] filters,
                                                                                          java.lang.Object suite)

Find all matching files for given filters. Filter strings are paths and URIs that may contain wildcards using ANT style. Therefore '*' denotes a folder, while '**' denotes a folder hierarchy.

Parameters:
  `filters` - filters to search files for
  `suite` - testsuite resource for relative filters
Returns:
  Map of `File`/IFile instances. The value contains the filter expression that lead to the match.

#### createTestStructure

    public static java.util.List<ITestEntity> createTestStructure(java.util.Map<java.lang.Object,java.lang.String> acceptedFiles)

Creates a test structure for a given set of test files. Automatically creates folders to match the file structure the files are located in.

Parameters:
  `acceptedFiles` - map of accepted files
Returns:
  root elements of the created file structure.

#### loadTestSuite

    public static ITestSuiteDefinition loadTestSuite(java.io.InputStream stream)
                                              throws java.io.IOException

Throws:
  `java.io.IOException`

#### serializeTestSuite

    public static byte[] serializeTestSuite(ITestSuiteDefinition testSuiteDefinition)
                                     throws java.io.IOException

Serialize a testsuite definition to a byte array.

Parameters:
  `testSuiteDefinition` - test suite definition to serialize
Returns:
  xml representation of definition
Throws:
  `java.io.IOException` - not expected as ByteArrayOutputStream does not throw

#### createRuntimeSuite

    public static ITestSuite createRuntimeSuite(ITestSuiteDefinition definition)

Create a runtime representation of a given test suite definition.

Parameters:
  `definition` - definition to create runtime information from
Returns:
  runtime information root element

#### getTestFiles

    public static java.util.Collection<ITestFile> getTestFiles(ITestContainer testContainer)