Code example for CountDownLatch

0
 
abstract public class InterpreterTestCase extends AndroidTestCase {
  abstract protected String getInterpreterName();
   
  private static String ACTION="com.commonsware.abj.interp.InterpreterTestCase";
  private CountDownLatch latch=new CountDownLatch(1);
  private Bundle results=null;
   
  protected void setUp() throws Exception { 
    super.setUp(); 
     
    getContext().registerReceiver(onBroadcast, new IntentFilter(ACTION));
  } 
   
  protected void tearDown() { 
    getContext().unregisterReceiver(onBroadcast);
  } 
   
  protected Bundle execServiceTest(Bundle input) {
    Intent i=new Intent(getInterpreterName());