Child pages
  • JSUnit

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
{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=9E923FE7-51F6-4642-82C3-27B207E5E23B}{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:9E923FE7-51F6-4642-82C3-27B207E5E23B_des|text=|trigger=button}{sub-section}{sub-section:9E923FE7-51F6-4642-82C3-27B207E5E23B_des|trigger=none|class=sIndent}Asserts that two values are equal.
Wiki Markup
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryvoidAsserts that two values are equal.voidAsserts that two values are equal.voidAsserts that a condition is false.voidAsserts that a condition is false.voidAsserts that two floating point values are equal to within a given tolerance.voidAsserts that two floating point values are equal to within a given tolerance.voidAsserts that a regular expression matches a string.voidAsserts that a regular expression matches a string.voidAsserts that an object is not null.voidAsserts that an object is not null.voidAsserts that two values are not the same.voidAsserts that two values are not the same.voidAsserts that an object is not undefined.voidAsserts that an object is not undefined.voidAsserts that an object is null.voidAsserts that an object is null.voidAsserts that two values are the same.voidAsserts that two values are the same.voidAsserts that a condition is true.voidAsserts that a condition is true.voidAsserts that an object is undefined.voidAsserts that an object is undefined.voidFails a test.voidFails a test.voidFails a test.

functionservoy sDetail2100%height:30px2Methods DetailsassertEqualsname

assertEquals(expected, actual)

dessIndent
Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression.
prs

Parameters

sIndentexpectedthe expected value.actualthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRowassertEqualsname

assertEquals(message, expected, actual)

dessIndent
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:9E923FE7-51F6-4642-82C3-27B207E5E23B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9E923FE7-51F6-4642-82C3-27B207E5E23B_prs|trigger=none}\[message\] -- The test
prs

Parameters

sIndentmessageThe test description/message.
expected -- the expected value. actual -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:9E923FE7-51F6-4642-82C3-27B207E5E23B_ret|text=|trigger=button}{sub-section}{sub-section:9E923FE7-51F6-4642-82C3-27B207E5E23B_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9E923FE7-51F6-4642-82C3-27B207E5E23B_see|text=|trigger=button}{sub-section}{sub-section:9E923FE7-51F6-4642-82C3-27B207E5E23B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9E923FE7-51F6-4642-82C3-27B207E5E23B_see|text=|trigger=button}{sub-section}{sub-section:9E923FE7-51F6-4642-82C3-27B207E5E23B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9E923FE7-51F6-4642-82C3-27B207E5E23B_sam|text=|trigger=button}{sub-section}{sub-section:9E923FE7-51F6-4642-82C3-27B207E5E23B_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that two values are equalexpected value.actualthe actual value.clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertFalsename

assertFalse(boolean_condition)

dessIndent
Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.
prs

Parameters

sIndentboolean_conditionthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertFalsename

assertFalse(message, boolean_condition)

dessIndent
Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.
prs

Parameters

sIndentmessageThe test description/message.boolean_conditionthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertFloatEqualsname

assertFloatEquals(expectedFloat, actualFloat, tolerance)

dessIndent
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.
prs

Parameters

sIndentexpectedFloatthe expected value.actualFloatthe actual value.tolerancetolerance when comparing.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertFloatEqualsname

assertFloatEquals(message, expectedFloat, actualFloat, tolerance)

dessIndent
Asserts that two floating point values are equal to within a given tolerance. AssertionFailedError is thrown if the 
actual
expected value 
does
is not 
match
within the 
regular
tolerance 
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=AAC8571E-3665-4AC9-B9C2-697A951AA1E5}{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:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_des|text=|trigger=button}{sub-section}{sub-section:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_des|trigger=none|class=sIndent}Asserts that a condition is false. AssertionFailedError is
of the actual one.
prs

Parameters

sIndentmessageThe test description/message.expectedFloatthe expected value.actualFloatthe actual value.tolerancetolerance when comparing.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertMatchesname

assertMatches(regularExpression, actualString)

dessIndent
Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.
prs

Parameters

sIndentregularExpressionthe regular expression used for matching.actualStringthe actual value to be matched.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertMatchesname

assertMatches(message, regularExpression, actualString)

dessIndent
Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.
prs

Parameters

sIndentmessageThe test description/message.regularExpressionthe regular expression used for matching.actualStringthe actual value to be matched.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertNotNullname

assertNotNull(object)

dessIndent
Asserts that an object is not null. AssertionFailedError is thrown if the 
evaluation
object 
was
is not 
false.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_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:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_ret|text=|trigger=button}{sub-section}{sub-section:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_see|text=|trigger=button}{sub-section}{sub-section:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_see|text=|trigger=button}{sub-section}{sub-section:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_sam|text=|trigger=button}{sub-section}{sub-section:AAC8571E-3665-4AC9-B9C2-697A951AA1E5_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=5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B}{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:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_des|text=|trigger=button}{sub-section}{sub-section:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_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:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_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:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_ret|text=|trigger=button}{sub-section}{sub-section:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_see|text=|trigger=button}{sub-section}{sub-section:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_see|text=|trigger=button}{sub-section}{sub-section:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_sam|text=|trigger=button}{sub-section}{sub-section:5A61DA2E-5CFA-4A0C-A5FD-9A76E7DA8C4B_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=FD8300AB-5E59-4670-B09C-D71D744EADF7}{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:FD8300AB-5E59-4670-B09C-D71D744EADF7_des|text=|trigger=button}{sub-section}{sub-section:FD8300AB-5E59-4670-B09C-D71D744EADF7_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:FD8300AB-5E59-4670-B09C-D71D744EADF7_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FD8300AB-5E59-4670-B09C-D71D744EADF7_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:FD8300AB-5E59-4670-B09C-D71D744EADF7_ret|text=|trigger=button}{sub-section}{sub-section:FD8300AB-5E59-4670-B09C-D71D744EADF7_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FD8300AB-5E59-4670-B09C-D71D744EADF7_see|text=|trigger=button}{sub-section}{sub-section:FD8300AB-5E59-4670-B09C-D71D744EADF7_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FD8300AB-5E59-4670-B09C-D71D744EADF7_see|text=|trigger=button}{sub-section}{sub-section:FD8300AB-5E59-4670-B09C-D71D744EADF7_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FD8300AB-5E59-4670-B09C-D71D744EADF7_sam|text=|trigger=button}{sub-section}{sub-section:FD8300AB-5E59-4670-B09C-D71D744EADF7_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=09300B9F-F759-4907-8445-92507B0CCCF1}{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:09300B9F-F759-4907-8445-92507B0CCCF1_des|text=|trigger=button}{sub-section}{sub-section:09300B9F-F759-4907-8445-92507B0CCCF1_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:09300B9F-F759-4907-8445-92507B0CCCF1_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:09300B9F-F759-4907-8445-92507B0CCCF1_prs|trigger=none}\[message\] -- The test description/message. object -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:09300B9F-F759-4907-8445-92507B0CCCF1_ret|text=|trigger=button}{sub-section}{sub-section:09300B9F-F759-4907-8445-92507B0CCCF1_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:09300B9F-F759-4907-8445-92507B0CCCF1_see|text=|trigger=button}{sub-section}{sub-section:09300B9F-F759-4907-8445-92507B0CCCF1_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:09300B9F-F759-4907-8445-92507B0CCCF1_see|text=|trigger=button}{sub-section}{sub-section:09300B9F-F759-4907-8445-92507B0CCCF1_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:09300B9F-F759-4907-8445-92507B0CCCF1_sam|text=|trigger=button}{sub-section}{sub-section:09300B9F-F759-4907-8445-92507B0CCCF1_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=B6675481-2091-40BB-9581-69D158066BAC}{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:B6675481-2091-40BB-9581-69D158066BAC_des|text=|trigger=button}{sub-section}{sub-section:B6675481-2091-40BB-9581-69D158066BAC_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:B6675481-2091-40BB-9581-69D158066BAC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B6675481-2091-40BB-9581-69D158066BAC_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:B6675481-2091-40BB-9581-69D158066BAC_ret|text=|trigger=button}{sub-section}{sub-section:B6675481-2091-40BB-9581-69D158066BAC_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B6675481-2091-40BB-9581-69D158066BAC_see|text=|trigger=button}{sub-section}{sub-section:B6675481-2091-40BB-9581-69D158066BAC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B6675481-2091-40BB-9581-69D158066BAC_see|text=|trigger=button}{sub-section}{sub-section:B6675481-2091-40BB-9581-69D158066BAC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B6675481-2091-40BB-9581-69D158066BAC_sam|text=|trigger=button}{sub-section}{sub-section:B6675481-2091-40BB-9581-69D158066BAC_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=1AC4DADA-542E-4AD8-8DF2-499FDF69A33D}{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:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_des|text=|trigger=button}{sub-section}{sub-section:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_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:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_prs|trigger=none}\[message\] -- The test description/message. definedObject -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_ret|text=|trigger=button}{sub-section}{sub-section:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_see|text=|trigger=button}{sub-section}{sub-section:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_see|text=|trigger=button}{sub-section}{sub-section:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_sam|text=|trigger=button}{sub-section}{sub-section:1AC4DADA-542E-4AD8-8DF2-499FDF69A33D_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=A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC}{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:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_des|text=|trigger=button}{sub-section}{sub-section:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_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:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_prs|trigger=none}\[message\] -- The test description/message. nullValue -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_ret|text=|trigger=button}{sub-section}{sub-section:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_see|text=|trigger=button}{sub-section}{sub-section:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_see|text=|trigger=button}{sub-section}{sub-section:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_sam|text=|trigger=button}{sub-section}{sub-section:A15A84D4-B9C3-4F7E-8710-2FCB82F46DAC_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=AC7786CF-09DB-4705-8C93-BFA7D9F49316}{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:AC7786CF-09DB-4705-8C93-BFA7D9F49316_des|text=|trigger=button}{sub-section}{sub-section:AC7786CF-09DB-4705-8C93-BFA7D9F49316_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:AC7786CF-09DB-4705-8C93-BFA7D9F49316_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:AC7786CF-09DB-4705-8C93-BFA7D9F49316_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:AC7786CF-09DB-4705-8C93-BFA7D9F49316_ret|text=|trigger=button}{sub-section}{sub-section:AC7786CF-09DB-4705-8C93-BFA7D9F49316_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:AC7786CF-09DB-4705-8C93-BFA7D9F49316_see|text=|trigger=button}{sub-section}{sub-section:AC7786CF-09DB-4705-8C93-BFA7D9F49316_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:AC7786CF-09DB-4705-8C93-BFA7D9F49316_see|text=|trigger=button}{sub-section}{sub-section:AC7786CF-09DB-4705-8C93-BFA7D9F49316_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:AC7786CF-09DB-4705-8C93-BFA7D9F49316_sam|text=|trigger=button}{sub-section}{sub-section:AC7786CF-09DB-4705-8C93-BFA7D9F49316_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=464CA867-A202-4DC1-B208-0F838D47E3D4}{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:464CA867-A202-4DC1-B208-0F838D47E3D4_des|text=|trigger=button}{sub-section}{sub-section:464CA867-A202-4DC1-B208-0F838D47E3D4_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:464CA867-A202-4DC1-B208-0F838D47E3D4_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:464CA867-A202-4DC1-B208-0F838D47E3D4_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:464CA867-A202-4DC1-B208-0F838D47E3D4_ret|text=|trigger=button}{sub-section}{sub-section:464CA867-A202-4DC1-B208-0F838D47E3D4_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:464CA867-A202-4DC1-B208-0F838D47E3D4_see|text=|trigger=button}{sub-section}{sub-section:464CA867-A202-4DC1-B208-0F838D47E3D4_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:464CA867-A202-4DC1-B208-0F838D47E3D4_see|text=|trigger=button}{sub-section}{sub-section:464CA867-A202-4DC1-B208-0F838D47E3D4_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:464CA867-A202-4DC1-B208-0F838D47E3D4_sam|text=|trigger=button}{sub-section}{sub-section:464CA867-A202-4DC1-B208-0F838D47E3D4_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=AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA}{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:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_des|text=|trigger=button}{sub-section}{sub-section:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_des|trigger=none|class=sIndent}Asserts that an object is undefined
null.
prs

Parameters

sIndentobjectthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertNotNullname

assertNotNull(message, object)

dessIndent
Asserts that an object is not null. AssertionFailedError is thrown if the object is not null.
prs

Parameters

sIndentmessageThe test description/message.objectthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertNotSamename

assertNotSame(notExpected, actual)

dessIndent
Asserts that two values are not the same. AssertionFailedError is thrown if the expected 
object
value is 
defined.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_prs|trigger=none}\[message\] -- The test description/message. undefinedValue -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_ret|text=|trigger=button}{sub-section}{sub-section:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_see|text=|trigger=button}{sub-section}{sub-section:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_see|text=|trigger=button}{sub-section}{sub-section:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_sam|text=|trigger=button}{sub-section}{sub-section:AA4DBF68-CBCA-41F8-A35A-C6D7B92825AA_sam|class=sIndent|trigger=none}{code:language=javascript} //
the actual one.
prs

Parameters

sIndentnotExpectedthe value that is not expected.actualthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertNotSamename

assertNotSame(message, notExpected, actual)

dessIndent
Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one.
prs

Parameters

sIndentmessageThe test description/message.notExpectedthe value that is not expected.actualthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertNotUndefinedname

assertNotUndefined(definedObject)

dessIndent
Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.
prs

Parameters

sIndentdefinedObjectthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertNotUndefinedname

assertNotUndefined(message, definedObject)

dessIndent
Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.
prs

Parameters

sIndentmessageThe test description/message.definedObjectthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertNullname

assertNull(nullValue)

dessIndent
Asserts that an object is 
undefined
null. 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=6ACF5069-C6B9-4A6F-8237-BEC8861082DD}{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:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_des|text=|trigger=button}{sub-section}{sub-section:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_des|trigger=none|class=sIndent}Fails a test. AssertionFailedError is always thrown.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_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:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_ret|text=|trigger=button}{sub-section}{sub-section:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_see|text=|trigger=button}{sub-section}{sub-section:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_see|text=|trigger=button}{sub-section}{sub-section:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_sam|text=|trigger=button}{sub-section}{sub-section:6ACF5069-C6B9-4A6F-8237-BEC8861082DD_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}
 is thrown if the object is not null.
prs

Parameters

sIndentnullValuethe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertNullname

assertNull(message, nullValue)

dessIndent
Asserts that an object is null. AssertionFailedError is thrown if the object is not null.
prs

Parameters

sIndentmessageThe test description/message.nullValuethe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertSamename

assertSame(expected, actual)

dessIndent
Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.
prs

Parameters

sIndentexpectedthe expected value.actualthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertSamename

assertSame(message, expected, actual)

dessIndent
Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.
prs

Parameters

sIndentmessageThe test description/message.expectedthe expected value.actualthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertTruename

assertTrue(boolean_condition)

dessIndent
Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.
prs

Parameters

sIndentboolean_conditionthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertTruename

assertTrue(message, boolean_condition)

dessIndent
Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.
prs

Parameters

sIndentmessageThe test description/message.boolean_conditionthe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertUndefinedname

assertUndefined(undefinedValue)

dessIndent
Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
prs

Parameters

sIndentundefinedValuethe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
assertUndefinedname

assertUndefined(message, undefinedValue)

dessIndent
Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
prs

Parameters

sIndentmessageThe test description/message.undefinedValuethe actual value.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
failname

fail(message)

dessIndent
Fails a test. AssertionFailedError is always thrown.
prs

Parameters

sIndentmessageThe test description/message. This is usually the only parameter specified when calling this method.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
failname

fail(message, instanceOfCallStack)

dessIndent
Fails a test. AssertionFailedError is always thrown.
prs

Parameters

sIndentmessageThe test description/message. This is usually the only parameter specified when calling this method.instanceOfCallStackan internal JSUnit call stack. Use null for this if you want to get to the next optional parameter. Usually not specified.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
failname

fail(message, instanceOfCallStack, userMessage)

dessIndent
Fails a test. AssertionFailedError is always thrown.
prs

Parameters

sIndentmessageThe test description/message. This is usually the only parameter specified when calling this method.instanceOfCallStackan internal JSUnit call stack. Use null for this if you want to get to the next optional parameter. Usually not specified.userMessagea user message. Usually not specified.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow