Child pages
  • JSUnit

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hiddendiv:style=display:none}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACTAUTO CHANGES FROMUPDATE THE PAGECONTENT ANDTHROUGH MERGETHE THEM BACK INTO SERVOY SOURCE{hiddenDOC GENERATOR{div}
{sub-sectiondiv:description|text=}Servoy has built-in support for Unit Testing. The integration adds the following to the Servoy environment:
* A JSUnit node to the Solution Explorer, exposing the assert functions used in testcases
* An entry in the content menu of the Active Solution to run the Unit Tests
* A J(S)Unit view for viewing the results of a testrun

Creating testcases is as straightforward as creating a function with a name that starts with 'test_':

{code}
function test_thisShouldPass() {
 jsunit.assertEquals('This test should pass', true, 5 < 10);
}

function test_thisShouldFail() {
 jsunit.assertEquals('This test should fail', true, 10 < 5);
}
{code}

The JSUnit node in the Solution Explorer provides easy access to the different supported assert functions

Testcases can be added on application level in the global scope of on form level in the form scope.

Each scope can contain a setUp and/or tearDown function. The setUp function is called BEFORE running each testcase in the scope and the tearDown function is called AFTER running each test in the scope. The setUp and tearDown function allow the developer to create the right circumstances for testcases to run and cleanup afterwards. Note that the setUp() and tearDown() methods are called before and after EACH test methods, as each single test is supposed to be independant.
{code}
function setUp() {
  //Code here to setup the environment for the testcases in this scope
}
function tearDown() {
  //Code here to cleanup the environment after running the testcases in this scope
}
{code}{sub-section}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{trid=description}{div}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}void{td}{td}[#assertEquals]\(expected, actual)
Asserts that two values are equal.{td}{tr}{tbody}{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]\(boolean_condition)
Asserts that a condition is false.{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]\(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}[#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]\(regularExpression, actualString)
Asserts that a regular expression matches a string.{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]\(object)
Asserts that an object is not null.{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]\(notExpected, actual)
Asserts that two values 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}[#assertNotUndefined]\(message, 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}[#assertEquals#assertSame]\(expected, actual)
Asserts that two values are equalthe same.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertEquals#assertSame]\(message, expected, actual)
Asserts that two values are equalthe same.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertFalse#assertTrue]\(boolean_condition)
Asserts that a condition is falsetrue.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertFalse#assertTrue]\(message, boolean_condition)
Asserts that a condition is falsetrue.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertFloatEquals#assertUndefined]\(expectedFloat, actualFloat, toleranceundefinedValue)
Asserts that twoan floatingobject point values are equal to within a given toleranceis undefined.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertFloatEquals#assertUndefined]\(message, expectedFloat, actualFloat, toleranceundefinedValue)
Asserts that twoan floatingobject point values are equal to within a given toleranceis undefined.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertMatches#fail]\(regularExpression, actualStringmessage)
Asserts thatFails a regular expression matches a stringtest.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertMatches#fail]\(message, regularExpression, actualStringinstanceOfCallStack)
Asserts thatFails a regular expression matches a stringtest.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNotNull#fail]\(object)
Asserts that an object is not nullmessage, instanceOfCallStack, userMessage)
Fails a test.{td}{tr}{tbody}{table}{tbody\\ 

{table:id=function|class=servoy sDetail}{trcolgroup}{td}void{td}{td}[#assertNotNull]\(message, object)
Asserts that an object is not null.{tdcolumn:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody}{tbody:id=assertEquals-Object_Object}{tr:id=name}{td}voidh6.assertEquals{td}{td}[#assertNotSame]\(notExpected, actual)
Asserts that two values are not the same.{tdtr}{tr:id=sig}{tbodytd}{tbody}{tr}{td}void{td}{td}[#assertNotSame]\(message, notExpected, actual)
Asserts that two values are not the same.span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertEquals{span}{span}\(expected, actual){span}{td}{tr}{tbody}{tbody}{tr:id=prs}{td}void{td}{td}[#assertNotUndefined]\(definedObject)
Asserts that an object is not undefined.{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]\(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)*Parameters*\\{div:class=sIndent}\{[Object]} expected -- the expected value.
\{[Object]} actual -- the actual value.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertEquals-String_Object_Object}{tr:id=name}{td}h6.assertEquals{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertEquals{span}{span}\(message, expected, actual){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} expected -- the expected value.
\{[Object]} actual -- the actual value.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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}{ 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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFalse-Boolean}{tr:id=name}{td}voidh6.assertFalse{td}{td}[#assertTrue]\(message, boolean_condition)
Asserts that a condition is true.tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertFalse{span}{span}\(boolean_condition){span}{td}{tr}{tbody}{tbody}{trtr:id=prs}{td}void{td}{td}[#assertUndefined]\(undefinedValue)
Asserts that an object is undefined.*Parameters*\\{div:class=sIndent}\{[Boolean]} boolean_condition -- the actual value.
{div}{td}{tr}{tbody}{tbody}{tr:id=ret}{td}void{td}{td}[#assertUndefined]\(message, undefinedValue)
Asserts that an object is undefined.*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tbody}{tbody}{trtr:id=sam}{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}{*Sample*\\{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFalse-String_Boolean}{tr:id=name}{td}void{td}{td}[#fail]\(message, instanceOfCallStack, userMessage)
Fails a test.h6.assertFalse{td}{tr}{tbody}{table}\\ 

{tabletr:id=function|class=servoy sDetailsig}{colgrouptd}{columnspan:width=100%|padding=0px}{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.assertEqualsstyle=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertFalse{span}{span}\(message, boolean_condition){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[Boolean]} boolean_condition -- the actual value.
{div}{td}{tr}{tr:id=sigret}{td}*Returns*\\{spandiv: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){spanclass=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{builder-showtbody:permission=editid=assertFloatEquals-Number_Number_Number}{tr:id=desname}{td}{sub-section:assertEquals-Object_Object_des|trigger=button|text=}{sub-section}{sub-section:assertEquals-Object_Object_des|trigger=none|class=sIndent}Replace with description{sub-sectionh6.assertFloatEquals{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertFloatEquals{span}{span}\(expectedFloat, actualFloat, tolerance){span}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sncprs}{td}*SinceParameters*\\{sub-section:assertEquals-Object_Object_snc|trigger=button|text=}{sub-section}{sub-section:assertEquals-Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-sectiondiv:class=sIndent}\{[Number]} expectedFloat -- the expected value.
\{[Number]} actualFloat -- the actual value.
\{[Number]} tolerance -- tolerance when comparing.
{div}{td}{tr}{builder-show}{tr:id=prsret}{td}*ParametersReturns*\\{sub-section:assertEquals-Object_Object_prs|trigger=button|text=}{sub-section}{sub-section:assertEquals-Object_Object_prs|trigger=none|div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}\{[Object]} expected --{code:language=javascript}
// Asserts that two floating point values are equal to within a given tolerance. AssertionFailedError is thrown if the expected value.
\{[Object]} actual -- is not within the tolerance of the actual value.
{sub-section one.
jsunit.assertFloatEquals("Float equals test", 3.12, 3.121, 0.0015);
{code}{div}{td}{tr}{tr:idclass=retlastDetailRow}{td}*Returns*\\{sub-section:assertEquals-Object_Object_ret|trigger=button|text=}{sub-section}{sub-section:assertEquals-Object_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{tbody}{tbody:id=assertFloatEquals-String_Number_Number_Number}{tr:id=name}{td}h6.assertFloatEquals{td}{tr}{builder-show:permission=edit}{tr:id=seesig}{td}*Also see*\\{sub-section:assertEquals-Object_Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertEquals-Object_Object_see|trigger=none}{sub-section}{div{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertFloatEquals{span}{span}\(message, expectedFloat, actualFloat, tolerance){span}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkprs}{td}*External linksParameters*\\{sub-section:assertEquals-Object_Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertEquals-Object_Object_link|trigger=none}{sub-section}{\{[String]} message -- The test description/message.
\{[Number]} expectedFloat -- the expected value.
\{[Number]} actualFloat -- the actual value.
\{[Number]} tolerance -- tolerance when comparing.
{div}{td}{tr}{builder-show}{tr:id=samret}{td}*SampleReturns*\\{sub-section:assertEquals-Object_Object_sam|trigger=button|text=}{sub-section}div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{sub-section:assertEquals-Object_Object_sam|trigger=none}{code:language=javascript}
// Asserts that two floating point values are equal to within a given tolerance. AssertionFailedError is thrown if the actualexpected value doesis not matchwithin the regulartolerance expression.
jsunit.assertEquals("Solution name test", "someSolution", application.getSolutionName());of the actual one.
jsunit.assertEqualsassertFloatEquals("SimpleFloat mathequals test", 23.12, 1 + 13.121, 0.0015);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertEqualsassertMatches-String_Object_Object|class=nodeString}{tr:id=name}{td}h6.assertEqualsassertMatches{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertEqualsassertMatches{span}{span:id=iets|style=float: left;}\(messageregularExpression, expected, actualactualString){span}{td}{tr}{builder-show:permission=edit}{tr:id=desprs}{td}{sub-section:assertEquals-String_Object_Object_des|trigger=button|text=}{sub-section}{sub-section:assertEquals-String_Object_Object_des|trigger=none|class=sIndent}Replace with description{sub-section*Parameters*\\{div:class=sIndent}\{[Object]} regularExpression -- the regular expression used for matching.
\{[String]} actualString -- the actual value to be matched.
{div}{td}{tr}{builder-show}{builder-show:permission=edittr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sncsam}{td}*SinceSample*\\{sub-section:assertEquals-String_Object_Object_snc|trigger=button|text=}{sub-section}{sub-section:assertEquals-String_Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-sectiondiv:class=sIndent}{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}{div}{td}{tr}{builder-show}{tr:idclass=prslastDetailRow}{td}*Parameters*\\{sub-section:assertEquals-String_Object_Object_prs|trigger=button|text=}{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}{tbody}{tbody:id=assertMatches-String_Object_String}{tr:id=name}{td}h6.assertMatches{td}{tr}{tr:id=retsig}{td}*Returns*\\{sub-section:assertEquals-String_Object_Object_ret|trigger=button|text=}{sub-section}{sub-section:assertEquals-String_Object_Object_ret|trigger=none|class=sIndent}void{sub-section{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertMatches{span}{span}\(message, regularExpression, actualString){span}{td}{tr}{builder-show:permission=edit}{tr:id=seeprs}{td}*Also seeParameters*\\{sub-section:assertEquals-String_Object_Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertEquals-String_Object_Object_see|trigger=none}{sub-section}\{[String]} message -- The test description/message.
\{[Object]} regularExpression -- the regular expression used for matching.
\{[String]} actualString -- the actual value to be matched.
{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkret}{td}*External linksReturns*\\{sub-section:assertEquals-String_Object_Object_link|trigger=button|text=}{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|trigger=button|text=}{sub-section}{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{sub-section:assertEquals-String_Object_Object_sam|trigger=none}{code:language=javascript}
// Asserts that a regular twoexpression valuesmatches area equalstring. AssertionFailedError is thrown if the actualexpected value doesis not match the regularactual expressionone.
jsunit.assertEqualsassertMatches("Solution nameMatch test", "someSolution", application.getSolutionName());
jsunit.assertEquals("Simple math test", 2, 1 + 1new RegExp("gr(a|e)y"), "gray");
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFalse-Boolean|class=nodeassertNotNull-Object}{tr:id=name}{td}h6.assertFalseassertNotNull{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertFalseassertNotNull{span}{span:id=iets|style=float: left;}\(boolean_conditionobject){span}{td}{tr}{builder-show:permission=edit}{tr:id=desprs}{td}{sub-section:assertFalse-Boolean_des|trigger=button|text=}{sub-section}{sub-section:assertFalse-Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section*Parameters*\\{div:class=sIndent}\{[Object]} object -- the actual value.
{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sncret}{td}*SinceReturns*\\{sub-section:assertFalse-Boolean_snc|trigger=button|text=}{sub-section}{sub-section:assertFalse-Boolean_snc|trigger=none|div:class=sIndent} Replace with version info{sub-sectionvoid{div}{td}{tr}{builder-show}{tr:id=prssam}{td}*ParametersSample*\\{sub-section:assertFalse-Boolean_prs|trigger=button|text=}{sub-section}{sub-section:assertFalse-Boolean_prs|trigger=none|class=sIndent}\{[Boolean]} boolean_condition -- the actual value.
{sub-sectiondiv:class=sIndent}{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}{div}{td}{tr}{tr:id=retclass=lastDetailRow}{td}{td}*Returns*\\{sub-section:assertFalse-Boolean_ret|trigger=button|text=}{sub-section}{sub-section:assertFalse-Boolean_ret|trigger=none|class=sIndent}void{sub-section}{tr}{tbody}{tbody:id=assertNotNull-String_Object}{tr:id=name}{td}h6.assertNotNull{td}{tr}{builder-show:permission=edit}{tr:id=seesig}{td}*Also see*\\{sub-section:assertFalse-Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertFalse-Boolean_see|trigger=none}{sub-section}{div{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertNotNull{span}{span}\(message, object){span}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkprs}{td}*Parameters*External links*\\{sub-section:assertFalse-Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertFalse-Boolean_link|trigger=none}{sub-section}\{[String]} message -- The test description/message.
\{[Object]} object -- the actual value.
{div}{td}{tr}{builder-show}{tr:id=samret}{td}*SampleReturns*\\{sub-section:assertFalse-Boolean_sam|trigger=button|text=}{sub-section}div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{sub-section:assertFalse-Boolean_sam|trigger=none}{code:code:language=javascript}
// Asserts that aan conditionobject is falsenot null. AssertionFailedError is thrown if the evaluationobject wasis not falsenull.
var a; // this is undefined, not null
jsunit.assertFalseassertNotNull("FalseNot null test", application.isLastPrintPreviewPrinted()a);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFalseassertNotSame-String_Boolean|class=nodeObject_Object}{tr:id=name}{td}h6.assertFalseassertNotSame{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertFalseassertNotSame{span}{span:id=iets|style=float: left;}\(messagenotExpected, boolean_conditionactual){span}{td}{tr}{builder-show:permission=edit}{tr:id=desprs}{td}{sub-section:assertFalse-String_Boolean_des|trigger=button|text=}{sub-section}{sub-section:assertFalse-String_Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section*Parameters*\\{div:class=sIndent}\{[Object]} notExpected -- the value that is not expected.
\{[Object]} actual -- the actual value.
{div}{td}{tr}{builder-show}{builder-show:permission=edittr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sncsam}{td}*SinceSample*\\{sub-section:assertFalse-String_Boolean_snc|trigger=button|text=}{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|trigger=button|text=}{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-sectiondiv:class=sIndent}{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}{div}{td}{tr}{tr:idclass=retlastDetailRow}{td}*Returns*\\{sub-section:assertFalse-String_Boolean_ret|trigger=button|text=}{sub-section}{sub-section:assertFalse-String_Boolean_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{tbody}{tbody:id=assertNotSame-String_Object_Object}{tr:id=name}{td}h6.assertNotSame{td}{tr}{builder-show:permission=edit}{tr:id=seesig}{td}*Also see*\\{sub-section:assertFalse-String_Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertFalse-String_Boolean_see|trigger=none}{sub-section}{div{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertNotSame{span}{span}\(message, notExpected, actual){span}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkprs}{td}*External linksParameters*\\{sub-section:assertFalse-String_Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertFalse-String_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show\{[String]} message -- The test description/message.
\{[Object]} notExpected -- the value that is not expected.
\{[Object]} actual -- the actual value.
{div}{td}{tr}{tr:id=samret}{td}*SampleReturns*\\{sub-section:assertFalse-String_Boolean_sam|trigger=button|text=}{sub-section}div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{sub-section:assertFalse-String_Boolean_sam|trigger=none}{code:language=javascript}
// Asserts that two values aare conditionnot isthe falsesame. AssertionFailedError is thrown if the evaluation was not false.
jsunit.assertFalse("False test", application.isLastPrintPreviewPrinted()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=assertFloatEquals-Number_Number_Number|class=nodeassertNotUndefined-Object}{tr:id=name}{td}h6.assertFloatEqualsassertNotUndefined{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertFloatEqualsassertNotUndefined{span}{span:id=iets|style=float: left;}\(expectedFloat, actualFloat, tolerancedefinedObject){span}{td}{tr}{builder-show:permission=edit}{tr:id=desprs}{td}{sub-section:assertFloatEquals-Number_Number_Number_des|trigger=button|text=}{sub-section}{sub-section:assertFloatEquals-Number_Number_Number_des|trigger=none|class=sIndent}Replace with description{sub-section*Parameters*\\{div:class=sIndent}\{[Object]} definedObject -- the actual value.
{div}{td}{tr}{builder-show}{builder-show:permission=edittr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sncsam}{td}*SinceSample*\\{sub-section:assertFloatEquals-Number_Number_Number_snc|trigger=button|text=}{sub-section}{sub-section:assertFloatEquals-Number_Number_Number_snc|trigger=none|class=sIndent} Replace with version info{sub-sectiondiv:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{builder-showtbody:id=assertNotUndefined-String_Object}{tr:id=prs}name}{td}h6.assertNotUndefined{td}*Parameters*\\{sub-section:assertFloatEquals-Number_Number_Number_prs|trigger=button|text=}{sub-section}{sub-section:assertFloatEquals-Number_Number_Number_prs|trigger=none|{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertNotUndefined{span}{span}\(message, definedObject){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[NumberString]} expectedFloatmessage -- theThe expectedtest valuedescription/message.
\{[NumberObject]} actualFloatdefinedObject -- the actual value.
\{[Number]} tolerance -- tolerance when comparing.
{sub-section}{td}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertFloatEquals-Number_Number_Number_ret|trigger=button|text=}{sub-section}{sub-section:assertFloatEquals-Number_Number_Number_ret|trigger=none|div:class=sIndent}void{sub-sectiondiv}{td}{tr}{builder-show:permission=edit}{tr:id=seesam}{td}*Also seeSample*\\{sub-section:assertFloatEquals-Number_Number_Number_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertFloatEquals-Number_Number_Number_see|trigger=none}{sub-sectioncode: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}{div}{td}{tr}{builder-show}{builder-show:permission=edittr:class=lastDetailRow}{td}{td}{tr:id=link}{td}*External links*\\{sub-section:assertFloatEquals-Number_Number_Number_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertFloatEquals-Number_Number_Number_link|trigger=none}{sub-section}{divtbody}{tbody:id=assertNull-Object}{tr:id=name}{td}h6.assertNull{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertNull{span}{span}\(nullValue){span}{td}{tr}{builder-show}{tr:id=samprs}{td}*SampleParameters*\\{sub-section:assertFloatEquals-Number_Number_Number_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertFloatEquals-Number_Number_Number_sam|trigger=none\{[Object]} nullValue -- the actual value.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// 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 onenull.
jsunit.assertFloatEqualsassertNull("Float equalsNull test", 3.12, 3.121, 0.0015null);
{code}{sub-sectiondiv}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFloatEqualsassertNull-String_Number_Number_Number|class=nodeObject}{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}{builder-show:permission=edit}{tr:id=desprs}{td}{sub-section:assertFloatEquals-String_Number_Number_Number_des|trigger=button|text=}{sub-section}{sub-section:assertFloatEquals-String_Number_Number_Number_des|trigger=none|class=sIndent}Replace with description{sub-section*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} nullValue -- the actual value.
{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sncret}{td}*SinceReturns*\\{sub-section:assertFloatEquals-String_Number_Number_Number_snc|trigger=button|text=}{sub-section}{sub-section:assertFloatEquals-String_Number_Number_Number_snc|trigger=none|div:class=sIndent} Replace with version info{sub-sectionvoid{div}{td}{tr}{builder-show}{tr:id=prssam}{td}*ParametersSample*\\{sub-section:assertFloatEquals-String_Number_Number_Number_prs|trigger=button|text=}{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-sectiondiv:class=sIndent}{code:language=javascript}
// Asserts that an object is null. AssertionFailedError is thrown if the object is not null.
jsunit.assertNull("Null test", null);
{code}{div}{td}{tr}{tr:id=retclass=lastDetailRow}{td}{td}*Returns*\\{sub-section:assertFloatEquals-String_Number_Number_Number_ret|trigger=button|text=}{sub-section}{sub-section:assertFloatEquals-String_Number_Number_Number_ret|trigger=none|class=sIndent}void{sub-section}{tr}{tbody}{tbody:id=assertSame-Object_Object}{tr:id=name}{td}h6.assertSame{td}{tr}{builder-showtr:permission=editid=sig}{td}{trspan:id=see}{td}*Also see*\\{sub-section:assertFloatEquals-String_Number_Number_Number_see|trigger=button|text=}{sub-section}style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertSame{span}{span}\(expected, actual){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}{sub-section:assertFloatEquals-String_Number_Number_Number_see|trigger=none}{sub-section}\{[Object]} expected -- the expected value.
\{[Object]} actual -- the actual value.
{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkret}{td}*External linksReturns*\\{sub-section:assertFloatEquals-String_Number_Number_Number_link|trigger=button|text=}{sub-section}{div:div:class=sIndent}{sub-section:assertFloatEquals-String_Number_Number_Number_link|trigger=none}{sub-section}{void{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertFloatEquals-String_Number_Number_Number_sam|trigger=button|text=}{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 tolerancethe same. 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.0015actual one.
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=assertMatchesassertSame-String_Object_String|class=nodeObject}{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;}\(regularExpressionmessage, expected, actualStringactual){span}{td}{tr}{builder-show:permission=edit}{tr:id=desprs}{td}{sub-section:assertMatches-Object_String_des|trigger=button|text=}{sub-section}{sub-section:assertMatches-Object_String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} expected -- the expected value.
\{[Object]} actual -- the actual value.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sncsam}{td}*SinceSample*\\{sub-section:assertMatches-Object_String_snc|trigger=button|text=}{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|trigger=button|text=}{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-sectiondiv:class=sIndent}{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}{div}{td}{tr}{tr:id=retclass=lastDetailRow}{td}{td}*Returns*\\{sub-section:assertMatches-Object_String_ret|trigger=button|text=}{sub-section}{sub-section:assertMatches-Object_String_ret|trigger=none|class=sIndent}void{sub-section}{tr}{tbody}{tbody:id=assertTrue-Boolean}{tr:id=name}{td}h6.assertTrue{td}{tr}{builder-show:permission=edit}{tr:id=seesig}{td}*Also see*\\{sub-section:assertMatches-Object_String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertMatches-Object_String_see|trigger=none}{sub-section}{div{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertTrue{span}{span}\(boolean_condition){span}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=linkprs}{td}*External linksParameters*\\{sub-section:assertMatches-Object_String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertMatches-Object_String_link|trigger=none}{sub-section}div:class=sIndent}\{[Boolean]} boolean_condition -- the actual value.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertMatches-Object_String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertMatches-Object_String_sam|trigger=none}{div:class=sIndent}{code:language=javascript}
// Asserts that a regularcondition expression matches a stringis true. AssertionFailedError is thrown if the expectedevaluation value iswas not the actual onetrue.
jsunit.assertMatchesassertTrue(new"True RegExp("gr(a|e)y"), "gray")test", application.isLastPrintPreviewPrinted());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertMatchesassertTrue-String_Object_String|class=nodeBoolean}{tr:id=name}{td}h6.assertMatchesassertTrue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertMatchesassertTrue{span}{span:id=iets|style=float: left;}\(message, regularExpression, actualString}\(message, boolean_condition){span}{td}{tr}{builder-show:permission=edit}{tr:id=desprs}{td}{sub-section:assertMatches-String_Object_String_des|trigger=button|text=}{sub-section}{sub-section:assertMatches-String_Object_String_des|trigger=none|class=sIndent}Replace with description{sub-section*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[Boolean]} boolean_condition -- the actual value.
{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Sincetr:id=ret}{td}*Returns*\\{sub-section:assertMatches-String_Object_String_snc|trigger=button|text=}{sub-section}{sub-section:assertMatches-String_Object_String_snc|trigger=none|div:class=sIndent} Replace with version info{sub-sectionvoid{div}{td}{tr}{builder-show}{tr:id=prssam}{td}*ParametersSample*\\{sub-section:assertMatches-String_Object_String_prs|trigger=button|text=}{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-sectiondiv:class=sIndent}{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}{div}{td}{tr}{tr:idclass=retlastDetailRow}{td}*Returns*\\{sub-section:assertMatches-String_Object_String_ret|trigger=button|text=}{sub-section}{sub-section:assertMatches-String_Object_String_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{tbody}{tbody:id=assertUndefined-Object}{tr:id=name}{td}h6.assertUndefined{td}{tr}{builder-show:permission=edit}{tr:id=seesig}{td}*Also see*\\{sub-section:assertMatches-String_Object_String_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertMatches-String_Object_String_see|trigger=none}{sub-section}{div{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertUndefined{span}{span}\(undefinedValue){span}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:tr:id=linkprs}{td}*External linksParameters*\\{sub-section:assertMatches-String_Object_String_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertMatches-String_Object_String_link|trigger=none}{sub-section}\{[Object]} undefinedValue -- the actual value.
{div}{td}{tr}{builder-show}{tr:id=samret}{td}*SampleReturns*\\{sub-section:assertMatches-String_Object_String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertMatches-String_Object_String_sam|trigger=nonediv:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
// Asserts that aan regularobject expression matches a stringis undefined. AssertionFailedError is thrown if the expected valueobject is not the actual onedefined.
jsunit.assertMatchesassertUndefined("MatchUndefined test", new RegExp("gr(a|e)y"), "gray")thisIsUndefined);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotNullassertUndefined-String_Object|class=node}{tr:id=name}{td}h6.assertNotNullassertUndefined{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNotNullassertUndefined{span}{span:id=iets|style=float: left;}\(objectmessage, undefinedValue){span}{td}{tr}{builder-showtr:permissionid=editprs}{tr:id=des}{td}{sub-section:assertNotNull-Object_des|trigger=button|text=}{sub-section}{sub-section:assertNotNull-Object_des|trigger=none|class=sIndent}Replace with description{sub-section*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} undefinedValue -- the actual value.
{div}{td}{tr}{builder-show}{builder-show:permission=edittr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sncsam}{td}*SinceSample*\\{sub-section:assertNotNull-Object_snc|trigger=button|text=}{sub-section}{sub-section:assertNotNull-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-sectiondiv:class=sIndent}{code:language=javascript}
// Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
jsunit.assertUndefined(thisIsUndefined);
{code}{div}{td}{tr}{builder-show}{tr:id=prsclass=lastDetailRow}{td}{td}*Parameters*\\{sub-section:assertNotNull-Object_prs|trigger=button|text=}{sub-section}{sub-section:assertNotNull-Object_prs|trigger=none|class=sIndent}\{[Object]} object -- the actual value.
{sub-section}{tr}{tbody}{tbody:id=fail-String}{tr:id=name}{td}h6.fail{td}{tr}{tr:id=retsig}{td}*Returns*\\{sub-section:assertNotNull-Object_ret|trigger=button|text=}{sub-section}{sub-section:assertNotNull-Object_ret|trigger=none|class=sIndent}void{sub-section{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}fail{span}{span}\(message){span}{td}{tr}{builder-show:permission=edit}{tr:id=seeprs}{td}*Parameters*Also see*\\{sub-section:assertNotNull-Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertNotNull-Object_see|trigger=none}{sub-section}{\{[String]} message -- The test description/message. This is usually the only parameter specified when calling this method.
{div}{td}{tr}{builder-show}{builder-show:permission=edittr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=linksam}{td}*External linksSample*\\{sub-section:assertNotNull-Object_link|trigger=button|text=}{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|trigger=button|text=}{sub-section}{div:div:class=sIndent}{sub-section:assertNotNull-Object_sam|trigger=none}{code:language=javascript}
// AssertsFails that an object is not nulla test. AssertionFailedError is always thrown if the object is not null.
var a; // this is undefined, not null
jsunit.assertNotNull(a);
{code}{sub-section.
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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotNullfail-String_Object|class=node}{tr:id=name}{td}h6.assertNotNullfail{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNotNullfail{span}{span:id=iets|style=float: left;}\(message, object}\(message, instanceOfCallStack){span}{td}{tr}{builder-show:permission=edit}{tr:id=desprs}{td}{sub-section:assertNotNull-String_Object_des|trigger=button|text=}{sub-section}{sub-section:assertNotNull-String_Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit*Parameters*\\{div: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.
{div}{td}{tr}{tr:id=sncret}{td}*SinceReturns*\\{sub-section:assertNotNull-String_Object_snc|trigger=button|text=}{sub-section}{sub-section:assertNotNull-String_Object_snc|trigger=none|div:class=sIndent} Replace with version info{sub-sectionvoid{div}{td}{tr}{builder-show}{tr:id=prssam}{td}*ParametersSample*\\{sub-section:assertNotNull-String_Object_prs|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertNotSame-Object_Object_des|trigger=button|text=}{sub-section}{sub-section:assertNotSame-Object_Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotSame-Object_Object_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertNotSame-String_Object_Object_des|trigger=button|text=}{sub-section}{sub-section:assertNotSame-String_Object_Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotSame-String_Object_Object_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertNotUndefined-Object_des|trigger=button|text=}{sub-section}{sub-section:assertNotUndefined-Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotUndefined-Object_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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.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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertNotUndefined-String_Object_des|trigger=button|text=}{sub-section}{sub-section:assertNotUndefined-String_Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNotUndefined-String_Object_snc|trigger=button|text=}{sub-section}{sub-section:assertNotUndefined-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNotUndefined-String_Object_prs|trigger=button|text=}{sub-section}{sub-section:assertNotUndefined-String_Object_prs|trigger=none|class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} definedObject -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNotUndefined-String_Object_ret|trigger=button|text=}{sub-section}{sub-section:assertNotUndefined-String_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNotUndefined-String_Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertNotUndefined-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNotUndefined-String_Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertNotUndefined-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNotUndefined-String_Object_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertNotUndefined-String_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("Not undefined test", a);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNull-Object|class=node}{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;}\(nullValue){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertNull-Object_des|trigger=button|text=}{sub-section}{sub-section:assertNull-Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNull-Object_snc|trigger=button|text=}{sub-section}{sub-section:assertNull-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNull-Object_prs|trigger=button|text=}{sub-section}{sub-section:assertNull-Object_prs|trigger=none|class=sIndent}\{[Object]} nullValue -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNull-Object_ret|trigger=button|text=}{sub-section}{sub-section:assertNull-Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNull-Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertNull-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNull-Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertNull-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNull-Object_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertNull-Object_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNull-String_Object|class=node}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertNull-String_Object_des|trigger=button|text=}{sub-section}{sub-section:assertNull-String_Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertNull-String_Object_snc|trigger=button|text=}{sub-section}{sub-section:assertNull-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertNull-String_Object_prs|trigger=button|text=}{sub-section}{sub-section:assertNull-String_Object_prs|trigger=none|class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} nullValue -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertNull-String_Object_ret|trigger=button|text=}{sub-section}{sub-section:assertNull-String_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertNull-String_Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertNull-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertNull-String_Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertNull-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertNull-String_Object_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertNull-String_Object_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertSame-Object_Object|class=node}{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;}\(expected, actual){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertSame-Object_Object_des|trigger=button|text=}{sub-section}{sub-section:assertSame-Object_Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertSame-Object_Object_snc|trigger=button|text=}{sub-section}{sub-section:assertSame-Object_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertSame-Object_Object_prs|trigger=button|text=}{sub-section}{sub-section:assertSame-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:assertSame-Object_Object_ret|trigger=button|text=}{sub-section}{sub-section:assertSame-Object_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertSame-Object_Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertSame-Object_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertSame-Object_Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertSame-Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertSame-Object_Object_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertSame-Object_Object_sam|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(a, b);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertSame-String_Object_Object|class=node}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertSame-String_Object_Object_des|trigger=button|text=}{sub-section}{sub-section:assertSame-String_Object_Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertSame-String_Object_Object_snc|trigger=button|text=}{sub-section}{sub-section:assertSame-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:assertSame-String_Object_Object_prs|trigger=button|text=}{sub-section}{sub-section:assertSame-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:assertSame-String_Object_Object_ret|trigger=button|text=}{sub-section}{sub-section:assertSame-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:assertSame-String_Object_Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertSame-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:assertSame-String_Object_Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertSame-String_Object_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertSame-String_Object_Object_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertSame-String_Object_Object_sam|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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertTrue-Boolean|class=node}{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;}\(boolean_condition){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertTrue-Boolean_des|trigger=button|text=}{sub-section}{sub-section:assertTrue-Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertTrue-Boolean_snc|trigger=button|text=}{sub-section}{sub-section:assertTrue-Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertTrue-Boolean_prs|trigger=button|text=}{sub-section}{sub-section:assertTrue-Boolean_prs|trigger=none|class=sIndent}\{[Boolean]} boolean_condition -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertTrue-Boolean_ret|trigger=button|text=}{sub-section}{sub-section:assertTrue-Boolean_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertTrue-Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertTrue-Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertTrue-Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertTrue-Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertTrue-Boolean_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertTrue-Boolean_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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertTrue-String_Boolean|class=node}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertTrue-String_Boolean_des|trigger=button|text=}{sub-section}{sub-section:assertTrue-String_Boolean_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertTrue-String_Boolean_snc|trigger=button|text=}{sub-section}{sub-section:assertTrue-String_Boolean_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertTrue-String_Boolean_prs|trigger=button|text=}{sub-section}{sub-section:assertTrue-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:assertTrue-String_Boolean_ret|trigger=button|text=}{sub-section}{sub-section:assertTrue-String_Boolean_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertTrue-String_Boolean_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertTrue-String_Boolean_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertTrue-String_Boolean_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertTrue-String_Boolean_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertTrue-String_Boolean_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertTrue-String_Boolean_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}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertUndefined-Object|class=node}{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;}\(undefinedValue){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertUndefined-Object_des|trigger=button|text=}{sub-section}{sub-section:assertUndefined-Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertUndefined-Object_snc|trigger=button|text=}{sub-section}{sub-section:assertUndefined-Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertUndefined-Object_prs|trigger=button|text=}{sub-section}{sub-section:assertUndefined-Object_prs|trigger=none|class=sIndent}\{[Object]} undefinedValue -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertUndefined-Object_ret|trigger=button|text=}{sub-section}{sub-section:assertUndefined-Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertUndefined-Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertUndefined-Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertUndefined-Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertUndefined-Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertUndefined-Object_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertUndefined-Object_sam|trigger=none}{code:language=javascript}
// Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
jsunit.assertUndefined("Undefined test", thisIsUndefined);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertUndefined-String_Object|class=node}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:assertUndefined-String_Object_des|trigger=button|text=}{sub-section}{sub-section:assertUndefined-String_Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:assertUndefined-String_Object_snc|trigger=button|text=}{sub-section}{sub-section:assertUndefined-String_Object_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{tr:id=prs}{td}*Parameters*\\{sub-section:assertUndefined-String_Object_prs|trigger=button|text=}{sub-section}{sub-section:assertUndefined-String_Object_prs|trigger=none|class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} undefinedValue -- the actual value.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:assertUndefined-String_Object_ret|trigger=button|text=}{sub-section}{sub-section:assertUndefined-String_Object_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:assertUndefined-String_Object_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertUndefined-String_Object_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:assertUndefined-String_Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertUndefined-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:assertUndefined-String_Object_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:assertUndefined-String_Object_sam|trigger=none}{code:language=javascript}
// Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
jsunit.assertUndefined(thisIsUndefined);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=fail-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){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:fail-String_des|trigger=button|text=}{sub-section}{sub-section:fail-String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:fail-String_snc|trigger=button|text=}{sub-section}{sub-section:fail-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_prs|trigger=button|text=}{sub-section}{sub-section:fail-String_prs|trigger=none|class=sIndent}\{[String]} message -- The test description/message. This is usually the only parameter specified when calling this method.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:fail-String_ret|trigger=button|text=}{sub-section}{sub-section:fail-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_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:fail-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_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:fail-String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:fail-String_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:fail-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}{tbody:id=fail-String_Object|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){span}{td}{tr}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:fail-String_Object_des|trigger=button|text=}{sub-section}{sub-section:fail-String_Object_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:fail-String_Object_snc|trigger=button|text=}{sub-section}{sub-section:fail-String_Object_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_prs|trigger=button|text=}{sub-section}{sub-section:fail-String_Object_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.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:fail-String_Object_ret|trigger=button|text=}{sub-section}{sub-section:fail-String_Object_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_see|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section: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:fail-String_Object_link|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:fail-String_Object_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:fail-String_Object_sam|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:fail-String_Object_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}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:fail-String_Object_String_des|trigger=button|text=}{sub-section}{sub-section:fail-String_Object_String_des|trigger=none|class=sIndent}Replace with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:fail-String_Object_String_snc|trigger=button|text=}{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|trigger=button|text=}{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 -- a user message. Usually not specified.
{sub-section}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:fail-String_Object_String_ret|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:fail-String_Object_String_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=fail-String_Object_String}{tr:id=name}{td}h6.fail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}fail{span}{span}\(message, instanceOfCallStack, userMessage){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div: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 -- a user message. Usually not specified.
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{sub-section:fail-String_Object_String_sam|trigger=button|text=}{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}