@Test public void testBuilder() { Config instanceCfg = ConfigFactory.parseMap(ImmutableMap.<String, Object>builder() .put(StandardGobblinInstanceDriver.PLUGINS_FULL_KEY, "fake1") .put(EmailNotificationPlugin.EMAIL_NOTIFICATIONS_DISABLED_KEY, Boolean.valueOf(true)) .build()); GobblinInstanceEnvironment mockEnv = Mockito.mock(GobblinInstanceEnvironment.class); Mockito.when(mockEnv.getSysConfig()) .thenReturn(DefaultConfigurableImpl.createFromConfig(instanceCfg)); StandardGobblinInstanceDriver.Builder builder = StandardGobblinInstanceDriver.builder() .withInstanceEnvironment(mockEnv) .addPlugin(new FakePluginFactory2()); List<GobblinInstancePluginFactory> plugins = builder.getPlugins(); Assert.assertEquals(plugins.size(), 2); Set<Class<?>> pluginClasses = new HashSet<>(); pluginClasses.add(plugins.get(0).getClass()); pluginClasses.add(plugins.get(1).getClass()); Assert.assertTrue(pluginClasses.contains(FakePluginFactory1.class)); Assert.assertTrue(pluginClasses.contains(FakePluginFactory2.class)); }
public static Builder builder() { return new Builder(); }
StandardGobblinInstanceDriver extends DefaultGobblinInstanceDriverImpl { public static Builder builder() { return new Builder(); } }
StandardGobblinInstanceDriver extends DefaultGobblinInstanceDriverImpl { public static Builder builder() { return new Builder(); } protected  StandardGobblinInstanceDriver(String instanceName, Configurable sysConfig,
      JobCatalog jobCatalog,
      JobSpecScheduler jobScheduler, JobExecutionLauncher jobLauncher,
      Optional<MetricContext> instanceMetricContext,
      Optional<Logger> log,
      List<GobblinInstancePluginFactory> plugins,
      SharedResourcesBroker<GobblinScopeTypes> instanceBroker); }
StandardGobblinInstanceDriver extends DefaultGobblinInstanceDriverImpl { public static Builder builder() { return new Builder(); } protected  StandardGobblinInstanceDriver(String instanceName, Configurable sysConfig,
      JobCatalog jobCatalog,
      JobSpecScheduler jobScheduler, JobExecutionLauncher jobLauncher,
      Optional<MetricContext> instanceMetricContext,
      Optional<Logger> log,
      List<GobblinInstancePluginFactory> plugins,
      SharedResourcesBroker<GobblinScopeTypes> instanceBroker); static Builder builder(); List<GobblinInstancePlugin> getPlugins(); }
StandardGobblinInstanceDriver extends DefaultGobblinInstanceDriverImpl { public static Builder builder() { return new Builder(); } protected  StandardGobblinInstanceDriver(String instanceName, Configurable sysConfig,
      JobCatalog jobCatalog,
      JobSpecScheduler jobScheduler, JobExecutionLauncher jobLauncher,
      Optional<MetricContext> instanceMetricContext,
      Optional<Logger> log,
      List<GobblinInstancePluginFactory> plugins,
      SharedResourcesBroker<GobblinScopeTypes> instanceBroker); static Builder builder(); List<GobblinInstancePlugin> getPlugins(); static final String INSTANCE_CFG_PREFIX; static final String PLUGINS_KEY; static final String PLUGINS_FULL_KEY; }