Product Information > Version 7.1 Release Information > Upgrading to JADE Release 7.1 > JadeTestCase Class Assert Methods (PAR 64825)

JadeTestCase Class Assert Methods (PAR 64825)

The type of the parameters for the expected and actual values of the JadeTestCase class assertEquals method are declared as Any, which provides a general API that can be used to test for values of all JADE data types. However, this means that the compiler cannot do any type checking of the values. In JADE, two type Any variables are always different if the type of the value differs; for example,. a1 is not equal to a2 if a1 and a2 have different types.

In the example assertEquals(1, 1.Decimal), the first parameter (1) has type Integer with a value of 1 while the second parameter (1.Decimal) has type Decimal with a value of 1, so the assert will always fail. The assert should be coded as follows.

assertEquals(1.Decimal, 1.Decimal);

The message output by the JadeTestCase class assertEquals method if the assert fails because of the operands having different types has now been changed to make this clear; that is:

assertEquals - types differ, expected type-of-m value value‑of‑m but actual type‑of‑n value = value‑of‑n

The JadeTestCase class assertEqualsMsg method has also been changed accordingly.