{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\ 

{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}void{td}{td}[#assertEquals]\(message, expected, actual)
Asserts that two values are equal.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertFalse]\(message, boolean_condition)
Asserts that a condition is false.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertFloatEquals]\(message, expectedFloat, actualFloat, tolerance)
Asserts that two floating point values are equal to within a given tolerance.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertMatches]\(message, regularExpression, actualString)
Asserts that a regular expression matches a string.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNotNull]\(message, object)
Asserts that an object is not null.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNotSame]\(message, notExpected, actual)
Asserts that two values are not the same.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNotUndefined]\(message, definedObject)
Asserts that an object is not undefined.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNull]\(message, nullValue)
Asserts that an object is null.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertSame]\(message, expected, actual)
Asserts that two values are the same.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertTrue]\(message, boolean_condition)
Asserts that a condition is true.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertUndefined]\(message, undefinedValue)
Asserts that an object is undefined.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#fail]\(message, instanceOfCallStack, userMessage)
Fails a test.{td}{tr}{tbody}{table}\\ 

{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=96D8DA9E-F684-4BDA-99D0-E76CEE65C069}{tr:id=name}{td}h6.assertEquals{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertEquals{span}{span:id=iets|style=float: left;}\(message, expected, actual){span}{td}{tr}{tr:id=des}{td}{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_des|text=|trigger=button}{sub-section}{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_des|trigger=none|class=sIndent}Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_prs|trigger=none}\[message\] -- The test description/message.
expected -- the expected value.
actual -- the actual value.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_ret|text=|trigger=button}{sub-section}{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_see|text=|trigger=button}{sub-section}{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_see|text=|trigger=button}{sub-section}{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_sam|text=|trigger=button}{sub-section}{sub-section:96D8DA9E-F684-4BDA-99D0-E76CEE65C069_sam|class=sIndent|trigger=none}{code:language=javascript}
// Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression.
jsunit.assertEquals("Solution name test", "someSolution", application.getSolutionName());
jsunit.assertEquals("Simple math test", 2, 1 + 1);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A7CB0918-B5B1-4896-A6D7-E99D8729E344}{tr:id=name}{td}h6.assertFalse{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertFalse{span}{span:id=iets|style=float: left;}\(message, boolean_condition){span}{td}{tr}{tr:id=des}{td}{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_des|text=|trigger=button}{sub-section}{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_des|trigger=none|class=sIndent}Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_prs|trigger=none}\[message\] -- The test description/message.
boolean_condition -- the actual value.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_ret|text=|trigger=button}{sub-section}{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_see|text=|trigger=button}{sub-section}{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_see|text=|trigger=button}{sub-section}{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_sam|text=|trigger=button}{sub-section}{sub-section:A7CB0918-B5B1-4896-A6D7-E99D8729E344_sam|class=sIndent|trigger=none}{code:language=javascript}
// Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.
jsunit.assertFalse("False test", application.isLastPrintPreviewPrinted());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=874CFA33-11D6-40AB-AFDA-B649AC861188}{tr:id=name}{td}h6.assertFloatEquals{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertFloatEquals{span}{span:id=iets|style=float: left;}\(message, expectedFloat, actualFloat, tolerance){span}{td}{tr}{tr:id=des}{td}{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_des|text=|trigger=button}{sub-section}{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_des|trigger=none|class=sIndent}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.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_prs|trigger=none}\[message\] -- The test description/message.
expectedFloat -- the expected value.
actualFloat -- the actual value.
tolerance -- float tolerance when comparing.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_ret|text=|trigger=button}{sub-section}{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_see|text=|trigger=button}{sub-section}{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_see|text=|trigger=button}{sub-section}{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_sam|text=|trigger=button}{sub-section}{sub-section:874CFA33-11D6-40AB-AFDA-B649AC861188_sam|class=sIndent|trigger=none}{code:language=javascript}
// 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.
jsunit.assertFloatEquals("Float equals test", 3.12, 3.121, 0.0015);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=2E2CC26F-C36D-445F-A1D7-3ED2571AC771}{tr:id=name}{td}h6.assertMatches{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertMatches{span}{span:id=iets|style=float: left;}\(message, regularExpression, actualString){span}{td}{tr}{tr:id=des}{td}{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_des|text=|trigger=button}{sub-section}{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_des|trigger=none|class=sIndent}Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_prs|trigger=none}\[message\] -- The test description/message.
regularExpression -- the regular expression used for matching.
actualString -- the actual value to be matched.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_ret|text=|trigger=button}{sub-section}{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_see|text=|trigger=button}{sub-section}{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_see|text=|trigger=button}{sub-section}{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_sam|text=|trigger=button}{sub-section}{sub-section:2E2CC26F-C36D-445F-A1D7-3ED2571AC771_sam|class=sIndent|trigger=none}{code:language=javascript}
// Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.
jsunit.assertMatches("Match test", new RegExp("gr(a|e)y"), "gray");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=2CF62390-88FD-46B5-B491-AAFD3F104181}{tr:id=name}{td}h6.assertNotNull{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNotNull{span}{span:id=iets|style=float: left;}\(message, object){span}{td}{tr}{tr:id=des}{td}{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_des|text=|trigger=button}{sub-section}{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_des|trigger=none|class=sIndent}Asserts that an object is not null. AssertionFailedError is thrown if the object is not null.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_prs|trigger=none}\[message\] -- The test description/message.
object -- the actual value.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_ret|text=|trigger=button}{sub-section}{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_see|text=|trigger=button}{sub-section}{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_see|text=|trigger=button}{sub-section}{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_sam|text=|trigger=button}{sub-section}{sub-section:2CF62390-88FD-46B5-B491-AAFD3F104181_sam|class=sIndent|trigger=none}{code:language=javascript}
// Asserts that an object is not null. AssertionFailedError is thrown if the object is not null.
var a; // this is undefined, not null
jsunit.assertNotNull("Not null test", a);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=C701DEEA-AA0C-4571-81B6-1B10A99AFE33}{tr:id=name}{td}h6.assertNotSame{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNotSame{span}{span:id=iets|style=float: left;}\(message, notExpected, actual){span}{td}{tr}{tr:id=des}{td}{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_des|text=|trigger=button}{sub-section}{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_des|trigger=none|class=sIndent}Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_prs|trigger=none}\[message\] -- The test description/message.
notExpected -- the value that is not expected.
actual -- the actual value.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_ret|text=|trigger=button}{sub-section}{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_see|text=|trigger=button}{sub-section}{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_see|text=|trigger=button}{sub-section}{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_sam|text=|trigger=button}{sub-section}{sub-section:C701DEEA-AA0C-4571-81B6-1B10A99AFE33_sam|class=sIndent|trigger=none}{code:language=javascript}
// Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one.
var a = new Date(1990, 1, 1);
var b = new Date(1990, 1, 1);
jsunit.assertNotSame("Not same test", a, b);
jsunit.assertEquals("But equals", a, b);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=6576DAB6-810B-4E4B-870C-632525B0792E}{tr:id=name}{td}h6.assertNotUndefined{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNotUndefined{span}{span:id=iets|style=float: left;}\(message, definedObject){span}{td}{tr}{tr:id=des}{td}{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_des|text=|trigger=button}{sub-section}{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_des|trigger=none|class=sIndent}Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_prs|trigger=none}\[message\] -- The test description/message.
definedObject -- the actual value.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_ret|text=|trigger=button}{sub-section}{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_see|text=|trigger=button}{sub-section}{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_see|text=|trigger=button}{sub-section}{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_sam|text=|trigger=button}{sub-section}{sub-section:6576DAB6-810B-4E4B-870C-632525B0792E_sam|class=sIndent|trigger=none}{code:language=javascript}
// Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.
var a = 0;
jsunit.assertNotUndefined("Not undefined test", a);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D6492964-9841-4B62-B145-7627A5B04F87}{tr:id=name}{td}h6.assertNull{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNull{span}{span:id=iets|style=float: left;}\(message, nullValue){span}{td}{tr}{tr:id=des}{td}{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_des|text=|trigger=button}{sub-section}{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_des|trigger=none|class=sIndent}Asserts that an object is null. AssertionFailedError is thrown if the object is not null.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_prs|trigger=none}\[message\] -- The test description/message.
nullValue -- the actual value.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_ret|text=|trigger=button}{sub-section}{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_see|text=|trigger=button}{sub-section}{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_see|text=|trigger=button}{sub-section}{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_sam|text=|trigger=button}{sub-section}{sub-section:D6492964-9841-4B62-B145-7627A5B04F87_sam|class=sIndent|trigger=none}{code:language=javascript}
// Asserts that an object is null. AssertionFailedError is thrown if the object is not null.
jsunit.assertNull("Null test", null);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=6F664A12-8759-4D68-AD48-54B8DA4E4FCD}{tr:id=name}{td}h6.assertSame{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertSame{span}{span:id=iets|style=float: left;}\(message, expected, actual){span}{td}{tr}{tr:id=des}{td}{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_des|text=|trigger=button}{sub-section}{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_des|trigger=none|class=sIndent}Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_prs|trigger=none}\[message\] -- The test description/message.
expected -- the expected value.
actual -- the actual value.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_ret|text=|trigger=button}{sub-section}{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_see|text=|trigger=button}{sub-section}{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_see|text=|trigger=button}{sub-section}{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_sam|text=|trigger=button}{sub-section}{sub-section:6F664A12-8759-4D68-AD48-54B8DA4E4FCD_sam|class=sIndent|trigger=none}{code:language=javascript}
// Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.
var a = new Date(1990, 1, 1);
var b = a;
jsunit.assertSame("Same test", a, b);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=4309596D-0EAC-4D24-8096-E505B2F5E796}{tr:id=name}{td}h6.assertTrue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertTrue{span}{span:id=iets|style=float: left;}\(message, boolean_condition){span}{td}{tr}{tr:id=des}{td}{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_des|text=|trigger=button}{sub-section}{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_des|trigger=none|class=sIndent}Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_prs|trigger=none}\[message\] -- The test description/message.
boolean_condition -- the actual value.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_ret|text=|trigger=button}{sub-section}{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_see|text=|trigger=button}{sub-section}{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_see|text=|trigger=button}{sub-section}{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_sam|text=|trigger=button}{sub-section}{sub-section:4309596D-0EAC-4D24-8096-E505B2F5E796_sam|class=sIndent|trigger=none}{code:language=javascript}
// Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.
jsunit.assertTrue("True test", application.isLastPrintPreviewPrinted());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E0F5F738-3F3C-45D2-8146-29A5C5ED8F64}{tr:id=name}{td}h6.assertUndefined{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertUndefined{span}{span:id=iets|style=float: left;}\(message, undefinedValue){span}{td}{tr}{tr:id=des}{td}{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_des|text=|trigger=button}{sub-section}{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_des|trigger=none|class=sIndent}Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_prs|trigger=none}\[message\] -- The test description/message.
undefinedValue -- the actual value.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_ret|text=|trigger=button}{sub-section}{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_see|text=|trigger=button}{sub-section}{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_see|text=|trigger=button}{sub-section}{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_sam|text=|trigger=button}{sub-section}{sub-section:E0F5F738-3F3C-45D2-8146-29A5C5ED8F64_sam|class=sIndent|trigger=none}{code:language=javascript}
// Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
jsunit.assertUndefined("Undefined test", thisIsUndefined);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F59C1F81-0998-43E8-A07F-3C73A88C1D8D}{tr:id=name}{td}h6.fail{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}fail{span}{span:id=iets|style=float: left;}\(message, instanceOfCallStack, userMessage){span}{td}{tr}{tr:id=des}{td}{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_des|text=|trigger=button}{sub-section}{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_des|trigger=none|class=sIndent}Fails a test. AssertionFailedError is always thrown.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_prs|trigger=none}\[message\] -- The test description/message. This is usually the only parameter specified when calling this method.
\[instanceOfCallStack\] -- an internal JSUnit call stack. Use null for this if you want to get to the next optional parameter. Usually not specified.
\[userMessage\] -- an user message. Usually not specified.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_ret|text=|trigger=button}{sub-section}{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_see|text=|trigger=button}{sub-section}{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_see|text=|trigger=button}{sub-section}{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_sam|text=|trigger=button}{sub-section}{sub-section:F59C1F81-0998-43E8-A07F-3C73A88C1D8D_sam|class=sIndent|trigger=none}{code:language=javascript}
// Fails a test. AssertionFailedError is always thrown.
jsunit.fail("Fail test");
jsunit.fail("test", null, "Fail"); // 2nd param is not used in Servoy, params 3 and 1 get merged to form a message. The result is the same as in the line above.
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}