JADE Environment Development Ideas

What's new in the upcoming JADE release?

IMPROVED DEVELOPER EFFICIENCY. ENHANCED SECURITY. SMOOTHER INTEGRATION

The JADE 2022 release meets tomorrow’s business demands.


Start your update to JADE's latest release

Making setPropertyValue smarter in regards to the type

I have been building JadeTestCases a lot in the last few days and frustratingly Jade assumes any literal number with a decimal is a Real which keeps causing a UE1000 (Invalid Parameter Type.)

e.g. create testObject transient;
testObject.setPropertyValue(TestObject::decimalValue.name, 12.43); // CRASHES WITH A UE1000 unless I type convert to a Decimal
testObject.setPropertyValue(TestObject::realValue.name, 11.3); // WORKS

Is it possible to make setPropertyValue smarter so it can match up the correct type? Especially if a literal is specified.
  • Guest
  • May 1 2019
  • Future consideration
HistoricalComments
Ty Baen-Price 13/11/2018 12:06:07 PM
You appreciate that the JADE language defines those literals as Reals, so it's not setPropertyValue doing any conversion or assuming (well, it's assuming you're sending through a value of the right type)? If you sent a local variable of the right type, it would work the way you want it to, which is generally more useful for testing scenarios anyway, since you can then assert on the local variable rather than mistyping the literal again.
  • Attach files
  • +3