Skip to content
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

How to handle a very large Value Object as parameter? #56

Open
ravi-polampelli opened this issue Oct 24, 2012 · 2 comments
Open

How to handle a very large Value Object as parameter? #56

ravi-polampelli opened this issue Oct 24, 2012 · 2 comments

Comments

@ravi-polampelli
Copy link

Hi Anuj,
As of now we understand, we can create converter for that Value Object, and have all those fields in test data so that we can populate those values and instantiate Value Object through Converter and send it as Parameter.
but, what if that Value Object is very large, say that has around 30 to 40 fields in it?
I think it is hard maintain all of them in Test Data.
What if that Value Object contains Collection as field, this worse the situation.

I think, no body used all those fields inside the method, they might be hardly using 5 to 10 fields of Value Object inside the method. if so, we can check what fields of VO are actually used inside method and create TestData for those fields only. this logic is useful in EasyTest-Codegen.
Just an idea. Please think over it and let me know your views.

Cheers,
Ravi

@anujgandharv
Copy link
Member

Hi Ravi,
Yes at the moment we do not have a good plan in place to handle Collections of Data. And it should be discussed soon how we plan to handle collections.
As far as the Converter logic goes, its upto the user. So a user can check what all fields are present in the test data and can create the object suitable to be used in the Test cases.

I did not understand the last part of your question : if so, we can check what fields of VO are actually used inside method and create TestData for those fields only. this logic is useful in EasyTest-Codegen.

Can you please explain.

@ravi-polampelli
Copy link
Author

Anuj,

Regarding last part of the question, I said about codegen logic.
In codegen, I can read the complete method source code and check what fields of a parameter (VO) are actually accessed, and put those fields only in test data file.
for ex : You are passing a CountrySearchRequest object(VO) as parameter to a method and there are 25 fields in the VO class. But out of 25 fields only 5 fields are accessed in the method say only countryId, countryName, continentId, areaId, capitalName etc.. then in the generated test data file and converter class, I can fill only those 5 fields.
This way we are building some more intelligence in generating the files, and then populating the parameter object at run-time. User need not bother about providing the values for all 25 fields each time in data file. he/she can provide values for only 5 fields.
Hope it is clear now.

Cheers,
Ravi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants