{div: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 AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.\\		\\		Enter additional information related to this 'class' inside the \{div} macro with 'id=description'{div}
{div:id=description}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}{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}[#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:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=assertEquals-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}\(expected, actual){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression.{div}{td}{tr}{tr:id=prs}{td}*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=des}{td}{div:class=sIndent}Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression.{div}{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 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}h6.assertFalse{td}{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}{tr:id=des}{td}{div:class=sIndent}Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Boolean]} boolean_condition -- 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 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}h6.assertFalse{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertFalse{span}{span}\(message, boolean_condition){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.{div}{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=ret}{td}*Returns*\\{div:class=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}{tbody:id=assertFloatEquals-Number_Number_Number}{tr:id=name}{td}h6.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}{tr:id=des}{td}{div: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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Number]} expectedFloat -- the expected value.
\{[Number]} actualFloat -- the actual value.
\{[Number]} tolerance -- tolerance when comparing.
{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 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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertFloatEquals-String_Number_Number_Number}{tr:id=name}{td}h6.assertFloatEquals{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertFloatEquals{span}{span}\(message, expectedFloat, actualFloat, tolerance){span}{td}{tr}{tr:id=des}{td}{div: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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[Number]} expectedFloat -- the expected value.
\{[Number]} actualFloat -- the actual value.
\{[Number]} tolerance -- tolerance when comparing.
{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 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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertMatches-Object_String}{tr:id=name}{td}h6.assertMatches{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertMatches{span}{span}\(regularExpression, actualString){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} regularExpression -- the regular expression used for matching.
\{[String]} actualString -- the actual value to be matched.
{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 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}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertMatches-String_Object_String}{tr:id=name}{td}h6.assertMatches{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertMatches{span}{span}\(message, regularExpression, actualString){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[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}{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 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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotNull-Object}{tr:id=name}{td}h6.assertNotNull{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertNotNull{span}{span}\(object){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that an object is not null. AssertionFailedError is thrown if the object is not null.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} object -- 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 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:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotNull-String_Object}{tr:id=name}{td}h6.assertNotNull{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertNotNull{span}{span}\(message, object){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that an object is not null. AssertionFailedError is thrown if the object is not null.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} object -- 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 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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotSame-Object_Object}{tr:id=name}{td}h6.assertNotSame{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertNotSame{span}{span}\(notExpected, actual){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} notExpected -- the value that is not expected.
\{[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 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:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotSame-String_Object_Object}{tr:id=name}{td}h6.assertNotSame{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertNotSame{span}{span}\(message, notExpected, actual){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} notExpected -- the value that is not expected.
\{[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 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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNotUndefined-Object}{tr:id=name}{td}h6.assertNotUndefined{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertNotUndefined{span}{span}\(definedObject){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} definedObject -- 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 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}{tbody:id=assertNotUndefined-String_Object}{tr:id=name}{td}h6.assertNotUndefined{td}{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=des}{td}{div:class=sIndent}Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} definedObject -- 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 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}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{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}{tr:id=des}{td}{div:class=sIndent}Asserts that an object is null. AssertionFailedError is thrown if the object is not null.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[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 an object is null. AssertionFailedError is thrown if the object is not null.
jsunit.assertNull("Null test", null);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertNull-String_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}\(message, nullValue){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that an object is null. AssertionFailedError is thrown if the object is not null.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[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 an object is null. AssertionFailedError is thrown if the object is not null.
jsunit.assertNull("Null test", null);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertSame-Object_Object}{tr:id=name}{td}h6.assertSame{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertSame{span}{span}\(expected, actual){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.{div}{td}{tr}{tr:id=prs}{td}*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 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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertSame-String_Object_Object}{tr:id=name}{td}h6.assertSame{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertSame{span}{span}\(message, expected, actual){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.{div}{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. 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:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertTrue-Boolean}{tr:id=name}{td}h6.assertTrue{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertTrue{span}{span}\(boolean_condition){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Boolean]} boolean_condition -- 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 a condition is true. AssertionFailedError is thrown if the evaluation was not true.
jsunit.assertTrue("True test", application.isLastPrintPreviewPrinted());
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertTrue-String_Boolean}{tr:id=name}{td}h6.assertTrue{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertTrue{span}{span}\(message, boolean_condition){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.{div}{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=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div: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:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertUndefined-Object}{tr:id=name}{td}h6.assertUndefined{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertUndefined{span}{span}\(undefinedValue){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} undefinedValue -- 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 an object is undefined. AssertionFailedError is thrown if the object is defined.
jsunit.assertUndefined("Undefined test", thisIsUndefined);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=assertUndefined-String_Object}{tr:id=name}{td}h6.assertUndefined{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}assertUndefined{span}{span}\(message, undefinedValue){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} message -- The test description/message.
\{[Object]} undefinedValue -- 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 an object is undefined. AssertionFailedError is thrown if the object is defined.
jsunit.assertUndefined(thisIsUndefined);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=fail-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){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Fails a test. AssertionFailedError is always thrown.{div}{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.
{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}
// 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}{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){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Fails a test. AssertionFailedError is always thrown.{div}{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.
{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}
// 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=des}{td}{div:class=sIndent}Fails a test. AssertionFailedError is always thrown.{div}{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*\\{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}{table}