com.ibm.rational.test.lt.kernel.action

Interface IContainer

  • All Superinterfaces:
    ICountable, IKAction, IKLog, IKSemaphore, ITestExecutionServices, Runnable
    All Known Subinterfaces:
    IEngine, IFor, IKLoadTestSchedule, IKTransaction, IKUserGroup, ILoop, IPacedLoop, IParallel, IWhile
    All Known Implementing Classes:
    com.ibm.rational.test.lt.kernel.action.impl.Container, com.ibm.rational.test.lt.kernel.action.impl.KContainer, com.ibm.rational.test.lt.kernel.action.impl.KScript, LTTestScript


    public interface IContainer
    extends IKAction
    Interface for a collection of related actions.

    This interface is the basic unit of scheduling. It contains a group of actions that have some logical connection.

    For example, if a group of actions are to be executed only if a condition evaluates to 'true', the actions to be performed are placed together inside a container. The container is then passed to the branching action.

    Containers are intended to be nested for use by various flow-control actions.

    • Method Detail

      • add

        void add(IKAction action)
        Add an action to this container.

        Adds a non-dispatched, non-running action.

        Parameters:
        action - to add
      • remove

        boolean remove(IKAction action)
        Remove an action from this container.

        Removes an action.

        Parameters:
        action - to remove
        Returns:
        true if the item was on the list false if the item was not on the list
      • getActionsArray

        IKAction[] getActionsArray()
      • getChildCount

        int getChildCount()
      • verifyParentRelationships

        IKAction verifyParentRelationships()
        Verify parent/child relationships in this container and below

        This method was addded in order to address the possibility that an action could have been added to multiple containers. Doing so would reset the parent container to the last one to which it was added. This would result in some containers never receiving the proper number of 'finish(...)' calls, hanging the execution.

        Returns:
        the first action whose parent is not correctly set to its parent; null otherwise
      • finish

        void finish(IKAction child)
        Indicate that processing has finished for this action.

        Note: The implication here is that the action is complete and the container should continue on to the next action in the container.

        Parameters:
        child - the child action that has finished
        Throws:
        ActionException - if the action has not been started
        See Also:
        IKAction.execute(), IKAction.start(), IKAction.isRunning()
      • recordChildExecutionTime

        void recordChildExecutionTime(IKAction child)
      • nextHistoryId

        String nextHistoryId()
        Returns:
        the next available execution history event id
      • setStartHistoryId

        void setStartHistoryId(String id)
        Saves the execution history event id for the container's start event The container's start event is the parent event for all events generated by the container This id is not null iff the container reported a start event.
        Parameters:
        id -
      • getStartHistoryId

        String getStartHistoryId()
        Returns:
        the saved start execution history id. null if there is no start event
      • getParentHistoryId

        String getParentHistoryId()
        Returns:
        the execution history id of the most recent ancestor container that reported a start event
      • getStartEvent

        org.eclipse.hyades.test.common.event.TypedEvent getStartEvent()
      • getStopEvent

        org.eclipse.hyades.test.common.event.TypedEvent getStopEvent()
      • getVirtualUser

        com.ibm.rational.test.lt.kernel.engine.impl.VirtualUser getVirtualUser()
      • getUserGroup

        com.ibm.rational.test.lt.kernel.action.impl.UserGroup getUserGroup()
      • getCompoundTest

        com.ibm.rational.test.lt.kernel.action.impl.CompoundTest getCompoundTest()
      • rollUpVerdicts

        boolean rollUpVerdicts()
        reports verdicts summarizing the verdicts reported by the container's children See KContainer: reportingRollUp(), passThroughRollUp(), and nullRollUp() for three "standard" algorithms.
        Returns:
        true if one or more verdicts was reported during the roll up, false if not.
      • registerChildVerdict

        void registerChildVerdict(String id,
                                int verdict,
                                int count)
        informs the parent of 1 or more child verdicts
        Parameters:
        id - comma seperated list of ids
        verdict -
        count -
      • registerChildVerdict

        void registerChildVerdict(String id,
                                int verdict)
        informs the parent of a child verdict
        Parameters:
        id -
        verdict -
      • registerChildVerdict

        void registerChildVerdict(int verdict,
                                int count)
      • registerChildVerdict

        void registerChildVerdict(int verdict)
      • setAllowChildrenToPageTestLog

        void setAllowChildrenToPageTestLog(boolean ok)
        indicates that it is safe (or not) for the testLog loading code in the workbench to unload the child testLog events associated with this container's testLog start event during runtime processing. It is not safe to unload child events when more child events are possible (such as for Schedule or UserGroup containers since they run on multiple computers and therefore no one computer can know when all children have been sent,) or for HTTPPage containers since the HTTP protocol data viewer needs the events in memory so the page can be displayed. The default value of this is to inherit the effective value from the parent container. It is not expected that any containers would need to set this to true. The value is true for UserGroups (allowing the VirtualUser containers to page) and therefore all children of the UserGroup will inherit permission to page. If some ancestor container (such as HTTPPage) sets this to false, then it is unlikely that a child of that container should need to override for it's children.
        Parameters:
        ok -
      • isAllowChildrenToPageTestLog

        boolean isAllowChildrenToPageTestLog()
        Returns:
        the effective value of the flag.
      • stopChildren

        void stopChildren(boolean actGlobally)
        stops all currently running child actions and prevents new ones from starting.
        Parameters:
        actGlobally - indicates whether the stop applies to other engines (for schedules and userGroups)
      • addCatch

        void addCatch(IKExceptionHandler handler)
        Add an exception handler action to the container. If a handler already exists for the same exception, this handler will replace the previously added handler.
        Parameters:
        handler - An IKExceptionHandler that pairs an exception class with a KAction to run when the exception occurs.
      • addFinally

        void addFinally(IKAction initialAction)
        Adds a KAction to the FINALLY clause for this container. The FINALLY clause will be run whenever this container stops whether stopped by normal completion of all children, user request, or exception.
        Parameters:
        finalAction -
      • addInitially

        void addInitially(IKAction initialAction)
        Adds a KAction to the INITIALLY clause for this container. The INITIALLY clause will be run whenever this container starts execution before any of the normal child actions are run. This is really only necessary for Parallel containers since simply adding a child first should suffice for regular containers but it may prove useful so it is supported for all containers.
        Parameters:
        initialAction -
      • loadTest

        Object loadTest(IContainer parent,
                      String projectName,
                      String className,
                      String id)
        Loads a test with the specified class name using a custom class loader for the project specified.
        Parameters:
        parent -
        projectName -
        className -
        id -
        Returns:
        class object
      • getKScript

        com.ibm.rational.test.lt.kernel.action.impl.KScript getKScript()
      • getThinkScheme

        int getThinkScheme()
IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2013. All rights reserved.