I would like to automate few of our manual regression tests.

Can anyone2 help me with this. I am familiar with Junit.

We have a Java software architecture like this:
(use cases are implemented with these architectural decisions)

1) Client- Framework-SessionBean-JDBC

2) Client-Framework-SessionBean-EntityBean

3) Client-Framework-SessionBean-Hibernate

Also reused-components for actions like connect to db

And here is an example case for option (1):


readData(String primarykey)




ok. If I want to test session bean should i use Mock Objects to mock the TOOLKIT? and set test cases as TOOLKIT:s return values

like this.

Mock mok=mock(TOOLKIT.class);

// expections (checkpoints for mocking behavior)

1) param1: return value Vector v;

2) param2: return value Vector a;


and then define and execute test cases against SessionBeans: method. without Container

So My problem is this. I am using JMock, and I cant understand it as well as needed...

The main question is how to use expectatios for mocks behavior..

toolkit.expects(once()).method("executeQueryOnServ er").with(NULL,NULL,NULL) ;

not work, TOOLKIT WANTS PARAMETERS AS (Connection, Pool, Query) , and they are defined in SessionBean wich calls this toolkit, with these parameters.

Please help me.