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);
 }
 public void run() {
   synchronized (lock) {
     state = STATE_STARTED;
     lock.notifyAll();
   }
   try {
     if (waitTime != 0) {
       Thread.sleep(waitTime);
     }
     _jobQueue.enter(_disposeId);
   } catch (Throwable e) {
   }
   synchronized (lock) {
     state = STATE_DONE;
     lock.notifyAll();
   }
 }
 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());
   }
 }