use of co.cask.cdap.internal.io.ReflectionSchemaGenerator in project cdap by caskdata.
the class WorkflowVerificationTest method testGoodWorkflow.
@Test
public void testGoodWorkflow() throws Exception {
ApplicationSpecification appSpec = Specifications.from(new GoodWorkflowApp());
verifyGoodWorkflowSpecifications(appSpec);
verifyAnotherGoodWorkflowSpecification(appSpec);
verifyWorkflowWithLocalDatasetSpecification(appSpec);
ApplicationSpecificationAdapter adapter = ApplicationSpecificationAdapter.create(new ReflectionSchemaGenerator());
ApplicationSpecification newSpec = adapter.fromJson(adapter.toJson(appSpec));
verifyGoodWorkflowSpecifications(newSpec);
verifyAnotherGoodWorkflowSpecification(newSpec);
verifyWorkflowWithLocalDatasetSpecification(newSpec);
}
use of co.cask.cdap.internal.io.ReflectionSchemaGenerator in project cdap by caskdata.
the class FlowVerificationTest method testValidFlow.
@Test
public void testValidFlow() throws Exception {
ApplicationSpecification appSpec = Specifications.from(new WebCrawlApp());
ApplicationSpecificationAdapter adapter = ApplicationSpecificationAdapter.create(new ReflectionSchemaGenerator());
ApplicationSpecification newSpec = adapter.fromJson(adapter.toJson(appSpec));
FlowVerification flowSpec = new FlowVerification();
for (Map.Entry<String, FlowSpecification> entry : newSpec.getFlows().entrySet()) {
VerifyResult result = flowSpec.verify(new ApplicationId("test", newSpec.getName()), entry.getValue());
Assert.assertTrue(result.getStatus() == VerifyResult.Status.SUCCESS);
}
}
Aggregations