tags:

views:

54

answers:

2

First, I'm working as a Java programmer, and my first taks is to test the DAO and Services layers for a module from a project, but I didn't receive so many details about this thing.

Any info for doing this? I know i need to use mock testing.

P.S. This is my first job and I have 2 weeks as a worker :D, so I know very little about testing.

A: 

Does the component you are going to test contain JUnit test classes? If not, read up on JUnit and start creating a few test classes to get aqainted with JUnit, otherwise have a look at what they do, maybe debug through a few of them.

rsp
+1  A: 

Take a look at this link, I only glossed over it, but it looks like it covers much of the basics. There are many ways to test and there is no good way to answer this question without more detail. In general, it is good to test the DAO layer without actually going to the database... this article should get you started. You might also search google with keywords like java mock test or java test ioc -- IOC is inversion of control which is useful for this sort of thing b/c it allows the container to decide what implementation to use, which allow you to do things like replace database calls with simple value returns. Take a look at this link for more info on IOC. Hope that helps.

PaulP1975