Examples of Blitzer


Examples of org.jmock.lib.concurrent.Blitzer

    // We are capturing exceptions thrown in Blitzer's child threads into this data structure so that we can properly
    // pass/fail this test.  The reason is that Blitzer doesn't report exceptions, which is a known bug in Blitzer
    // (JMOCK-263).  See https://github.com/jmock-developers/jmock-library/issues/22 for more information.
    final List<Exception> exceptions = Lists.newArrayList();
    Blitzer blitzer = new Blitzer(1000);

    // when
    blitzer.blitz(new Runnable() {
      public void run() {
        for (Rankable r : entries) {
          try {
            rankings.updateWith(r);
          }
          catch (RuntimeException e) {
            synchronized(exceptions) {
              exceptions.add(e);
            }
          }
        }
      }
    });
    blitzer.shutdown();

    // then
    //
    if (!exceptions.isEmpty()) {
      for (Exception e : exceptions) {
View Full Code Here

Examples of org.jmock.lib.concurrent.Blitzer

    // We are capturing exceptions thrown in Blitzer's child threads into this data structure so that we can properly
    // pass/fail this test.  The reason is that Blitzer doesn't report exceptions, which is a known bug in Blitzer
    // (JMOCK-263).  See https://github.com/jmock-developers/jmock-library/issues/22 for more information.
    final List<Exception> exceptions = Lists.newArrayList();
    Blitzer blitzer = new Blitzer(1000);

    // when
    blitzer.blitz(new Runnable() {
      public void run() {
        for (Rankable r : entries) {
          try {
            rankings.updateWith(r);
          }
          catch (RuntimeException e) {
            synchronized(exceptions) {
              exceptions.add(e);
            }
          }
        }
      }
    });
    blitzer.shutdown();

    // then
    //
    if (!exceptions.isEmpty()) {
      for (Exception e : exceptions) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.