The first few things I think of:
1) One doesn't usually unit test a main method. No reason you can't; just that the logic doesn't generally reside there. Of course, it is just a main method so you can call it from a unit test.
2) What is ApplicationService? Do you want to test it or mock it out?
Jeanne, thanks for your response. I appreciate that you are willing to spare your time to help.
I am sorry for not explaining what I did in my code. I am working on a National Cancer Institute (NCI) project. Developers cannot direct access NCI data system.
The system provides developers with APIs to access domain objects and all service methods using any of the provided interfaces. And the ApplicationService is one of the interfaces.
The basic order of operations to access and use the system is as follows:
1.Ensure that the client application has knowledge of the objects in the domain space.
2.Formulate the query criteria using the domain objects.
3.Establish a connection to the server.
4.Submit the query objects and specify the desired class of objects to be returned.
5.Use and manipulate the result set as desired.
This code creates an instance of a class that implements the ApplicationService interface. This interface defines the service methods used to access data objects. A criterion object, i.e., the taxonList, is then created that defines the attribute values for which to search. The search method of the ApplicationService implementation is called with parameters that indicate the type of objects, i.e., Gene.class, to return and the criteria that returned objects must meet, defined by the taxonList object.
The code shown in my previous posting worked successfully to return the search result.
I have no clue in regard to write a unit test for this kind of operation.