use of com.dangdang.ddframe.job.fixture.config.TestJobRootConfiguration in project elastic-job by dangdangdotcom.
the class JobConfigurationGsonTypeAdapterTest method assertFromSimpleJobJson.
@Test
public void assertFromSimpleJobJson() {
TestJobRootConfiguration actual = GsonFactory.getGson().fromJson(APIJsonConstants.getSimpleJobJson(ThrowJobExceptionHandler.class.getCanonicalName()), TestJobRootConfiguration.class);
TestJobRootConfiguration expected = new TestJobRootConfiguration(new TestSimpleJobConfiguration(ThrowJobExceptionHandler.class.getCanonicalName(), DefaultExecutorServiceHandler.class.getCanonicalName()).getTypeConfig());
assertThat(GsonFactory.getGson().toJson(actual), is(GsonFactory.getGson().toJson(expected)));
}
use of com.dangdang.ddframe.job.fixture.config.TestJobRootConfiguration in project elastic-job by dangdangdotcom.
the class JobConfigurationGsonTypeAdapterTest method assertFromScriptJobJson.
@Test
public void assertFromScriptJobJson() {
TestJobRootConfiguration actual = GsonFactory.getGson().fromJson(APIJsonConstants.getScriptJobJson(ThrowJobExceptionHandler.class.getCanonicalName()), TestJobRootConfiguration.class);
TestJobRootConfiguration expected = new TestJobRootConfiguration(new TestScriptJobConfiguration("test.sh", ThrowJobExceptionHandler.class).getTypeConfig());
assertThat(GsonFactory.getGson().toJson(actual), is(GsonFactory.getGson().toJson(expected)));
}
use of com.dangdang.ddframe.job.fixture.config.TestJobRootConfiguration in project elastic-job by dangdangdotcom.
the class JobConfigurationGsonTypeAdapterTest method assertFromDataflowJobJson.
@Test
public void assertFromDataflowJobJson() {
TestJobRootConfiguration actual = GsonFactory.getGson().fromJson(APIJsonConstants.getDataflowJobJson(IgnoreJobExceptionHandler.class.getCanonicalName()), TestJobRootConfiguration.class);
TestJobRootConfiguration expected = new TestJobRootConfiguration(new TestDataflowJobConfiguration(true).getTypeConfig());
assertThat(GsonFactory.getGson().toJson(actual), is(GsonFactory.getGson().toJson(expected)));
}
Aggregations