19 package testsuite.clusterj;
21 import testsuite.clusterj.model.Employee;
25 private static final int NUMBER_TO_INSERT = 4;
27 protected int numberOfEmployees() {
28 return NUMBER_TO_INSERT;
33 createSessionFactory();
35 createEmployeeInstances(NUMBER_TO_INSERT);
51 updateThenVerifyAll();
55 protected void createAll() {
64 for (
int i = 0;
i < NUMBER_TO_INSERT; ++
i) {
70 public void deleteAll() {
72 for (
int i = 0;
i < NUMBER_TO_INSERT; ++
i) {
79 public void updateThenVerifyAll() {
81 for (
int i = 0;
i < NUMBER_TO_INSERT; ++
i) {
84 e.setAge(NUMBER_TO_INSERT -
i);
92 for (
int i = 0;
i < NUMBER_TO_INSERT; ++
i) {
95 int expected = NUMBER_TO_INSERT -
i;
96 int actual = e.getAge();
97 if (expected != actual) {
98 error(
"Failed update: for employee " + i
99 +
" expected age " + expected
100 +
" actual age " + actual);