KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > simulator > control > MockControl


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.simulator.control;
5
6 import com.tc.util.TCTimeoutException;
7
8
9 public class MockControl implements Control {
10   
11   public boolean waitForStartCalled;
12   public boolean throwTimeoutExceptionInWaitForStart;
13
14   public boolean notifyCompleteCalled;
15   
16   public boolean waitForAllCompleteCalled;
17   public boolean waitForAllCompleteResult;
18   public boolean throwTimeoutExceptionInWaitForAllComplete;
19
20   public void waitForStart(long timeout) throws TCTimeoutException {
21     waitForStartCalled = true;
22     if (throwTimeoutExceptionInWaitForStart) {
23       throw new TCTimeoutException(timeout);
24     }
25   }
26
27   public void notifyComplete() {
28     notifyCompleteCalled = true;
29   }
30
31   public boolean waitForAllComplete(long timeout) {
32     waitForAllCompleteCalled = true;
33     return waitForAllCompleteResult;
34   }
35
36 }
Popular Tags