private void testExecuteJobs(JobQueue jobQueue) throws InterruptedException { TestWorkAt workAt = new TestWorkAt(); testSendRequests(workAt, "increment", jobQueue); synchronized (workAt) { jobQueue.putJob( new Job( workAt, __iReceiver, new Message( null, true, "oid", __workAt_td, __workAt_td.getMethodDescription("notifyme"), true, null, false, null, null)), null); while (!workAt._notified) { workAt.wait(); } } assertEquals(TestWorkAt.MESSAGES, workAt._counter); }
private void testSendRequests(TestWorkAt workAt, String operation, JobQueue jobQueue) { Message iMessage = new Message( null, true, "oid", __workAt_td, __workAt_td.getMethodDescription(operation), true, null, false, null, null); for (int i = 0; i < TestWorkAt.MESSAGES; ++i) { Thread.yield(); // force scheduling jobQueue.putJob(new Job(workAt, __iReceiver, iMessage), new Object()); } }