|  | Unit test for connection-validation using a Custom Validator. | 
|  |  | 
|  | The Validator tries to get the number of rows in a dummy table to compare with a count. | 
|  |  | 
|  | Iteration 1: | 
|  | Appclient first calls an ejb method to initialize the connection pool. | 
|  |  | 
|  | After first call to ejb, database is restarted. | 
|  |  | 
|  | Iteration 2: | 
|  | Appclient calls the same ejb method. Since all the connections in the pool is | 
|  | bad, and validation is not enabled, ejb call must throw exception or return false. | 
|  |  | 
|  | Enable validation. | 
|  |  | 
|  | Iteration 3: | 
|  | Appclient calls the same ejb method. With validation on, all bad connections are | 
|  | removed and newly created. | 
|  |  | 
|  | database is restarted. | 
|  |  | 
|  | Iteration 4: | 
|  | Appclient calls the same ejb method. With validation on, pool must be cleaned | 
|  | and filled with new resources | 
|  |  |