Package org.eclipse.ease.lang.unittest
Class UnitTestHelper
java.lang.Object
org.eclipse.ease.lang.unittest.UnitTestHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic ITestSuite
createRuntimeSuite
(ITestSuiteDefinition definition) Create a runtime representation of a given test suite definition.static List<ITestEntity>
createTestStructure
(Map<Object, 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 Collection<ITestFile>
getTestFiles
(ITestContainer testContainer) getTestFilesFromFilter
(String[] filters, Object suite) Find all matching files for given filters.static ITestSuiteDefinition
loadTestSuite
(InputStream stream) static void
removeErrorMarkers
(org.eclipse.core.resources.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.
-
Method Details
-
createWorkspaceMarker
Create error markers in the workspace.- Parameters:
result
- result to create markers fortestEntity
-
-
removeErrorMarkers
public static void removeErrorMarkers(org.eclipse.core.resources.IFile file) Remove all test assertion error markers from a given resource.- Parameters:
file
- resource to remove markers from
-
getTestFilesFromFilter
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 forsuite
- testsuite resource for relative filters- Returns:
- Map of
File
/IFile instances. The value contains the filter expression that lead to the match.
-
createTestStructure
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
- Throws:
IOException
-
serializeTestSuite
public static byte[] serializeTestSuite(ITestSuiteDefinition testSuiteDefinition) throws IOException Serialize a testsuite definition to a byte array.- Parameters:
testSuiteDefinition
- test suite definition to serialize- Returns:
- xml representation of definition
- Throws:
IOException
- not expected as ByteArrayOutputStream does not throw
-
createRuntimeSuite
Create a runtime representation of a given test suite definition.- Parameters:
definition
- definition to create runtime information from- Returns:
- runtime information root element
-
getTestFiles
-