I am writing JUnit testcases for my application. In the application there are complex VOs (Value objects) and TO objects which have arrayLists.Now i create an dummy XML from the dummy data, unmarshall it to create dummy object and then Compare it to the above actual object.
For comparing simple objects which have primitive types (int,String,..) i can unmarshall the dummy XML to object and compare it. (with reflection API) Same thing i am not able to do when there are Arraylists and arraylists within arraylists in an object.. When I try to unmarshall that, i dont get the converted object in proper format.
Is there any way I can unmarshal complex objects with 3 to 4 hierarchies so I can compare them and test???
Is the goal of the test to verify the unmarshalling code? If so, sounds like it needs work on the nested collections. Did you write this or is it a library from open source or a tool vendor?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: Dec 29, 2006
to test the application we are first of all keeping a dummy XML which will have output parameters as per given input for a specific function.
Now we call that function with same input paras and then take the output object. This object is matched with the Unmarshalled Object of the dummy XML.
So this will be a testcase for our application and if Objects dont match it will return False.. This way all functions of particular class can be tested and any changes that affect the functional part will be easily detected...