Search in sources :

Example 1 with JobExecutionQuery

use of org.apache.gobblin.rest.JobExecutionQuery in project incubator-gobblin by apache.

the class DatabaseJobHistoryStoreTest method testQueryByJobId.

@Test(dependsOnMethods = { "testUpdate" })
public void testQueryByJobId() throws IOException {
    JobExecutionQuery queryByJobId = new JobExecutionQuery();
    queryByJobId.setIdType(QueryIdTypeEnum.JOB_ID);
    queryByJobId.setId(JobExecutionQuery.Id.create(this.expectedJobExecutionInfos.get(0).getJobId()));
    List<JobExecutionInfo> result = this.jobHistoryStore.get(queryByJobId);
    Assert.assertEquals(result.size(), 1);
    JobExecutionInfo actual = result.get(0);
    JobExecutionInfo expected = this.expectedJobExecutionInfos.get(0);
    assertJobExecution(actual, expected);
}
Also used : JobExecutionQuery(org.apache.gobblin.rest.JobExecutionQuery) JobExecutionInfo(org.apache.gobblin.rest.JobExecutionInfo) Test(org.testng.annotations.Test)

Example 2 with JobExecutionQuery

use of org.apache.gobblin.rest.JobExecutionQuery in project incubator-gobblin by apache.

the class DatabaseJobHistoryStoreTest method testQueryByJobName.

@Test(dependsOnMethods = { "testUpdate" })
public void testQueryByJobName() throws IOException {
    JobExecutionQuery queryByJobName = new JobExecutionQuery();
    queryByJobName.setIdType(QueryIdTypeEnum.JOB_NAME);
    queryByJobName.setId(JobExecutionQuery.Id.create(this.expectedJobExecutionInfos.get(0).getJobName()));
    List<JobExecutionInfo> result = this.jobHistoryStore.get(queryByJobName);
    Assert.assertEquals(result.size(), 1);
    JobExecutionInfo actual = result.get(0);
    JobExecutionInfo expected = this.expectedJobExecutionInfos.get(0);
    assertJobExecution(actual, expected);
}
Also used : JobExecutionQuery(org.apache.gobblin.rest.JobExecutionQuery) JobExecutionInfo(org.apache.gobblin.rest.JobExecutionInfo) Test(org.testng.annotations.Test)

Example 3 with JobExecutionQuery

use of org.apache.gobblin.rest.JobExecutionQuery in project incubator-gobblin by apache.

the class DatabaseJobHistoryStoreTest method testQueryByTable.

@Test(dependsOnMethods = { "testUpdate" })
public void testQueryByTable() throws IOException {
    JobExecutionQuery queryByTable = new JobExecutionQuery();
    queryByTable.setIdType(QueryIdTypeEnum.TABLE);
    queryByTable.setId(JobExecutionQuery.Id.create(this.expectedJobExecutionInfos.get(0).getTaskExecutions().get(0).getTable()));
    List<JobExecutionInfo> result = this.jobHistoryStore.get(queryByTable);
    Assert.assertEquals(result.size(), 2);
    JobExecutionInfo actual = result.get(0);
    Assert.assertEquals(actual.getJobName(), this.expectedJobExecutionInfos.get(0).getJobName());
    Assert.assertEquals(actual.getJobId(), this.expectedJobExecutionInfos.get(0).getJobId());
    Assert.assertEquals(actual.getTaskExecutions().size(), 1);
    Assert.assertEquals(actual.getTaskExecutions().get(0).getTable(), this.expectedJobExecutionInfos.get(0).getTaskExecutions().get(0).getTable());
    actual = result.get(1);
    Assert.assertEquals(actual.getJobName(), this.expectedJobExecutionInfos.get(1).getJobName());
    Assert.assertEquals(actual.getJobId(), this.expectedJobExecutionInfos.get(1).getJobId());
    Assert.assertEquals(actual.getTaskExecutions().size(), 1);
    Assert.assertEquals(actual.getTaskExecutions().get(0).getTable(), this.expectedJobExecutionInfos.get(1).getTaskExecutions().get(0).getTable());
    queryByTable.setId(JobExecutionQuery.Id.create(this.expectedJobExecutionInfos.get(1).getTaskExecutions().get(1).getTable()));
    result = this.jobHistoryStore.get(queryByTable);
    Assert.assertEquals(result.size(), 1);
    actual = result.get(0);
    Assert.assertEquals(actual.getJobName(), this.expectedJobExecutionInfos.get(1).getJobName());
    Assert.assertEquals(actual.getJobId(), this.expectedJobExecutionInfos.get(1).getJobId());
    Assert.assertEquals(result.size(), 1);
    Assert.assertEquals(actual.getTaskExecutions().size(), 1);
    Assert.assertEquals(actual.getTaskExecutions().get(0).getTable(), this.expectedJobExecutionInfos.get(1).getTaskExecutions().get(1).getTable());
}
Also used : JobExecutionQuery(org.apache.gobblin.rest.JobExecutionQuery) JobExecutionInfo(org.apache.gobblin.rest.JobExecutionInfo) Test(org.testng.annotations.Test)

Aggregations

JobExecutionInfo (org.apache.gobblin.rest.JobExecutionInfo)3 JobExecutionQuery (org.apache.gobblin.rest.JobExecutionQuery)3 Test (org.testng.annotations.Test)3