Package com.google.common.eventbus

Examples of com.google.common.eventbus.EventBus.post()


          }
        });
      }

      ExecutorService executor = Executors.newCachedThreadPool();
      aggregatedBus.post(new AggregatedStartEvent(slaves.size(),
          // TODO: this doesn't account for replicated suites.
          testCollection.testClasses.size()));

      try {
        List<Future<Void>> all = executor.invokeAll(slaves);
View Full Code Here


          }
        }
      } catch (InterruptedException e) {
        log("Master interrupted? Weird.", Project.MSG_ERR);
      }
      aggregatedBus.post(new AggregatedQuitEvent());

      for (ForkedJvmInfo si : slaveInfos) {
        if (si.start > 0 && si.end > 0) {
          log(String.format(Locale.ENGLISH, "JVM J%d: %8.2f .. %8.2f = %8.2fs",
              si.id,
View Full Code Here

    final List<Callable<Void>> slaves = Lists.newArrayList();
    for (int i = 0; i < randomIntBetween(1, 10); i++) {
      slaves.add(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
          aggregatedBus.post(new SlaveIdle());
          return null;
        }
      });
    }
    for (Future<Void> f : executor.invokeAll(slaves)) {
View Full Code Here

      }
      aggregatedBus.register(o);
    }

    if (testCollection.testClasses.isEmpty()) {
      aggregatedBus.post(new AggregatedQuitEvent());
    } else {
      start = System.currentTimeMillis();

      // Check if we allow duplicate suite names. Some reports (ANT compatible XML
      // reports) will have a problem with duplicate suite names, for example.
View Full Code Here

          }
        });
      }

      ExecutorService executor = Executors.newCachedThreadPool();
      aggregatedBus.post(new AggregatedStartEvent(slaves.size(),
          // TODO: this doesn't account for replicated suites.
          testCollection.testClasses.size()));

      try {
        List<Future<Void>> all = executor.invokeAll(slaves);
View Full Code Here

          }
        }
      } catch (InterruptedException e) {
        log("Master interrupted? Weird.", Project.MSG_ERR);
      }
      aggregatedBus.post(new AggregatedQuitEvent());

      for (ForkedJvmInfo si : slaveInfos) {
        if (si.start > 0 && si.end > 0) {
          log(String.format(Locale.ENGLISH, "JVM J%d: %8.2f .. %8.2f = %8.2fs",
              si.id,
View Full Code Here

        EventListener listener = new EventListener();

        eventBus.register(listener);

        // when
        eventBus.post(new OurTestEvent(200));

        // then
        assertThat(listener.getLastMessage()).isEqualTo(200);
    }
View Full Code Here

        eventBus.register(multiListener);


        // when
        eventBus.post(new Integer(100));
        eventBus.post(new Long(800));

        // then
        assertThat(multiListener.getLastInteger()).isEqualTo(100);
        assertThat(multiListener.getLastLong()).isEqualTo(800L);
View Full Code Here

        eventBus.register(multiListener);


        // when
        eventBus.post(new Integer(100));
        eventBus.post(new Long(800));

        // then
        assertThat(multiListener.getLastInteger()).isEqualTo(100);
        assertThat(multiListener.getLastLong()).isEqualTo(800L);
    }
View Full Code Here

        eventBus.register(listener);
        eventBus.register(reader);
        eventBus.register(stringEventListener);

        // when
        eventBus.post(new OurTestEvent(200));
        eventBus.post(new StringTestEvent("Hello events!"));


        // then
        assertThat(reader.getLastMessage()).isEqualTo(200);
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.