Package org.foo.log

Examples of org.foo.log.Activator


   
    // this latch limits the calls to the log service
    final CountDownLatch latch = new CountDownLatch(3);

    // override pause method to allow test synchronization
    BundleActivator logClientActivator = new Activator() {
      @Override protected void pauseTestThread() {

        // report log call
        latch.countDown();

        // nothing else left to do?
        if (latch.getCount() == 0) {
          LockSupport.park();
        }
      }
    };

    logClientActivator.start(context);

    // timeout in case test deadlocks
    if (!latch.await(5, TimeUnit.SECONDS)) {
      fail("Still expecting" + latch.getCount() + " calls");
    }

    logClientActivator.stop(context);

    // VERIFY - check the behavior matches
    // ===================================

    verify(context, serviceRef, logService);
View Full Code Here

TOP

Related Classes of org.foo.log.Activator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.