Kanzi 3.9.10
TestRuntime Class Reference

The TestRuntime class provides access to a testing environment including a Kanzi Domain. More...

Public Member Functions

 TestRuntime (Object context)
 Construct a TestRuntime object.
 
void advanceMockClock (long durationNS)
 Advances the Main Loop Scheduler's mock clock the given number of nanoseconds.
 
void close ()
 Close the TestRuntime object.
 
void enableMockClock ()
 Enables the mock clock in Main Loop Scheduler, that can be adjusted manually in exact nanosecond precision.
 
void generateTouchClick (float x, float y)
 Generates a click (touch down, touch up) in specified coordinates.
 
Domain getDomain ()
 Gets the Domain for the Test Environment.
 
Scene getScene ()
 Gets the Scene for the Test Environment.
 
Node2D getScreen ()
 Gets the Screen for the Test Environment.
 
void reloadGPUResources ()
 Trigger a reload of GPU Resources.
 

Static Public Member Functions

static void LoadKanziLibraries ()
 Load the native Kanzi libraries.
 

Detailed Description

The TestRuntime class provides access to a testing environment including a Kanzi Domain.

It is only intended to be used for non-production testing purposes.

Constructor & Destructor Documentation

◆ TestRuntime()

TestRuntime ( Object context)

Construct a TestRuntime object.

Typically, this is called in the setup of a test fixture.

Parameters
contextThe platform context (i.e. Android Application Context) or null if no context is needed.

Member Function Documentation

◆ close()

void close ( )

Close the TestRuntime object.

Typically, this is called in the teardown of a test fixture.

◆ generateTouchClick()

void generateTouchClick ( float x,
float y )

Generates a click (touch down, touch up) in specified coordinates.

Parameters
xThe x coordinate of the click.
yThe y coordinate of the click.

◆ getDomain()

Domain getDomain ( )

Gets the Domain for the Test Environment.

Returns
The Test Environment Domain

◆ getScene()

Scene getScene ( )

Gets the Scene for the Test Environment.

Returns
The Test Environment Scene

◆ getScreen()

Node2D getScreen ( )

Gets the Screen for the Test Environment.

Returns
The Test Environment Screen

◆ LoadKanziLibraries()

static void LoadKanziLibraries ( )
static

Load the native Kanzi libraries.

Typically, this is called in a static block of a test fixture. It is only intended to be used for non-production testing purposes.