Page History
...
style | display:none |
---|
...
Div | ||||
---|---|---|---|---|
| ||||
Servoy has built-in support for Unit Testing. The integration adds the following to the Servoy environment:
Creating testcases is as straightforward as creating a function with a name that starts with 'test_':
The JSUnit node in the Solution Explorer provides easy access to the different supported assert functions Testcases can be added on application level in the global scope of on form level in the form scope. Each scope can contain a setUp and/or tearDown function. The setUp function is called BEFORE running each testcase in the scope and the tearDown function is called AFTER running each test in the scope. The setUp and tearDown function allow the developer to create the right circumstances for testcases to run and cleanup afterwards. Note that the setUp() and tearDown() methods are called before and after EACH test methods, as each single test is supposed to be independant.
|
HTML Table | id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
class | servoy sSummary | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HTML Table | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Colgroup Tag | |||||||
---|---|---|---|---|---|---|---|
|
Table Head (thead) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
id | assertSame-Object_Object |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
id | sam |
---|
Sample
class | sIndent |
---|
language | javascript |
---|
index | true |
---|---|
refresh | 100d |
showRefresh | true |
id | doc |
title | Refresh page |
showDate | true |
retry | Enable |
assertEquals(expected, actual)
Asserts that two values are
equal. AssertionFailedError is thrown if the
actual
Table Row (tr) | ||
---|---|---|
| ||
|
id | assertSame-String_Object_Object |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
id | sam |
---|
Sample
class | sIndent |
---|
language | javascript |
---|
value does not match the regular expression.
Parameters
Supported Clients
Sample
assertEquals(message, expected, actual)
Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression.
Parameters
Supported Clients
Sample
assertFalse(boolean_condition)
Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.
Parameters
Supported Clients
Sample
assertFalse(message, boolean_condition)
Asserts that a condition is false. AssertionFailedError is thrown if the
evaluation
was not false.
Parameters
Table Row (tr) | ||
---|---|---|
| ||
|
id | assertTrue-Boolean |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
id | sam |
---|
Sample
class | sIndent |
---|
language | javascript |
---|
Supported Clients
Sample
assertFloatEquals(expectedFloat, actualFloat, tolerance)
Asserts that two floating point values are equal to within a given tolerance. AssertionFailedError is thrown if the expected value is not within the tolerance of the actual one.
Parameters
Supported Clients
Sample
assertFloatEquals(message, expectedFloat, actualFloat, tolerance)
Asserts that two floating point values are equal to within a given tolerance. AssertionFailedError is thrown if the expected value is not within the tolerance of the actual one.
Parameters
Supported Clients
Sample
assertMatches(regularExpression, actualString)
Asserts that a regular expression matches a string. AssertionFailedError is thrown if the
expected
Table Row (tr) | ||
---|---|---|
| ||
|
id | assertTrue-String_Boolean |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
id | sam |
---|
Sample
class | sIndent |
---|
language | javascript |
---|
value is not the actual one.
Parameters
Supported Clients
Sample
assertMatches(message, regularExpression, actualString)
Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.
Parameters
Supported Clients
Sample
assertNotNull(object)
Asserts that an object is not null. AssertionFailedError is thrown if the
object
Table Row (tr) | ||
---|---|---|
| ||
|
id | assertUndefined-Object |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
id | sam |
---|
Sample
class | sIndent |
---|
language | javascript |
---|
is not null.
Parameters
Supported Clients
Sample
assertNotNull(message, object)
Asserts that an object is not null. AssertionFailedError is thrown if the object is not null.
Parameters
Supported Clients
Sample
assertNotSame(notExpected, actual)
Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one.
Parameters
Supported Clients
Sample
assertNotSame(message, notExpected, actual)
Asserts that two values are not the same. AssertionFailedError is thrown if
Table Row (tr) | ||
---|---|---|
| ||
|
id | assertUndefined-String_Object |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
id | sam |
---|
Sample
class | sIndent |
---|
language | javascript |
---|
the expected value is the actual one.
Parameters
Supported Clients
Sample
assertNotUndefined(definedObject)
Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.
Parameters
Supported Clients
Sample
assertNotUndefined(message, definedObject)
Asserts that an object is not undefined. AssertionFailedError is thrown if the object is
Table Row (tr) | ||
---|---|---|
| ||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Table Body (tbody) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
id | fail-String_Object_String |
---|
Table Row (tr) | ||
---|---|---|
| ||
|
Table Row (tr) | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
id | prs |
---|
Parameters
class | sIndent |
---|
undefined.
Parameters
Supported Clients
Sample
assertNull(nullValue)
Asserts that an object is null. AssertionFailedError is thrown if the object is not null.
Parameters
Supported Clients
Sample
assertNull(message, nullValue)
Asserts that an object is null. AssertionFailedError is thrown if the object is not null.
Parameters
Supported Clients
Sample
assertSame(expected, actual)
Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.
Parameters
Supported Clients
Sample
assertSame(message, expected, actual)
Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.
Parameters
Supported Clients
Sample
assertTrue(boolean_condition)
Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.
Parameters
Supported Clients
Sample
assertTrue(message, boolean_condition)
Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.
Parameters
Supported Clients
Sample
assertUndefined(undefinedValue)
Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
Parameters
Supported Clients
Sample
assertUndefined(message, undefinedValue)
Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
Parameters
Supported Clients
Sample
fail(message)
Fails a test. AssertionFailedError is always thrown.
Parameters
Supported Clients
Sample
fail(message, instanceOfCallStack)
Fails a test. AssertionFailedError is always thrown.
Parameters
{Object}
{String} userMessage - a user message. Usually not specified.
Table Row (tr) | |||||||
---|---|---|---|---|---|---|---|
| |||||||
|
Table Row (tr) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
|
class | lastDetailRow |
---|
Supported Clients
Sample
fail(message, instanceOfCallStack, userMessage)
Fails a test. AssertionFailedError is always thrown.
Parameters
Supported Clients
Sample