robotframework / JavalibCore

Base for implementing Java test libraries to be used with Robot Framework
Other
42 stars 25 forks source link

arguments are changed to null when passed to a parameter type other than Integer, String, Double or Long #5

Closed ombre42 closed 11 years ago

ombre42 commented 12 years ago

If you have a keyword declared @RobotKeyword public void foo(Object bar) ... bar will be null no matter what is passed in. This is because ArgumentConverter.convertToType returns null if the parameter type is not Integer, String, Double or Long. Note also that Boolean, Byte, Short, and Float are not handled either. These are all mentioned in the Robot Framework guide, but there is no mention in the wiki for argument types. Upgrading from 0.9.1 to 1.0.1 caused 60 acceptance tests to fail for jrobotremoteserver :(

jussimalinen commented 11 years ago

Hum, but on old 0.9.1 those types worked? How odd. I have reproduced the behavior and I also have a fix, but I think I should try to understand how has this worked earlier.

jussimalinen commented 11 years ago

This fixes the issue for now 281639b2b2d02d178f6a6a74f6d69e5b74108e8d

When I have some more time I should check if we could rely on Robot doing the conversions for us...

pekkaklarck commented 11 years ago

Letting Robot to handle this would require adding getArgumentType method to dynamic API. That's definitely doable.

Sent from my mobile. 3.12.2012 16.00 "Jussi Malinen" notifications@github.com kirjoitti:

This fixes the issue for now 281639bhttps://github.com/robotframework/JavalibCore/commit/281639b2b2d02d178f6a6a74f6d69e5b74108e8d

When I have some more time I should check if we could rely on Robot doing the conversions for us...

— Reply to this email directly or view it on GitHubhttps://github.com/robotframework/JavalibCore/issues/5#issuecomment-10953557.

ombre42 commented 11 years ago

Thanks Jussi. I rebuilt using 1.0.3 and the tests that failed using 1.0.1 are passing.