use of org.apache.gobblin.runtime.JobLauncherTestHelper in project incubator-gobblin by apache.
the class MRJobLauncherTest method startUp.
@BeforeClass
public void startUp() throws Exception {
this.testLogger.info("startUp: in");
testMetastoreDatabase = TestMetastoreDatabaseFactory.get();
this.launcherProps = new Properties();
try (InputStream propsReader = getClass().getClassLoader().getResourceAsStream("gobblin.mr-test.properties")) {
this.launcherProps.load(propsReader);
}
this.launcherProps.setProperty(ConfigurationKeys.JOB_HISTORY_STORE_ENABLED_KEY, "true");
this.launcherProps.setProperty(ConfigurationKeys.METRICS_ENABLED_KEY, "true");
this.launcherProps.setProperty(ConfigurationKeys.METRICS_REPORTING_FILE_ENABLED_KEY, "false");
this.launcherProps.setProperty(ConfigurationKeys.JOB_HISTORY_STORE_URL_KEY, testMetastoreDatabase.getJdbcUrl());
StateStore<JobState.DatasetState> datasetStateStore = new FsStateStore<>(this.launcherProps.getProperty(ConfigurationKeys.STATE_STORE_FS_URI_KEY), this.launcherProps.getProperty(ConfigurationKeys.STATE_STORE_ROOT_DIR_KEY), JobState.DatasetState.class);
this.jobLauncherTestHelper = new JobLauncherTestHelper(this.launcherProps, datasetStateStore);
// Other tests may not clean up properly, clean up outputDir and stagingDir or some of these tests might fail.
String outputDir = this.launcherProps.getProperty(ConfigurationKeys.WRITER_OUTPUT_DIR);
String stagingDir = this.launcherProps.getProperty(ConfigurationKeys.WRITER_STAGING_DIR);
FileUtils.deleteDirectory(new File(outputDir));
FileUtils.deleteDirectory(new File(stagingDir));
this.testLogger.info("startUp: out");
}
use of org.apache.gobblin.runtime.JobLauncherTestHelper in project incubator-gobblin by apache.
the class LocalJobLauncherTest method startUp.
@BeforeClass
public void startUp() throws Exception {
testMetastoreDatabase = TestMetastoreDatabaseFactory.get();
this.launcherProps = new Properties();
this.launcherProps.load(new FileReader("gobblin-test/resource/gobblin.test.properties"));
this.launcherProps.setProperty(ConfigurationKeys.JOB_HISTORY_STORE_ENABLED_KEY, "true");
this.launcherProps.setProperty(ConfigurationKeys.METRICS_ENABLED_KEY, "true");
this.launcherProps.setProperty(ConfigurationKeys.METRICS_REPORTING_FILE_ENABLED_KEY, "false");
this.launcherProps.setProperty(ConfigurationKeys.JOB_HISTORY_STORE_URL_KEY, testMetastoreDatabase.getJdbcUrl());
StateStore<JobState.DatasetState> datasetStateStore = new FsStateStore<>(this.launcherProps.getProperty(ConfigurationKeys.STATE_STORE_FS_URI_KEY), this.launcherProps.getProperty(ConfigurationKeys.STATE_STORE_ROOT_DIR_KEY), JobState.DatasetState.class);
this.jobLauncherTestHelper = new JobLauncherTestHelper(this.launcherProps, datasetStateStore);
}
Aggregations