-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can we simplify use of @Param annotation #13
Comments
Hi Ravi,
Thus I want to bring back the focus on core development and handling enhancement issues later. Cheers! |
Hi Ravi, I feel I might have not conveyed my thoughts correctly by the above comment and it might have sounded a bit rude. It was not my intention. What I was trying to say was if you feel strongly about making @param annotation optional, then by all means go ahead with it. The project will only benefit from that change. I personally think that it might not be a small change though and you have to delve a little deeper in the code base. A good starting point for you could be the following line inside EasyTestRunner's runWithAssignment method: parameterAssignment.potentialsForNextUnassigned() This is the method that I think is responsible for looking at ParameterSuppliedBy and Param annotations and get the method arguments back. Cheers! |
Don't worry Mate, nothing rude in that. I see its going good and we have same wavelength. Cheers, |
Ravi, Excel loader is now in place and available in Github. Can yuou please review it and see if there's anything missing or not correct. Also XML Loader will be in by end of day today. If you want you can start looking at making @param optional. Dont forget to assign the issue to you before starting so that we know whose working on what. Cheers! |
It looks not possible to remove @param as it is tied to ParameterSuppliedBy, it is being used internally by JUnit. |
Lets close this one and may be in future we can rewrite the whole @param implementation such that it becomes optional and does not depend on ParameterSuppliedBy annotation. |
Hey Ravi, We cannot make it go away because then user's Java code has to be compiled with debug enabled option which we cannot gaurantee. Thus, in case user has more than one parameter of the same type then he has to provide the @param annotation with name attribute for one of the parameters. |
Sounds good. I will try once and let you know the feedback On Mon, Nov 12, 2012 at 4:28 PM, Anuj Kumar [email protected]:
|
I still have it on my local. Will check in soon. |
I have a doubt. |
Hi Ravi, I will have a look at how we can gracefully handle such a scenario. Cheers! |
Hi Anuj,
Q1: For simplicity, can we remove @param annotation declaration from test methods?
Reasons :
public void testFindItemsWithReturnType(@param()
LibraryId id , @param(name="itemid") ItemId itemId) { ..}
Can be changed to
public void testFindItemsWithReturnType(LibraryId id , ItemId itemId) { .. }
Note : we can keep Data Supplier static class separately.
Q2: Can we wrap primitive types(int, long..) and simple types (Long, Double, Boolean..) with out need of user registering property editors?
If we know that declared parameter is Long, then we can convert String from file to Long.
If we can bring this change then user will be relaxed in writing test methods for these Data types and Test method will look more simple and intutive.
For ex: public void testFindItemsWithReturnType(Long libraryId , Long itemId) { .. }
Note: we can use converters anyhow for complex types / Objects.
I am not sure if there are any implications for these changes, these are just ideas from end user point of view and intuitive usability objective. Let me know your thoughts..
Cheers,
Ravi
The text was updated successfully, but these errors were encountered: