TestPlan serialObject
Document

serialObject

by Group Public on Tuesday June 23 2009 @ 14:13:38 (1/1 Points)

API ↪Reference ✑ Reply ✓ Stick It ✗ Ditch It ⚐ Tag It

serialObject creates a context variable which will be serialized when the unit completes.

Creating

The function takes simply a File as an argument. This should be an absolute pathname, though otherwise it will use the standard resolution rules including System.TempDir as a final fallback.

The return of the function is simply a map in which you can store arbitrary data.

set %Store% as serialObject /var/mystore/data.stest
set %Store:Item% Value

As soon as this unit exits the object will be serialized to the indicated file. A later call of serialObject with the same filename will recover the saved file.

The .stest is used to indicate a serialized TestPlan file. It is not mandatory but may be clearer with file management.

Parallel Use

Multiple units may all call serialObject on the same file and get the same map.

Whenever any of the callers of serialObject is done (the test unit is complete) the data will be serialized.

Warning: do not use the returned variable beyond the life of the instantiating unit. That is, it should not be passed back to a parent unit, nor shall it be passed to a asynchronously spawned unit. Only at the end of the unit which created the variable will it be serialized.
© 2008-2010 edA-qa mort-ora-y
Using Persephone and TestPlan
Tag: