@Test(expected = RuntimeException.class) public void testRuntimesHostInitializedWithMissingRuntimeStatusHandler() throws InjectionException { final Configuration configuration = LocalDriverConfiguration.CONF .set(LocalDriverConfiguration.MAX_NUMBER_OF_EVALUATORS, 1) .set(LocalDriverConfiguration.ROOT_FOLDER, "") .set(LocalDriverConfiguration.JVM_HEAP_SLACK, 1024) .set(LocalDriverConfiguration.CLIENT_REMOTE_IDENTIFIER, "ID") .set(LocalDriverConfiguration.JOB_IDENTIFIER, "ID") .set(LocalDriverConfiguration.RACK_NAMES, "").build(); final String config = getRuntimeDefinition(new MultiRuntimeDefinitionBuilder().addRuntime(configuration, "local") .build()); final JavaConfigurationBuilder cb = Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter( RuntimeParameters.NodeDescriptorHandler.class, RuntimesHostTest.TestNodeDescriptorHandler.class) .bindNamedParameter( RuntimeParameters.RuntimeStatusHandler.class, RuntimesHostTest.TestRuntimeStatusHandler.class) .bindNamedParameter( RuntimeParameters.ResourceAllocationHandler.class, RuntimesHostTest.TestResourceAllocationHandler.class); Injector badInjector = Tang.Factory.getTang().newInjector(cb.build()); final JavaConfigurationBuilder cbtest = Tang.Factory.getTang().newConfigurationBuilder(); cbtest.bindNamedParameter( SerializedRuntimeDefinition.class, config); Injector forked = badInjector.forkInjector(cbtest.build()); final RuntimesHost rHost = forked.getInstance(RuntimesHost.class); rHost.onRuntimeStart(new RuntimeStart(System.currentTimeMillis())); }
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);   }