Ticket #411 (closed enhancement: invalid)

Opened 2 months ago

Last modified 7 weeks ago

Parameters: support null values for int, double and float

Reported by: adrian.wyssmann Owned by:
Priority: minor Milestone: Future
Component: jsystem runner Keywords:
Cc: Regression:
Known Issue: NA

Description

Currently jsystem does not support null values for int, double and float parameter values.
It would be really nice, if you can provide null values for such parameter types, as by default they are always 0 or 0.0

Change History

Changed 7 weeks ago by nizan.freedman

  • priority changed from major to minor
  • status changed from new to closed
  • resolution set to invalid

I don't understand what is null value for numbers.
do you know any programming language that supports null for int\double\float?
default value for numbers is always 0.

Changed 7 weeks ago by adrian.wyssmann

Indeed that's true. Let me explain my idea behind of that:
Assuming you have optional parameters, which - if used - are numeric values. So if you have this parameter exposed in your test case, it always has a value (which is 0). I thought it would be good to have the possibility that the test parameter can have 'null' or 'no value' when you want that the parameter is ignored - or can then be ignored by the user (e.g., if value has no value, then do nothing else use value).

I have a sut, which receives messages in xml format and processed the message according to it's content. The test case itself takes the test parameters and creates the xml file. There are several optional numeric parameters, which can be used for the message. For the sut it makes a big difference if the value is 0 or there is no value.

<testParams>
	<id>ID001</id>
	<mandParam>abcd</mandParam>
	<optionalVal>0</optionalVal>
</testParams>

is not the same than

<testParams>
	<id>ID001</id>
	<mandParam>abcd</mandParam>
</testParams>

If there is only one parameter, you would probably write two test cases with different includeParams/excludeParams. What if you have a lot of such values? you'd need to write a lot of test cases to make all combinations possible.

Changed 7 weeks ago by nizan.freedman

1) you can use a String value since the xml doesn't distinguish between int and string.
2) I think it is wrong to give an abnormal behavior in the JSystem just to conform to some requested user specific behavior.
what would you do in a code in this case?
you would use 0 or a negative value as a null, so do the same here.
otherwise - use a string.

Note: See TracTickets for help on using tickets.