long t0 = System.currentTimeMillis();
while (System.currentTimeMillis() - t0 < 20000)
{
Object[] rs =
(Object[]) qr.query(jdbcConnector.getConnection(), "SELECT COUNT(*) FROM TEST WHERE TYPE = 2", new ArrayHandler());
assertNotNull(rs);
assertEquals(1, rs.length);
if (((Number)rs[0]).intValue() > 0)
{
break;
}
Thread.sleep(100);
}
Object[] obj2 =
(Object[]) qr.query(jdbcConnector.getConnection(), "SELECT DATA FROM TEST WHERE TYPE = 2", new ArrayHandler());
assertNotNull(obj2);
assertEquals(1, obj2.length);
assertEquals(TEST_MESSAGE + " Received", obj2[0]);
}