use of co.cask.cdap.WebCrawlApp in project cdap by caskdata.
the class FlowVerificationTest method testFlowWithMoreOutputThanWhatInputCanHandle.
@Test
public void testFlowWithMoreOutputThanWhatInputCanHandle() 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());
// that is not connected to any input to flowlet CountByField.
if (entry.getValue().getName().equals("WordCountFlow")) {
Assert.assertTrue(result.getStatus() == VerifyResult.Status.FAILED);
} else {
Assert.assertTrue(result.getStatus() == VerifyResult.Status.SUCCESS);
}
}
}
use of co.cask.cdap.WebCrawlApp in project cdap by caskdata.
the class ApplicationVerificationTest method testGoodApplication.
/**
* Good test
*/
@Test
public void testGoodApplication() throws Exception {
ApplicationSpecification appSpec = Specifications.from(new WebCrawlApp());
ApplicationSpecificationAdapter adapter = ApplicationSpecificationAdapter.create(new ReflectionSchemaGenerator());
ApplicationSpecification newSpec = adapter.fromJson(adapter.toJson(appSpec));
ApplicationVerification app = new ApplicationVerification();
VerifyResult result = app.verify(new ApplicationId("test", newSpec.getName()), newSpec);
Assert.assertTrue(result.getMessage(), result.getStatus() == VerifyResult.Status.SUCCESS);
}
use of co.cask.cdap.WebCrawlApp 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