robotframework / JavalibCore

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

support using overloaded methods to implement a keyword for AnnotationLibrary #4

Closed ombre42 closed 11 years ago

ombre42 commented 12 years ago

This would make default value assignment more inline with Java's design Here are some ideas

  1. overloaded methods must reside in the same class?
  2. overloaded methods without @RobotKeyword are ignored
  3. overloaded methods may use different names as long as their normalized keyword name is the same
  4. only one of the overloaded methods needs to have the keyword documentation in @RobotKeyword
  5. only the method with the most parameters should have @ArgumentNames
  6. behave like RF does with static API libraries when possible

inspiration could be found in org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping and many other places I'm sure

jussimalinen commented 11 years ago

Good points. This would make it easier to work with overloading. It might take a while before we have time to work on this though. Right now we pretty much just fix the critical bugs..

If you are interested in contributing, we are happy to take pull requests. :)

jussimalinen commented 11 years ago

doh, closed accidentally. nevermind.

chchgb commented 11 years ago

hi jussimalinen and ombre42 , I also try to use JavalibCore, this feature is expected.

and does keyword based on javalibcore only support to use string as argument type. when I use int, there always a error. 20121207 09:45:14.773 : FAIL : java.lang.IllegalArgumentException

ombre42 commented 11 years ago

@chchgb Sorry I took so long to respond. JavalibCore supports all arguments types as of 1.0.3. What version of JavalibCore are you using? The behavior you are seeing happened back in 0.9.3 (just reproduced). Starting with 1.01, it should automatically convert String <-> int/Integer.

jussimalinen commented 11 years ago

Yeah, the problem with "IllegalArgument from other object types" problem should be fixed in 1.0.3. This was issue #5

mkorpela commented 11 years ago

I've started working on this issue https://github.com/robotframework/JavalibCore/commit/ccdb7f99d07f535a76b60b9eabbf2694b63bed4d but this is still just a proof of concept.

mkorpela commented 11 years ago

Should be fully usable after https://github.com/robotframework/JavalibCore/commit/7ccdd5ca433e12886860bb75bfdb5e2489ac617d