Introduction to behaviors

Behaviors are reusable behavioral units that can expose utility or business logic for use within HCL OneTest™ Virtualization.

They can be combined to build rich virtual servers (stubs) with minimal development effort.

A behavior interacts with a stub in two ways:

Behaviors are discovered by HCL OneTest™ Virtualization at run time for use in stubs by means of an Eclipse extension point: com.greenhat.tester.api.behaviour and they have the following four primary elements:

  1. The factoryClass is a Java™ class whose package is exported by the behavior-contributing plug-in that implements the com.greenhat.tester.api.behaviour.BehaviourFactory interface. The implementation of the class creates and returns an implementation of the behavior and typically will configure and add listeners to it.
  2. The behaviourInterface is a Java interface that is an extension of the com.greenhat.tester.api.behaviour.LifecycleAwareBehaviour interface whose package is exported by the behavior-contributing plug-in, which exposes the functions of the behavior.
  3. The callbackInterface is a Java interface whose package is exported by the behavior-contributing plug-in and exposes the events exposed as call-backs by the behavior.
  4. The implementation of the behavior is custom code that is typically instantiated and configured by the factoryClass, which implements the behaviourInterface and makes call-backs on the callbackInterface.
Feedback