Exemplo n.º 1
0
 /** @return the configuration of the HelloREEF driver. */
 private static Configuration getDriverConfiguration() {
   return DriverConfiguration.CONF
       .set(
           DriverConfiguration.GLOBAL_LIBRARIES,
           EnvironmentUtils.getClassLocation(HelloJVMOptionsDriver.class))
       .set(DriverConfiguration.DRIVER_IDENTIFIER, "HelloJVMOptions")
       .set(DriverConfiguration.ON_DRIVER_STARTED, HelloJVMOptionsDriver.StartHandler.class)
       .set(
           DriverConfiguration.ON_EVALUATOR_ALLOCATED,
           HelloJVMOptionsDriver.EvaluatorAllocatedHandler.class)
       .build();
 }
Exemplo n.º 2
0
  public static LauncherStatus run(
      final Class<? extends Task> failTaskClass,
      final Configuration runtimeConfig,
      final int timeOut)
      throws BindException, InjectionException {

    final Configuration driverConfig =
        DriverConfiguration.CONF
            .set(
                DriverConfiguration.GLOBAL_LIBRARIES,
                EnvironmentUtils.getClassLocation(Driver.class))
            .set(DriverConfiguration.DRIVER_IDENTIFIER, failTaskClass.getSimpleName())
            .set(DriverConfiguration.ON_EVALUATOR_ALLOCATED, Driver.AllocatedEvaluatorHandler.class)
            .set(DriverConfiguration.ON_TASK_RUNNING, Driver.RunningTaskHandler.class)
            .set(DriverConfiguration.ON_CONTEXT_ACTIVE, Driver.ActiveContextHandler.class)
            .set(DriverConfiguration.ON_DRIVER_STARTED, Driver.StartHandler.class)
            .build();

    final JavaConfigurationBuilder cb = Tang.Factory.getTang().newConfigurationBuilder();
    cb.addConfiguration(driverConfig);
    cb.bindNamedParameter(Driver.FailTaskName.class, failTaskClass.getSimpleName());

    return TestDriverLauncher.getLauncher(runtimeConfig).run(cb.build(), timeOut);
  }