Class UnitTestHelper

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

public class UnitTestHelper
extends Object
  • Constructor Details

    • UnitTestHelper

      public UnitTestHelper()
  • Method Details

    • 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​(org.eclipse.core.resources.IFile file)
      Remove all test assertion error markers from a given resource.
      Parameters:
      file - resource to remove markers from
    • getTestFilesFromFilter

      public static Map<Object,​String> getTestFilesFromFilter​(String[] filters, 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 List<ITestEntity> createTestStructure​(Map<Object,​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​(InputStream stream) throws IOException
      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

      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 Collection<ITestFile> getTestFiles​(ITestContainer testContainer)