use of com.dangdang.ddframe.job.event.rdb.JobEventRdbSearch.Condition in project elastic-job by dangdangdotcom.
the class JobEventRdbSearchTest method assertFindJobStatusTraceEventsWithErrorFields.
@Test
public void assertFindJobStatusTraceEventsWithErrorFields() {
Map<String, Object> fields = new HashMap<>();
fields.put("notExistField", "some value");
Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new Condition(10, 1, null, null, null, null, fields));
assertThat(result.getTotal(), is(500));
assertThat(result.getRows().size(), is(10));
}
use of com.dangdang.ddframe.job.event.rdb.JobEventRdbSearch.Condition in project elastic-job by dangdangdotcom.
the class JobEventRdbSearchTest method assertFindJobStatusTraceEventsWithErrorPageSizeAndNumber.
@Test
public void assertFindJobStatusTraceEventsWithErrorPageSizeAndNumber() {
Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new Condition(-1, -1, null, null, null, null, null));
assertThat(result.getTotal(), is(500));
assertThat(result.getRows().size(), is(10));
}
use of com.dangdang.ddframe.job.event.rdb.JobEventRdbSearch.Condition in project elastic-job by dangdangdotcom.
the class JobEventRdbSearchTest method assertFindJobStatusTraceEventsWithPageSizeAndNumber.
@Test
public void assertFindJobStatusTraceEventsWithPageSizeAndNumber() {
Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new Condition(10, 1, null, null, null, null, null));
assertThat(result.getTotal(), is(500));
assertThat(result.getRows().size(), is(10));
result = repository.findJobStatusTraceEvents(new Condition(50, 1, null, null, null, null, null));
assertThat(result.getTotal(), is(500));
assertThat(result.getRows().size(), is(50));
result = repository.findJobStatusTraceEvents(new Condition(100, 5, null, null, null, null, null));
assertThat(result.getTotal(), is(500));
assertThat(result.getRows().size(), is(100));
result = repository.findJobStatusTraceEvents(new Condition(100, 6, null, null, null, null, null));
assertThat(result.getTotal(), is(500));
assertThat(result.getRows().size(), is(0));
}
use of com.dangdang.ddframe.job.event.rdb.JobEventRdbSearch.Condition in project elastic-job by dangdangdotcom.
the class JobEventRdbSearchTest method assertFindJobStatusTraceEventsWithSort.
@Test
public void assertFindJobStatusTraceEventsWithSort() {
Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new Condition(10, 1, "jobName", "ASC", null, null, null));
assertThat(result.getTotal(), is(500));
assertThat(result.getRows().size(), is(10));
assertThat(result.getRows().get(0).getJobName(), is("test_job_1"));
result = repository.findJobStatusTraceEvents(new Condition(10, 1, "jobName", "DESC", null, null, null));
assertThat(result.getTotal(), is(500));
assertThat(result.getRows().size(), is(10));
assertThat(result.getRows().get(0).getJobName(), is("test_job_99"));
}
use of com.dangdang.ddframe.job.event.rdb.JobEventRdbSearch.Condition in project elastic-job by dangdangdotcom.
the class JobEventRdbSearchTest method assertFindJobStatusTraceEventsWithErrorSort.
@Test
public void assertFindJobStatusTraceEventsWithErrorSort() {
Result<JobStatusTraceEvent> result = repository.findJobStatusTraceEvents(new Condition(10, 1, "jobName", "ERROR_SORT", null, null, null));
assertThat(result.getTotal(), is(500));
assertThat(result.getRows().size(), is(10));
assertThat(result.getRows().get(0).getJobName(), is("test_job_1"));
result = repository.findJobStatusTraceEvents(new Condition(10, 1, "notExistField", "ASC", null, null, null));
assertThat(result.getTotal(), is(500));
assertThat(result.getRows().size(), is(10));
}
Aggregations