com.corticon.eclipse.studio.junit.core

## Interface IJUnitTestAPI

-     public interface IJUnitTestAPI

  JUnit test API allows client programs to easily build JUnit test cases to test Ruletest assets.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `displayMismatchedTestNodes(int aiTestsheetIndex, boolean abExpected)` Send a report of mismatched TestNodes to the system output stream.
    `void` | `displayRuleMessages(int aiTestsheetIndex)` Display Rule Messages associated with the specified Testsheet.
    `void` | `displayValidationMessageKeys()` Send all validation message keys associated with the loaded Ruletest asset to the system output stream.
    `void` | `displayValidationMessageKeys(int aiTestsheetIndex)` Send validation message keys associated with specified Testsheet to the system output stream.
    `void` | `displayValidationMessages()` Send all validation messages associated with the loaded Ruletest asset to the system output stream.
    `void` | `displayValidationMessages(int aiTestsheetIndex)` Send validation messages associated with specified Testsheet to the system output stream.
    `void` | `dispose()` Dispose of this API to free up memory.
    `java.lang.String` | `formatTestNodeString(com.corticon.rulesemf.viewtestmodel.testsheet.treeset.TestNode aTestNode, boolean abIncludeIssues)` Return a string representation of the specified TestNode.
    `java.util.List<com.corticon.rulesemf.viewtestmodel.testsheet.treeset.TestNode>` | `getMismatchedTestNodes(int aiTestsheetIndex, boolean abExpected)` Return a list consisting of TestNode instances that are implicated in mismatches between Output and Expected trees.
    `java.util.List<java.lang.String>` | `getRuleMessages(int aiTestsheetIndex)` Return a list of localized Rule Messages from the specified Testsheet.
    `IRuletestTabFolderModelAPI` | `getRuletestTabFolderModelAPI()` Return a reference to the Ruletest Tab Folder API.
    `int` | `getTestsheetCount()` Return the count of the number of Testsheets in the loaded Ruletest asset.
    `int` | `getTestsheetIndex(java.lang.String astrTestsheetName)` Return the index of the Testsheet bearing the specified name
    `java.lang.String` | `getTestsheetName(int aiTestsheetIndex)` Return the name of the Testsheet identified by the specified index.
    `ITestsheetTreeSetModelAPI` | `getTestsheetTreeSetModelAPI()` Return a reference to the Testsheet Tree Set API.
    `java.util.List<java.lang.String>` | `getValidationMessageKeys()` Return a list of all validation message keys in the Ruletest asset.
    `java.util.List<java.lang.String>` | `getValidationMessageKeys(int aiTestsheetIndex)` Return the list of validation message keys associated with the specified Testsheet.
    `java.util.List<java.lang.String>` | `getValidationMessages()` Return a list of all validation messages in the Ruletest asset.
    `java.util.List<java.lang.String>` | `getValidationMessages(int aiTestsheetIndex)` Return the list of validation messages associated with the specified Testsheet.
    `boolean` | `isMismatch()` Determine whether there is a mismatch between the Output Tree and Expected Tree.
    `boolean` | `isMismatch(int aiTestsheetIndex)` Determine whether there is a mismatch between the Output Tree and Expected Tree.
    `boolean` | `isValidationMessagePresent(int aiTestsheetIndex, java.lang.String astrMessageKey)` Determine whether the specified validation message exists in the specified Testsheet.
    `boolean` | `isValidationMessagePresent(java.lang.String astrMessageKey)` Determine whether the specified validation message exists in the entire Ruletest asset.
    `org.eclipse.emf.ecore.resource.Resource` | `loadRuletest(org.eclipse.emf.common.util.URI aURIRuletest)` Load the specified Ruletest asset for testing.
    `boolean` | `runAllTests()` Run all Testsheets.
    `boolean` | `runTest(int aiTestsheetIndex)` Run the specified Testsheet.

- - ### Method Detail

    - #### displayMismatchedTestNodes

          void displayMismatchedTestNodes(int aiTestsheetIndex,
                                        boolean abExpected)

      Send a report of mismatched TestNodes to the system output stream.
      Parameters:
        `aiTestsheetIndex` - Zero-based index of Testsheet.

    - #### displayRuleMessages

          void displayRuleMessages(int aiTestsheetIndex)

      Display Rule Messages associated with the specified Testsheet.
      Parameters:
        `aiTestsheetIndex` - Zero-based index of Testsheet.

    - #### displayValidationMessageKeys

          void displayValidationMessageKeys()

      Send all validation message keys associated with the loaded Ruletest asset to the system output stream.

    - #### displayValidationMessageKeys

          void displayValidationMessageKeys(int aiTestsheetIndex)

      Send validation message keys associated with specified Testsheet to the system output stream.
      Parameters:
        `aiTestsheetIndex` - Zero-based index of Testsheet.

    - #### displayValidationMessages

          void displayValidationMessages()

      Send all validation messages associated with the loaded Ruletest asset to the system output stream.

    - #### displayValidationMessages

          void displayValidationMessages(int aiTestsheetIndex)

      Send validation messages associated with specified Testsheet to the system output stream.
      Parameters:
        `aiTestsheetIndex` - Zero-based index of Testsheet.

    - #### dispose

          void dispose()

      Dispose of this API to free up memory.

    - #### formatTestNodeString

          java.lang.String formatTestNodeString(com.corticon.rulesemf.viewtestmodel.testsheet.treeset.TestNode aTestNode,
                                              boolean abIncludeIssues)

      Return a string representation of the specified TestNode. The string includes a fully-qualified path to the TestNode from the test tree root and may include any mismatch issues associated with the node.
      Parameters:
        `aTestNode` - TestNode instance.
        `abIncludeIssues` - `true` to include mismatch issues.
      Returns:
        TestNode string suitable for reporting.

    - #### getMismatchedTestNodes

          java.util.List<com.corticon.rulesemf.viewtestmodel.testsheet.treeset.TestNode> getMismatchedTestNodes(int aiTestsheetIndex,
                                                                                                              boolean abExpected)

      Return a list consisting of TestNode instances that are implicated in mismatches between Output and Expected trees. This method can return nodes from either the Output or Expected based on parameter abExpected.

      Both Output and Expected TestNode instances are flagged as "passed" or "not passed" meaning that there is some mismatch between Output and Expected trees (see TestNode.isPassed()).

      Output TestNode instances may also be flagged with ValidationIssue EXTRA (i.e., the TestNode is in the Output Tree but doesn't have a corresponding Expected TreeNode). See TestNode.getValidationIssue().

      Expected TestNode instances may also be flagged with ValidationIssue MISSING (i.e., the TestNode is in the Expected tree but doesn't have a corresponding Output TreeNode. See TestNode.getValidationIssue().

      TestNode instances marked not "passed" and ValidationIssue UNSPECIFIED appear in both Output and Expected trees but have different data values.

      Parameters:
        `aiTestsheetIndex` - Zero-based index of Testsheet.
        `abExpected` - `true` to return nodes from Expected Tree.
      Returns:
        List of TestNode instances.

    - #### getRuleMessages

          java.util.List<java.lang.String> getRuleMessages(int aiTestsheetIndex)

      Return a list of localized Rule Messages from the specified Testsheet. The Rule Messages columns will be tab-delimited.
      Parameters:
        `aiTestsheetIndex` - Zero-based index of Testsheet.
      Returns:
        List of tab-delimited Rule Messages.

    - #### getRuletestTabFolderModelAPI

          IRuletestTabFolderModelAPI getRuletestTabFolderModelAPI()

      Return a reference to the Ruletest Tab Folder API.
      Returns:
        instances of ITestsheetTreeSetModelAPI.

    - #### getTestsheetCount

          int getTestsheetCount()

      Return the count of the number of Testsheets in the loaded Ruletest asset.
      Returns:
        Number of Testsheets within loaded Ruletest.

    - #### getTestsheetIndex

          int getTestsheetIndex(java.lang.String astrTestsheetName)

      Return the index of the Testsheet bearing the specified name
      Parameters:
        `astrTestsheetName` - Name of the Testsheet.
      Returns:
        Index of Testsheet or -1 if not found.

    - #### getTestsheetName

          java.lang.String getTestsheetName(int aiTestsheetIndex)

      Return the name of the Testsheet identified by the specified index.
      Parameters:
        `aiTestsheetIndex` - Zero-based index of the Testsheet.
      Returns:
        Name of Testsheet or `null`.

    - #### getTestsheetTreeSetModelAPI

          ITestsheetTreeSetModelAPI getTestsheetTreeSetModelAPI()

      Return a reference to the Testsheet Tree Set API.
      Returns:
        instances of ITestsheetTreeSetModelAPI.

    - #### getValidationMessageKeys

          java.util.List<java.lang.String> getValidationMessageKeys()

      Return a list of all validation message keys in the Ruletest asset.
      Returns:
        List of all validation message keys.

    - #### getValidationMessageKeys

          java.util.List<java.lang.String> getValidationMessageKeys(int aiTestsheetIndex)

      Return the list of validation message keys associated with the specified Testsheet.
      Parameters:
        `aiTestsheetIndex` - Zero-based index of Testsheet.
      Returns:
        List of validation message keys associated with the specified Testsheet (localized).

    - #### getValidationMessages

          java.util.List<java.lang.String> getValidationMessages()

      Return a list of all validation messages in the Ruletest asset.
      Returns:
        List of localized validation messages.

    - #### getValidationMessages

          java.util.List<java.lang.String> getValidationMessages(int aiTestsheetIndex)

      Return the list of validation messages associated with the specified Testsheet.
      Parameters:
        `aiTestsheetIndex` - Zero-based index of Testsheet.
      Returns:
        List of validation messages associated with the specified Testsheet (localized).

    - #### isMismatch

          boolean isMismatch()

      Determine whether there is a mismatch between the Output Tree and Expected Tree. This test is applied across all Testsheets in the Ruletest.
      Returns:
        `true` if any Output Tree doesn't match the corresponding Expected Tree.

    - #### isMismatch

          boolean isMismatch(int aiTestsheetIndex)

      Determine whether there is a mismatch between the Output Tree and Expected Tree.
      Parameters:
        `aiTestsheetIndex` - Zero-based index of the Testsheet to test.
      Returns:
        `true` if Output Tree doesn't match the Expected Tree.

    - #### isValidationMessagePresent

          boolean isValidationMessagePresent(int aiTestsheetIndex,
                                           java.lang.String astrMessageKey)

      Determine whether the specified validation message exists in the specified Testsheet.
      Parameters:
        `aiTestsheetIndex` - Index of Testsheet.
        `astrMessageKey` - Key of validation message.
      Returns:
        `true` if validation message exists in the Testsheet.

    - #### isValidationMessagePresent

          boolean isValidationMessagePresent(java.lang.String astrMessageKey)

      Determine whether the specified validation message exists in the entire Ruletest asset.
      Parameters:
        `astrMessageKey` - Key of validation message.
      Returns:
        `true` if validation message exists in the Ruletest asset.

    - #### loadRuletest

          org.eclipse.emf.ecore.resource.Resource loadRuletest(org.eclipse.emf.common.util.URI aURIRuletest)

      Load the specified Ruletest asset for testing.
      Parameters:
        `aURIRuletest` - EMF URI of Ruletest asset.
      Returns:
        Ruletest asset Resource.

    - #### runAllTests

          boolean runAllTests()
                              throws java.lang.Exception

      Run all Testsheets.
      Returns:
        `true` if all Testsheets execute successfully.
      Throws:
        `java.lang.Exception`

    - #### runTest

          boolean runTest(int aiTestsheetIndex)
                          throws java.lang.Exception

      Run the specified Testsheet.
      Parameters:
        `aiTestsheetIndex` - Zero-based index of the Testsheet to run.
      Returns:
        `true` if the Testsheet execution was successful.
      Throws:
        `java.lang.Exception`

Copyright © 2005-2013 Progress Software Corporation and/or its subsidiaries and affiliates. All rights reserved.