object as a parameter
I am modifying a company specific test generation tool.
In my tool a set test data for each type of method parameter. But how do I define test data for custom Java-type objects?
public void insertCustomer(Customer cust)
My test code wounld look like this:
public void testSaveCustomer(Customer cust)
// generator looks for type Customer, and adds a test data here to be tested.
Collection customers=new Collection();
customers.add(TEST OBJECT HERE);
// Question is: HOW DO I SELECT THE TEST DATA TO OBJECT BEING USED?
// Based on program specs?
// Testing on Objects attributes equivalence classes?
Re: object as a parameter
Tough to say based on the limited code, but...
Most classes have "setter" methods that allow you to create the object and then populate its attributes.
Customer aCustomer = new Customer();
aCustomer.setId = 3;
aCustomer.setName = "Tester1";
You could hard-code the data for the setter methods or could get it from some datasource.
It looks like that might be the direction you are heading already?