use of org.talend.sdk.component.starter.server.model.ProjectModel in project component-runtime by Talend.
the class ProjectResourceTest method beamFacet.
@Test
void beamFacet(final WebTarget target) throws IOException {
final ProjectModel projectModel = new ProjectModel();
projectModel.setPackageBase("com.foo");
projectModel.setFacets(singletonList("Apache Beam"));
{
final ProjectModel.Source source = new ProjectModel.Source();
source.setName("tIn");
source.setGenericOutput(true);
projectModel.setSources(singletonList(source));
}
{
final ProjectModel.Processor proc = new ProjectModel.Processor();
proc.setName("tIn");
{
final ProjectModel.NamedModel in = new ProjectModel.NamedModel();
in.setName("__default__");
in.setGeneric(true);
proc.setInputStructures(singletonList(in));
}
proc.setOutputStructures(emptyList());
projectModel.setProcessors(singletonList(proc));
}
final Map<String, String> files = createZip(projectModel, target);
assertTrue(files.get("application/README.adoc").contains("=== Apache Beam"), files.toString());
assertEquals(resourceFileToString("generated/ProjectResourceTest/beamFacet/TInMapperBeamTest.java"), files.get("application/src/test/java/com/foo/source/TInMapperBeamTest.java"));
assertEquals(resourceFileToString("generated/ProjectResourceTest/beamFacet/TInOutputBeamTest.java"), files.get("application/src/test/java/com/foo/output/TInOutputBeamTest.java"));
}
use of org.talend.sdk.component.starter.server.model.ProjectModel in project component-runtime by Talend.
the class ProjectResourceTest method codenvyFacet.
@Test
void codenvyFacet(final WebTarget target) throws IOException {
final ProjectModel projectModel = new ProjectModel();
projectModel.setPackageBase("com.foo");
projectModel.setFacets(singletonList("Codenvy"));
final Map<String, String> files = createZip(projectModel, target);
assertEquals(resourceFileToString("generated/ProjectResourceTest/codenvy/README.adoc").trim(), files.get("application/README.adoc").trim());
assertEquals(resourceFileToString("generated/ProjectResourceTest/codenvy/codenvy.json"), files.get("application/.codenvy.json"));
}
Aggregations