Drag[en]gine Script Module DragonScript
1.23
|
Base class for testing BehaviorElementClass behaviors persistency. More...
Classes | |
class | TestBehaviorElementClass |
Helper class to store the created element aside. More... | |
Public Member Functions | |
void | init () |
Initialize test. More... | |
TestCaseECBehaviorPersistency | new (String id, UnicodeString name) |
Create test. More... | |
bool | run (TestSuite testSuite) |
Run test. More... | |
void | setElement (BehaviorElement element) |
Set element. More... | |
Public Member Functions inherited from Dragengine.TestSystem.TestCaseECBehavior | |
bool | getCreateAndAddElementShouldFail () |
Calling createAndAddElement() on element stub should fail by throwing an exception. More... | |
bool | getPreloadShouldFail () |
Preloading on element class should fail. More... | |
void | setCreateAndAddElementShouldFail (bool shouldFail) |
Set calling createAndAddElement() on element stub should fail by throwing an exception. More... | |
void | setPreloadShouldFail (bool shouldFail) |
Set preloading on element class should fail. More... | |
Public Member Functions inherited from Dragengine.TestSystem.TestCase | |
void | assertColor (Color found, Color expected, float range) |
Fail test if colors are not equal within range. More... | |
void | assertDiffers (Object found, Object shouldNot) |
Fail test if found equals expected. More... | |
void | assertDVector (DVector found, DVector expected) |
Fail test if vectors are not equal within range of 1mm. More... | |
void | assertDVector (DVector found, DVector expected, float range) |
Fail test if vectors are not equal within range. More... | |
void | assertEquals (Object found, Object expected) |
Fail test if found does not equal expected. More... | |
void | assertFalse (bool found) |
Fail test if found is not false. More... | |
void | assertNotNull (Object found) |
Fail test if found is not null. More... | |
void | assertNull (Object found) |
Fail test if found is not null. More... | |
void | assertQuaternion (Quaternion found, Quaternion expected) |
Fail test if quaternions are not equal within range of 1mm. More... | |
void | assertQuaternion (Quaternion found, Quaternion expected, float range) |
Fail test if quaternions are not equal within range. More... | |
void | assertThrows (Block ablock) |
Fail test if ablock does not throw an exception. More... | |
void | assertTrue (bool found) |
Fail test if found is not true. More... | |
void | assertVector (DVector found, DVector expected, float range) |
Fail test if vectors are not equal within range. More... | |
void | assertVector (Vector found, Vector expected) |
Fail test if vectors are not equal within range of 1mm. More... | |
bool | getEnabled () |
Test case is enabled. More... | |
Exception | getException () |
Exception if test case failed. More... | |
String | getID () |
Identifier. More... | |
UnicodeString | getName () |
Display name. More... | |
State | getState () |
Test state. More... | |
TestSuite | getTestSuite () |
Test suite. More... | |
void | setEnabled (bool enabled) |
Set if test case is enabled. More... | |
void | setException (Exception exception) |
Set exception if test case failed. More... | |
void | setState (State state) |
Set test state. More... | |
void | setTestSuite (TestSuite testSuite) |
Set test suite. More... | |
Protected Member Functions | |
void | addBehaviors () |
Add behaviors to element class. More... | |
void | dataPersisted () |
Element data has been persisted. More... | |
void | elementCreated () |
Element created. More... | |
void | explicitRead (PersistencyEnvironment env) |
Explicit read test ensuring behaviors read all data. More... | |
BehaviorElement | getElement () |
Element to use for testing. More... | |
BehaviorElementClass | getElementClass () |
Element class to use for testing. More... | |
GameWorld | getGameWorld () |
Game world to use for testing. More... | |
MemoryFile | getPersistedData () |
Persisted behavior element data. More... | |
PreloadCounter | getPreloadCounter () |
Preload counter used to preload element class resources. More... | |
StubElement | getStubElement () |
Stub element to use for testing. More... | |
bool | testBehaviors (TestSuite testSuite) |
Test behaviors. More... | |
Protected Member Functions inherited from Dragengine.TestSystem.TestCaseECBehavior | |
void | assertEnumProperty (ECPEnumeration property, Enumeration value, Set enumerationValues) |
Assert element class enumeration property. More... | |
void | assertFloatProperty (ECPFloat property, float value) |
Assert element class float property. More... | |
void | assertFloatProperty (ECPFloat property, float value, float limitLower) |
Assert element class float property. More... | |
void | assertFloatProperty (ECPFloat property, float value, float limitLower, float limitUpper) |
Assert element class float property. More... | |
void | assertIntegerProperty (ECPInteger property, int value) |
Assert element class integer property. More... | |
void | assertIntegerProperty (ECPInteger property, int value, int limitLower) |
Assert element class integer property. More... | |
void | assertIntegerProperty (ECPInteger property, int value, int limitLower, int limitUpper) |
Assert element class integer property. More... | |
Additional Inherited Members | |
Public Attributes inherited from Dragengine.TestSystem.TestCase | |
bool | pEnabled |
Test case is enabled. More... | |
Exception | pException |
Exception if test case failed. More... | |
String | pID |
Test identifier. More... | |
UnicodeString | pName |
Test name. More... | |
State | pState |
Test state. More... | |
WeakReference | pTestSuite |
Test suite. More... | |
Base class for testing BehaviorElementClass behaviors persistency.
This class helps to test ECBehavior subclasses persistency by providing the boiler plate code required to set up such tests. In particular this base class does the following:
This class calls hook methods at specific points during the test to allow the subclass to set up the behaviors in the required layout as well as running the tests. The following example implementation shows how a subclass can be written.
|
protected |
Add behaviors to element class.
Reimplemented from Dragengine.TestSystem.TestCaseECBehavior.
|
protected |
Element data has been persisted.
|
protected |
Element created.
Reimplemented from Dragengine.TestSystem.TestCaseECBehavior.
|
protected |
Explicit read test ensuring behaviors read all data.
|
protected |
Element to use for testing.
Reimplemented from Dragengine.TestSystem.TestCaseECBehavior.
|
protected |
Element class to use for testing.
Reimplemented from Dragengine.TestSystem.TestCaseECBehavior.
|
protected |
Game world to use for testing.
Reimplemented from Dragengine.TestSystem.TestCaseECBehavior.
|
protected |
Persisted behavior element data.
|
protected |
Preload counter used to preload element class resources.
Reimplemented from Dragengine.TestSystem.TestCaseECBehavior.
|
protected |
Stub element to use for testing.
Reimplemented from Dragengine.TestSystem.TestCaseECBehavior.
void Dragengine.TestSystem.TestCaseECBehaviorPersistency.init | ( | ) |
Initialize test.
Reimplemented from Dragengine.TestSystem.TestCaseECBehavior.
TestCaseECBehaviorPersistency Dragengine.TestSystem.TestCaseECBehaviorPersistency.new | ( | String | id, |
UnicodeString | name | ||
) |
Create test.
Reimplemented from Dragengine.TestSystem.TestCaseECBehavior.
bool Dragengine.TestSystem.TestCaseECBehaviorPersistency.run | ( | TestSuite | testSuite | ) |
Run test.
Reimplemented from Dragengine.TestSystem.TestCaseECBehavior.
void Dragengine.TestSystem.TestCaseECBehaviorPersistency.setElement | ( | BehaviorElement | element | ) |
Set element.
For internal use only.
|
protected |
Test behaviors.
Reimplemented from Dragengine.TestSystem.TestCaseECBehavior.