@Test public void testRuntimesHostRoutedToDefaultRuntime() throws InjectionException { final String serializedConfiguration = getRuntimeDefinition( new MultiRuntimeDefinitionBuilder().addRuntime(TestDriverConfiguration.CONF.build(), "test") .build()); final JavaConfigurationBuilder cbtest = Tang.Factory.getTang().newConfigurationBuilder(); cbtest.bindNamedParameter( SerializedRuntimeDefinition.class, serializedConfiguration); Injector forked = injector.forkInjector(cbtest.build()); final RuntimesHost rHost = forked.getInstance(RuntimesHost.class); rHost.onRuntimeStart(new RuntimeStart(System.currentTimeMillis())); Assert.assertEquals(1, RuntimesHostTest.commandsQueue.size()); Object obj = RuntimesHostTest.commandsQueue.poll(); Assert.assertTrue(obj instanceof RuntimeStart); }
void onRuntimeStart(final RuntimeStart event) { initialize(); for (final Runtime runtime : this.runtimes.values()) { runtime.onRuntimeStart(event); } }
RuntimesHost { void onRuntimeStart(final RuntimeStart event) { initialize(); for (final Runtime runtime : this.runtimes.values()) { runtime.onRuntimeStart(event); } } }
RuntimesHost { void onRuntimeStart(final RuntimeStart event) { initialize(); for (final Runtime runtime : this.runtimes.values()) { runtime.onRuntimeStart(event); } } @Inject private  RuntimesHost(
      final Injector injector,
      @Parameter(SerializedRuntimeDefinition.class) final String serializedRuntimeDefinition); }
RuntimesHost { void onRuntimeStart(final RuntimeStart event) { initialize(); for (final Runtime runtime : this.runtimes.values()) { runtime.onRuntimeStart(event); } } @Inject private  RuntimesHost(
      final Injector injector,
      @Parameter(SerializedRuntimeDefinition.class) final String serializedRuntimeDefinition);  }
RuntimesHost { void onRuntimeStart(final RuntimeStart event) { initialize(); for (final Runtime runtime : this.runtimes.values()) { runtime.onRuntimeStart(event); } } @Inject private  RuntimesHost(
      final Injector injector,
      @Parameter(SerializedRuntimeDefinition.class) final String serializedRuntimeDefinition);   }