public void testExistWithTimeout() {
assertFalse (
"existAnyWithTimeout ([KA,KB])",
sp.existAny (new String[] { "KA", "KB" })
);
assertFalse (
"existAnyWithTimeout ([KA,KB], delay)",
sp.existAny (new String[] { "KA", "KB" }, 1000L)
);
new Thread() {
public void run() {
ISOUtil.sleep (1000L);
sp.out ("KA", Boolean.TRUE);
}
}.start();
long now = System.currentTimeMillis();
assertTrue (
"existAnyWithTimeout ([KA,KB], delay)",
sp.existAny (new String[] { "KA", "KB" }, 2000L)
);
long elapsed = System.currentTimeMillis() - now;
assertTrue ("delay was > 1000", elapsed > 900L);
assertNotNull ("Entry should not be null", sp.inp ("KA"));
}
public void testByteArray() throws Exception {