Class TestSequence

java.lang.Object
com.sun.ts.tests.common.webclient.TestSequence
All Implemented Interfaces:
TestCase

public class TestSequence extends Object implements TestCase
This class represents a logic sequence for executing a series of test cases in a specific order. In this case, the execution order will be the same order that the test cases were added to the sequence. The TestSequence has the added benefit of managing state between the test invocations.
  • Constructor Details

    • TestSequence

      public TestSequence()
      Creates a new instance of TestSequence
  • Method Details

    • execute

      public void execute() throws TestFailureException
      Executes the test sequence.
      Specified by:
      execute in interface TestCase
      Throws:
      TestFailureException - if any test in the sequence fails.
    • enableStateManagement

      public void enableStateManagement(boolean value)
      enableStateManagement, when enabled, will cause the test sequence to manage state between test case invocations. By default, a test sequence will not manage state.
      Parameters:
      value - a value of true enables session management.
    • isStateManagementEnabled

      public boolean isStateManagementEnabled()
      Returns a value indicating whether state management is enabled or not.
      Returns:
      boolean value indicating state management status
    • addTestCase

      public void addTestCase(String identifier, TestCase cs)
      Adds a test case to the sequence denoted by a unique identifier.
      Parameters:
      identifier - for this test case
      cs - the test case
    • removeTestCase

      public void removeTestCase(String identifier)
      Removes a test case from the sequence.
      Parameters:
      identifier -
    • setName

      public void setName(String name)
      Sets the name of this TestSequence. If not set, the default value is "DEFAULT".
      Specified by:
      setName in interface TestCase
      Parameters:
      name -
    • getName

      public String getName()
      Returns the name of this TestSequence.
      Specified by:
      getName in interface TestCase
      Returns:
      sequence name
    • setState

      public void setState(Object state)
      Sets the initial state for the test sequence to use when invoking test cases.
      Specified by:
      setState in interface TestCase
      Parameters:
      state - the initial state
    • getState

      public Object getState()
      Returns the state of the sequence. Note: This value can differ depending on when it has been called in relation to when execute has been called.
      Specified by:
      getState in interface TestCase
      Returns:
      state of the sequence