Child pages
  • JSUnit

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{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:id=|class=servoy sSummerysSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method SummerySummary{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#assertEquals]\(\[message\]message, expected, boolean_conditionactual)
Asserts that atwo conditionvalues isare falseequal.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertFloatEquals#assertFalse]\(\[message\], expectedFloat, actualFloat, toleranceboolean_condition)
Asserts that twoa floatingcondition point values are equal to within a given toleranceis false.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertMatches#assertFalse]\(\[message\], regularExpression, actualStringboolean_condition)
Asserts that a regularcondition expression matches a stringis false.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNotNull#assertFloatEquals]\(\[message\]expectedFloat, actualFloat, objecttolerance)
Asserts that an object is not null two floating point values are equal to within a given tolerance.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNotSame#assertFloatEquals]\(\[message\]message, expectedFloat, notExpectedactualFloat, actualtolerance)
Asserts that two floating point values are not the sameequal to within a given tolerance.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNotUndefined#assertMatches]\(\[message\]regularExpression, definedObjectactualString)
Asserts that a anregular objectexpression ismatches nota undefinedstring.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNull#assertMatches]\(\[message\]message, regularExpression, nullValueactualString)
Asserts that a regular anexpression objectmatches isa nullstring.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertSame#assertNotNull]\(\[message\], expected, actualobject)
Asserts that twoan valuesobject areis thenot samenull.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertTrue#assertNotNull]\(\[message\], boolean_conditionobject)
Asserts that aan conditionobject is not truenull.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertUndefined#assertNotSame]\(\[message\]notExpected, undefinedValueactual)
Asserts that antwo object isvalues are not the same.{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]\(definedObject)
Asserts that an object is not undefined.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#fail#assertNotUndefined]\(\[message\], \[instanceOfCallStack\], \[userMessage\])
Fails a test.{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=assertEqualsmessage, definedObject)
Asserts that an object is not undefined.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNull]\(nullValue)
Asserts that an object is null.{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]\(expected, actual)
Asserts that two values are the same.{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]\(boolean_condition)
Asserts that a condition is true.{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]\(undefinedValue)
Asserts that an object is undefined.{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)
Fails a test.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#fail]\(message, instanceOfCallStack)
Fails a test.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#fail]\(message, instanceOfCallStack, userMessage)
Fails a test.{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=assertEquals-Object_Object|class=node}{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;}\(expected, actual){span}{td}{tr}{tr:id=des}{td}{sub-section:assertEquals-Object_Object_des|text=|trigger=button}{sub-section}{sub-section:assertEquals-Object_Object_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}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertEquals-Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:assertEquals-Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertEquals-Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:assertEquals-Object_Object_prs|trigger=none|class=sIndent}\{[Object]} expected -- the expected value.
\{[Object]} actual -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertEquals-Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:assertEquals-Object_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertEquals-Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertEquals-Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertEquals-Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertEquals-Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertEquals-Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertEquals-Object_Object_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertEquals-String_Object_Object|class=node}{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:assertEquals-String_Object_Object_des|text=|trigger=button}{sub-section}{sub-section:assertEquals-String_Object_Object_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}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertEquals-String_Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:assertEquals-String_Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertEquals-String_Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:assertEquals-String_Object_Object_prs|trigger=none|class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} expected -- the expected value.
\{[Object]} actual -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertEquals-String_Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:assertEquals-String_Object_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertEquals-String_Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertEquals-String_Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertEquals-String_Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertEquals-String_Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertEquals-String_Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertEquals-String_Object_Object_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFalse-Boolean|class=node}{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;}\(boolean_condition){span}{td}{tr}{tr:id=des}{td}{sub-section:assertFalse-Boolean_des|text=|trigger=button}{sub-section}{sub-section:assertFalse-Boolean_des|trigger=none|class=sIndent}Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertFalse-Boolean_snc|text=|trigger=button}{sub-section}{sub-section:assertFalse-Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertFalse-Boolean_prs|text=|trigger=button}{sub-section}{sub-section:assertFalse-Boolean_prs|trigger=none|class=sIndent}\{[Boolean]} boolean_condition -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertFalse-Boolean_ret|text=|trigger=button}{sub-section}{sub-section:assertFalse-Boolean_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertFalse-Boolean_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFalse-Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertFalse-Boolean_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFalse-Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertFalse-Boolean_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFalse-Boolean_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFalse-String_Boolean|class=node}{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:assertFalse-String_Boolean_des|text=|trigger=button}{sub-section}{sub-section:assertFalse-String_Boolean_des|trigger=none|class=sIndent}Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertFalse-String_Boolean_snc|text=|trigger=button}{sub-section}{sub-section:assertFalse-String_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertFalse-String_Boolean_prs|text=|trigger=button}{sub-section}{sub-section:assertFalse-String_Boolean_prs|trigger=none|class=sIndent}\{[String]} message -- The test description/message.
\{[Boolean]} boolean_condition -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertFalse-String_Boolean_ret|text=|trigger=button}{sub-section}{sub-section:assertFalse-String_Boolean_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertFalse-String_Boolean_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFalse-String_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertFalse-String_Boolean_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFalse-String_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertFalse-String_Boolean_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFalse-String_Boolean_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFloatEquals-Number_Number_Number|class=node}{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;}\(expectedFloat, actualFloat, tolerance){span}{td}{tr}{tr:id=des}{td}{sub-section:assertFloatEquals-Number_Number_Number_des|text=|trigger=button}{sub-section}{sub-section:assertFloatEquals-Number_Number_Number_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}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertFloatEquals-Number_Number_Number_snc|text=|trigger=button}{sub-section}{sub-section:assertFloatEquals-Number_Number_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertFloatEquals-Number_Number_Number_prs|text=|trigger=button}{sub-section}{sub-section:assertFloatEquals-Number_Number_Number_prs|trigger=none|class=sIndent}\{[Number]} expectedFloat -- the expected value.
\{[Number]} actualFloat -- the actual value.
\{[Number]} tolerance -- tolerance when comparing.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertFloatEquals-Number_Number_Number_ret|text=|trigger=button}{sub-section}{sub-section:assertFloatEquals-Number_Number_Number_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertFloatEquals-Number_Number_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFloatEquals-Number_Number_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertFloatEquals-Number_Number_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFloatEquals-Number_Number_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertFloatEquals-Number_Number_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFloatEquals-Number_Number_Number_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFloatEquals-String_Number_Number_Number|class=node}{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:assertFloatEquals-String_Number_Number_Number_des|text=|trigger=button}{sub-section}{sub-section:assertFloatEquals-String_Number_Number_Number_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}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertFloatEquals-String_Number_Number_Number_snc|text=|trigger=button}{sub-section}{sub-section:assertFloatEquals-String_Number_Number_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertFloatEquals-String_Number_Number_Number_prs|text=|trigger=button}{sub-section}{sub-section:assertFloatEquals-String_Number_Number_Number_prs|trigger=none|class=sIndent}\{[String]} message -- The test description/message.
\{[Number]} expectedFloat -- the expected value.
\{[Number]} actualFloat -- the actual value.
\{[Number]} tolerance -- tolerance when comparing.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertFloatEquals-String_Number_Number_Number_ret|text=|trigger=button}{sub-section}{sub-section:assertFloatEquals-String_Number_Number_Number_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertFloatEquals-String_Number_Number_Number_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFloatEquals-String_Number_Number_Number_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertFloatEquals-String_Number_Number_Number_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFloatEquals-String_Number_Number_Number_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertFloatEquals-String_Number_Number_Number_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFloatEquals-String_Number_Number_Number_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertMatches-Object_String|class=node}{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;}\(regularExpression, actualString){span}{td}{tr}{tr:id=des}{td}{sub-section:assertMatches-Object_String_des|text=|trigger=button}{sub-section}{sub-section:assertMatches-Object_String_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}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertMatches-Object_String_snc|text=|trigger=button}{sub-section}{sub-section:assertMatches-Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertMatches-Object_String_prs|text=|trigger=button}{sub-section}{sub-section:assertMatches-Object_String_prs|trigger=none|class=sIndent}\{[Object]} regularExpression -- the regular expression used for matching.
\{[String]} actualString -- the actual value to be matched.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertMatches-Object_String_ret|text=|trigger=button}{sub-section}{sub-section:assertMatches-Object_String_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertMatches-Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertMatches-Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertMatches-Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertMatches-Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertMatches-Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertMatches-Object_String_sam|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(new RegExp("gr(a|e)y"), "gray");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertMatches-String_Object_String|class=node}{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:assertMatches-String_Object_String_des|text=|trigger=button}{sub-section}{sub-section:assertMatches-String_Object_String_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}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertMatches-String_Object_String_snc|text=|trigger=button}{sub-section}{sub-section:assertMatches-String_Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertMatches-String_Object_String_prs|text=|trigger=button}{sub-section}{sub-section:assertMatches-String_Object_String_prs|trigger=none|class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} regularExpression -- the regular expression used for matching.
\{[String]} actualString -- the actual value to be matched.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertMatches-String_Object_String_ret|text=|trigger=button}{sub-section}{sub-section:assertMatches-String_Object_String_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertMatches-String_Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertMatches-String_Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertMatches-String_Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertMatches-String_Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertMatches-String_Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertMatches-String_Object_String_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotNull-Object|class=node}{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;}\(object){span}{td}{tr}{tr:id=des}{td}{sub-section:assertNotNull-Object_des|text=|trigger=button}{sub-section}{sub-section:assertNotNull-Object_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}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotNull-Object_snc|text=|trigger=button}{sub-section}{sub-section:assertNotNull-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNotNull-Object_prs|text=|trigger=button}{sub-section}{sub-section:assertNotNull-Object_prs|trigger=none|class=sIndent}\{[Object]} object -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNotNull-Object_ret|text=|trigger=button}{sub-section}{sub-section:assertNotNull-Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNotNull-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotNull-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNotNull-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotNull-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNotNull-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotNull-Object_sam|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(a);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotNull-String_Object|class=node}{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:assertNotNull-String_Object_des|text=|trigger=button}{sub-section}{sub-section:assertNotNull-String_Object_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}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotNull-String_Object_snc|text=|trigger=button}{sub-section}{sub-section:assertNotNull-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNotNull-String_Object_prs|text=|trigger=button}{sub-section}{sub-section:assertNotNull-String_Object_prs|trigger=none|class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} object -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNotNull-String_Object_ret|text=|trigger=button}{sub-section}{sub-section:assertNotNull-String_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNotNull-String_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotNull-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNotNull-String_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotNull-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNotNull-String_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotNull-String_Object_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotSame-Object_Object|class=node}{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;}\(notExpected, actual){span}{td}{tr}{tr:id=des}{td}{sub-section:assertNotSame-Object_Object_des|text=|trigger=button}{sub-section}{sub-section:assertNotSame-Object_Object_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}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotSame-Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:assertNotSame-Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNotSame-Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:assertNotSame-Object_Object_prs|trigger=none|class=sIndent}\{[Object]} notExpected -- the value that is not expected.
\{[Object]} actual -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNotSame-Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:assertNotSame-Object_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNotSame-Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotSame-Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNotSame-Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotSame-Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNotSame-Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotSame-Object_Object_sam|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(a, b);
jsunit.assertEquals("But equals", a, b);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotSame-String_Object_Object|class=node}{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:assertNotSame-String_Object_Object_des|text=|trigger=button}{sub-section}{sub-section:assertNotSame-String_Object_Object_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}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotSame-String_Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:assertNotSame-String_Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNotSame-String_Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:assertNotSame-String_Object_Object_prs|trigger=none|class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} notExpected -- the value that is not expected.
\{[Object]} actual -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNotSame-String_Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:assertNotSame-String_Object_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNotSame-String_Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotSame-String_Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNotSame-String_Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotSame-String_Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNotSame-String_Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotSame-String_Object_Object_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotUndefined-Object|class=node}{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;}\(definedObject){span}{td}{tr}{tr:id=des}{td}{sub-section:assertNotUndefined-Object_des|text=|trigger=button}{sub-section}{sub-section:assertNotUndefined-Object_des|trigger=none|class=sIndent}Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotUndefined-Object_snc|text=|trigger=button}{sub-section}{sub-section:assertNotUndefined-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNotUndefined-Object_prs|text=|trigger=button}{sub-section}{sub-section:assertNotUndefined-Object_prs|trigger=none|class=sIndent}\{[Object]} definedObject -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNotUndefined-Object_ret|text=|trigger=button}{sub-section}{sub-section:assertNotUndefined-Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNotUndefined-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotUndefined-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNotUndefined-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotUndefined-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNotUndefined-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotUndefined-Object_sam|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(a);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotUndefined-String_Object|class=node}{tr:id=name}{td}h6.assertEqualsassertNotUndefined{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertEqualsassertNotUndefined{span}{span:id=iets|style=float: left;}\(\[message\], expected, actualdefinedObject){span}{td}{tr}{tr:id=des}{td}{sub-section:assertEqualsassertNotUndefined-String_Object_des|text=|trigger=button}{sub-section}{sub-section:assertEqualsassertNotUndefined-String_Object_des|trigger=none|class=sIndent}Asserts that twoan object valuesis arenot equalundefined. AssertionFailedError is thrown if the actualobject value does not match the regular expressionis undefined.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertEqualsassertNotUndefined-String_Object_snc|text=|trigger=button}{sub-section}{sub-section:assertEqualsassertNotUndefined-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertEqualsassertNotUndefined-String_Object_prs|text=|trigger=button}{sub-section}{sub-section:assertEqualsassertNotUndefined-String_Object_prs|trigger=none|class=sIndent}\{[String]} message\] -- The test description/message.
expected -- the expected value.
actual \{[Object]} definedObject -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertEqualsassertNotUndefined-String_Object_ret|text=|trigger=button}{sub-section}{sub-section:assertEqualsassertNotUndefined-String_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertEqualsassertNotUndefined-String_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertEqualsassertNotUndefined-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertEqualsassertNotUndefined-String_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertEqualsassertNotUndefined-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertEqualsassertNotUndefined-String_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertEqualsassertNotUndefined-String_Object_sam|trigger=none}{code:language=javascript}
// Asserts that an twoobject valuesis arenot equalundefined. AssertionFailedError is thrown if the actualobject value does not match the regular expression.
jsunit.assertEquals("Solution name test", "someSolution", application.getSolutionName())is undefined.
var a = 0;
jsunit.assertEqualsassertNotUndefined("SimpleNot mathundefined test", 2, 1 + 1a);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFalseassertNull-Object|class=node}{tr:id=name}{td}h6.assertFalseassertNull{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertFalseassertNull{span}{span:id=iets|style=float: left;}\(\[message\], boolean_conditionnullValue){span}{td}{tr}{tr:id=des}{td}{sub-section:assertFalseassertNull-Object_des|text=|trigger=button}{sub-section}{sub-section:assertFalseassertNull-Object_des|trigger=none|class=sIndent}Asserts that aan conditionobject is falsenull. AssertionFailedError is thrown if the evaluationobject wasis not falsenull.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertFalseassertNull-Object_snc|text=|trigger=button}{sub-section}{sub-section:assertFalseassertNull-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertFalseassertNull-Object_prs|text=|trigger=button}{sub-section}{sub-section:assertFalseassertNull-Object_prs|trigger=none|class=sIndent}\{[message\] -- The test description/message.
boolean_conditionObject]} nullValue -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertFalseassertNull-Object_ret|text=|trigger=button}{sub-section}{sub-section:assertFalseassertNull-Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertFalseassertNull-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFalseassertNull-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertFalseassertNull-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFalseassertNull-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertFalseassertNull-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFalseassertNull-Object_sam|trigger=none}{code:language=javascript}
// Asserts that aan conditionobject is falsenull. AssertionFailedError is thrown if the evaluationobject wasis not falsenull.
jsunit.assertFalseassertNull("FalseNull test", application.isLastPrintPreviewPrinted()null);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFloatEqualsassertNull-String_Object|class=node}{tr:id=name}{td}h6.assertFloatEqualsassertNull{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertFloatEqualsassertNull{span}{span:id=iets|style=float: left;}\(\[message\], expectedFloat, actualFloat, tolerancenullValue){span}{td}{tr}{tr:id=des}{td}{sub-section:assertFloatEqualsassertNull-String_Object_des|text=|trigger=button}{sub-section}{sub-section:assertFloatEqualsassertNull-String_Object_des|trigger=none|class=sIndent}Asserts that twoan floatingobject point values are equal to within a given toleranceis null. AssertionFailedError is thrown if the expected valueobject is not within the tolerance of the actual one not null.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertFloatEqualsassertNull-String_Object_snc|text=|trigger=button}{sub-section}{sub-section:assertFloatEqualsassertNull-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertFloatEqualsassertNull-String_Object_prs|text=|trigger=button}{sub-section}{sub-section:assertFloatEqualsassertNull-String_Object_prs|trigger=none|class=sIndent}\{[String]} message\] -- The test description/message.
expectedFloat -- the expected value.
actualFloat \{[Object]} nullValue -- the actual value.
tolerance -- float tolerance when
comparing.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertFloatEqualsassertNull-String_Object_ret|text=|trigger=button}{sub-section}{sub-section:assertFloatEqualsassertNull-String_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertFloatEqualsassertNull-String_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFloatEqualsassertNull-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertFloatEqualsassertNull-String_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFloatEqualsassertNull-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertFloatEqualsassertNull-String_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertFloatEqualsassertNull-String_Object_sam|trigger=none}{code:language=javascript}
// Asserts that two floating point values are equal to within a given tolerance// Asserts that an object is null. AssertionFailedError is thrown if the expectedobject value is not within the tolerance of the actual onenull.
jsunit.assertFloatEqualsassertNull("FloatNull equals test", 3.12, 3.121, 0.0015null);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertMatchesassertSame-Object_Object|class=node}{tr:id=name}{td}h6.assertMatchesassertSame{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertMatchesassertSame{span}{span:id=iets|style=float: left;}\(\[message\]expected, regularExpression, actualStringactual){span}{td}{tr}{tr:id=des}{td}{sub-section:assertMatchesassertSame-Object_Object_des|text=|trigger=button}{sub-section}{sub-section:assertMatchesassertSame-Object_Object_des|trigger=none|class=sIndent}Asserts that atwo regularvalues expressionare matchesthe a stringsame. AssertionFailedError is thrown if the expected value is not the actual one.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertMatchesassertSame-Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:assertMatchesassertSame-Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertMatchesassertSame-Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:assertMatchesassertSame-Object_Object_prs|trigger=none|class=sIndent}\[message\] -- The test description/message.
regularExpression\{[Object]} expected -- the regularexpected expression used for matching.
actualStringvalue.
\{[Object]} actual -- the actual value to be matched.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertMatchesassertSame-Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:assertMatchesassertSame-Object_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertMatchesassertSame-Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertMatchesassertSame-Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertMatchesassertSame-Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertMatchesassertSame-Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertMatchesassertSame-Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertMatchesassertSame-Object_Object_sam|trigger=none}{code:language=javascript}
// Asserts that atwo regularvalues expressionare matchesthe a stringsame. AssertionFailedError is thrown if the expected value is not the actual one.
jsunit.assertMatches("Match test", new RegExp("gr(a|e)y"), "gray"var a = new Date(1990, 1, 1);
var b = a;
jsunit.assertSame(a, b);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotNullassertSame-String_Object_Object|class=node}{tr:id=name}{td}h6.assertNotNullassertSame{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNotNullassertSame{span}{span:id=iets|style=float: left;}\(\[message\]message, expected, objectactual){span}{td}{tr}{tr:id=des}{td}{sub-section:assertNotNullassertSame-String_Object_Object_des|text=|trigger=button}{sub-section}{sub-section:assertNotNullassertSame-String_Object_Object_des|trigger=none|class=sIndent}Asserts that antwo objectvalues isare notthe nullsame. AssertionFailedError is thrown if the expected objectvalue is not nullthe actual one.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotNullassertSame-String_Object_Object_snc|text=|trigger=button}{sub-section}{sub-section:assertNotNullassertSame-String_Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNotNullassertSame-String_Object_Object_prs|text=|trigger=button}{sub-section}{sub-section:assertNotNullassertSame-String_Object_Object_prs|trigger=none|class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} expected -- Thethe testexpected description/messagevalue.
object\{[Object]} actual -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNotNullassertSame-String_Object_Object_ret|text=|trigger=button}{sub-section}{sub-section:assertNotNullassertSame-String_Object_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNotNullassertSame-String_Object_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotNullassertSame-String_Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNotNullassertSame-String_Object_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotNullassertSame-String_Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNotNullassertSame-String_Object_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotNullassertSame-String_Object_Object_sam|trigger=none}{code:language=javascript}
// Asserts that antwo objectvalues isare notthe nullsame. AssertionFailedError is thrown if the expected objectvalue is not the actual nullone.
var a; //= this is undefined, not nullnew Date(1990, 1, 1);
var b = a;
jsunit.assertNotNullassertSame("Not nullSame test", a, b);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotSameassertTrue-Boolean|class=node}{tr:id=name}{td}h6.assertNotSameassertTrue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNotSameassertTrue{span}{span:id=iets|style=float: left;}\(\[message\], notExpected, actualboolean_condition){span}{td}{tr}{tr:id=des}{td}{sub-section:assertNotSameassertTrue-Boolean_des|text=|trigger=button}{sub-section}{sub-section:assertNotSameassertTrue-Boolean_des|trigger=none|class=sIndent}Asserts that twoa valuescondition are not the sameis true. AssertionFailedError is thrown if the expectedevaluation valuewas is the actual onenot true.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotSameassertTrue-Boolean_snc|text=|trigger=button}{sub-section}{sub-section:assertNotSameassertTrue-Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNotSameassertTrue-Boolean_prs|text=|trigger=button}{sub-section}{sub-section:assertNotSameassertTrue-Boolean_prs|trigger=none|class=sIndent}\{[message\Boolean]} -- The test description/message.
notExpected boolean_condition -- the value that is not expected.
actual -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNotSameassertTrue-Boolean_ret|text=|trigger=button}{sub-section}{sub-section:assertNotSameassertTrue-Boolean_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNotSameassertTrue-Boolean_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotSameassertTrue-Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNotSame:assertTrue-Boolean_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotSameassertTrue-Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNotSameassertTrue-Boolean_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotSameassertTrue-Boolean_sam|trigger=none}{code:language=javascript}
// Asserts that twoa valuescondition are not the sameis true. AssertionFailedError is thrown if the expectedevaluation valuewas 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, bnot true.
jsunit.assertTrue("True test", application.isLastPrintPreviewPrinted());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotUndefinedassertTrue-String_Boolean|class=node}{tr:id=name}{td}h6.assertNotUndefinedassertTrue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNotUndefinedassertTrue{span}{span:id=iets|style=float: left;}\(\[message\], definedObjectboolean_condition){span}{td}{tr}{tr:id=des}{td}{sub-section:assertNotUndefined:assertTrue-String_Boolean_des|text=|trigger=button}{sub-section}{sub-section:assertNotUndefinedassertTrue-String_Boolean_des|trigger=none|class=sIndent}Asserts that ana objectcondition is not undefinedtrue. AssertionFailedError is thrown if the objectevaluation was isnot undefinedtrue.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotUndefinedassertTrue-String_Boolean_snc|text=|trigger=button}{sub-section}{sub-section:assertNotUndefinedassertTrue-String_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNotUndefinedassertTrue-String_Boolean_prs|text=|trigger=button}{sub-section}{sub-section:assertNotUndefinedassertTrue-String_Boolean_prs|trigger=none|class=sIndent}\{[String]} message\] -- The test description/message.
definedObject
\{[Boolean]} boolean_condition -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNotUndefinedassertTrue-String_Boolean_ret|text=|trigger=button}{sub-section}{sub-section:assertNotUndefinedassertTrue-String_Boolean_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNotUndefinedassertTrue-String_Boolean_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotUndefinedassertTrue-String_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNotUndefinedassertTrue-String_Boolean_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotUndefinedassertTrue-String_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNotUndefinedassertTrue-String_Boolean_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNotUndefinedassertTrue-String_Boolean_sam|trigger=none}{code:language=javascript}
// Asserts that ana objectcondition is not undefinedtrue. AssertionFailedError is thrown if the object is undefined.
var a = 0;evaluation was not true.
jsunit.assertNotUndefinedassertTrue("Not undefinedTrue test", aapplication.isLastPrintPreviewPrinted());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNullassertUndefined-Object|class=node}{tr:id=name}{td}h6.assertNullassertUndefined{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNullassertUndefined{span}{span:id=iets|style=float: left;}\(\[message\], nullValueundefinedValue){span}{td}{tr}{tr:id=des}{td}{sub-section:assertNullassertUndefined-Object_des|text=|trigger=button}{sub-section}{sub-section:assertNullassertUndefined-Object_des|trigger=none|class=sIndent}Asserts that an object is nullundefined. AssertionFailedError is thrown if the object is not nulldefined.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNullassertUndefined-Object_snc|text=|trigger=button}{sub-section}{sub-section:assertNullassertUndefined-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNullassertUndefined-Object_prs|text=|trigger=button}{sub-section}{sub-section:assertNullassertUndefined-Object_prs|trigger=none|class=sIndent}\{[message\Object] -- The test description/message.
nullValue } undefinedValue -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNullassertUndefined-Object_ret|text=|trigger=button}{sub-section}{sub-section:assertNullassertUndefined-Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNullassertUndefined-Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNullassertUndefined-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNullassertUndefined-Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNullassertUndefined-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNullassertUndefined-Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertNullassertUndefined-Object_sam|trigger=none}{code:language=javascript}
// Asserts that an object is nullundefined. AssertionFailedError is thrown if the object is not nulldefined.
jsunit.assertNullassertUndefined("NullUndefined test", nullthisIsUndefined);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertSameassertUndefined-String_Object|class=node}{tr:id=name}{td}h6.assertSameassertUndefined{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertSameassertUndefined{span}{span:id=iets|style=float: left;}\(\[message\], expected, actualundefinedValue){span}{td}{tr}{tr:id=des}{td}{sub-section:assertSameassertUndefined-String_Object_des|text=|trigger=button}{sub-section}{sub-section:assertSameassertUndefined-String_Object_des|trigger=none|class=sIndent}Asserts that twoan valuesobject areis the sameundefined. AssertionFailedError is thrown if the expected valueobject is not the actual onedefined.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertSameassertUndefined-String_Object_snc|text=|trigger=button}{sub-section}{sub-section:assertSameassertUndefined-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertSameassertUndefined-String_Object_prs|text=|trigger=button}{sub-section}{sub-section:assertSameassertUndefined-String_Object_prs|trigger=none|class=sIndent}\{[String]} message\] -- The test description/message.
expected -- the expected value.
actual \{[Object]} undefinedValue -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertSameassertUndefined-String_Object_ret|text=|trigger=button}{sub-section}{sub-section:assertSameassertUndefined-String_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertSameassertUndefined-String_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertSameassertUndefined-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertSameassertUndefined-String_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertSameassertUndefined-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertSameassertUndefined-String_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertSameassertUndefined-String_Object_sam|trigger=none}{code:language=javascript}
// Asserts that twoan valuesobject areis the sameundefined. AssertionFailedError is thrown if the expected valueobject is not the actual one.
var a = new Date(1990, 1, 1);
var b = a;
jsunit.assertSame("Same test", a, bdefined.
jsunit.assertUndefined(thisIsUndefined);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertTruefail-String|class=node}{tr:id=name}{td}h6.assertTruefail{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertTruefail{span}{span:id=iets|style=float: left;}\(\[message\], boolean_condition){span}{td}{tr}{tr:id=des}{td}{sub-section:assertTruefail-String_des|text=|trigger=button}{sub-section}{sub-section:assertTruefail-String_des|trigger=none|class=sIndent}Asserts thatFails a condition is truetest. AssertionFailedError is thrown if the evaluation was not truealways thrown.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertTruefail-String_snc|text=|trigger=button}{sub-section}{sub-section:assertTruefail-String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertTruefail-String_prs|text=|trigger=button}{sub-section}{sub-section:assertTruefail-String_prs|trigger=none|class=sIndent}\{[String]} message\] -- The test description/message. This boolean_condition --is usually the actual valueonly parameter specified when calling this method.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertTruefail-String_ret|text=|trigger=button}{sub-section}{sub-section:assertTruefail-String_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertTruefail-String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertTruefail-String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertTruefail-String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertTruefail-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertTruefail-String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertTruefail-String_sam|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: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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertUndefinedfail-String_Object|class=node}{tr:id=name}{td}h6.assertUndefinedfail{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertUndefinedfail{span}{span:id=iets|style=float: left;}\(\[message\], undefinedValueinstanceOfCallStack){span}{td}{tr}{tr:id=des}{td}{sub-section:assertUndefinedfail-String_Object_des|text=|trigger=button}{sub-section}{sub-section:assertUndefinedfail-String_Object_des|trigger=none|class=sIndent}AssertsFails that an object is undefineda test. AssertionFailedError is thrown if the object is definedalways thrown.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertUndefinedfail-String_Object_snc|text=|trigger=button}{sub-section}{sub-section:assertUndefinedfail-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertUndefinedfail-String_Object_prs|text=|trigger=button}{sub-section}{sub-section:assertUndefinedfail-String_Object_prs|trigger=none|class=sIndent}\{[String]} message\] -- The test description/message.
undefinedValue This is usually the only parameter specified when calling this method.
\{[Object]} instanceOfCallStack -- an internal JSUnit call stack. Use null for this if you want to get to the actual value next optional parameter. Usually not specified.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertUndefinedfail-String_Object_ret|text=|trigger=button}{sub-section}{sub-section:assertUndefinedfail-String_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertUndefinedfail-String_Object_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertUndefined:fail-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertUndefinedfail-String_Object_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertUndefinedfail-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertUndefinedfail-String_Object_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:assertUndefinedfail-String_Object_sam|trigger=none}{code:language=javascript}
// AssertsFails thata antest. objectAssertionFailedError is undefined. AssertionFailedError is thrown if the object is defined.
jsunit.assertUndefined("Undefined test", thisIsUndefined);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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=fail-String_Object_String|class=node}{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:fail-String_Object_String_des|text=|trigger=button}{sub-section}{sub-section:fail-String_Object_String_des|trigger=none|class=sIndent}Fails a test. AssertionFailedError is always thrown.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:fail-String_Object_String_snc|text=|trigger=button}{sub-section}{sub-section:fail-String_Object_String_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:fail-String_Object_String_prs|text=|trigger=button}{sub-section}{sub-section:fail-String_Object_String_prs|trigger=none|class=sIndent}\{[String]} message\] -- The test description/message. This is usually the only parameter specified when calling this method.
\{[Object]} instanceOfCallStack\] -- an internal JSUnit call stack. Use null for this if you want to get to the next optional parameter. Usually not specified.
\{[String]} userMessage\] -- ana user message. Usually not specified.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:fail-String_Object_String_ret|text=|trigger=button}{sub-section}{sub-section:fail-String_Object_String_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:fail-String_Object_String_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:fail-String_Object_String_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:fail-String_Object_String_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:fail-String_Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:fail-String_Object_String_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:fail-String_Object_String_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}