use of org.talend.camel.designer.codegen.CamelCodeGenerator in project tesb-studio-se by Talend.
the class ECamelTemplateTest method testGetTemplateURL.
/**
* Test method for {@link org.talend.camel.designer.codegen.config.ECamelTemplate#getTemplateURL()}.
*/
@Test
public void testGetTemplateURL() {
ECamelTemplate.CONTEXT.getTemplateURL();
ECamelTemplate.CAMEL_SPECIALLINKS.getTemplateURL();
ProcessItem processItem = PropertiesFactory.eINSTANCE.createProcessItem();
Property myProperty = PropertiesFactory.eINSTANCE.createProperty();
String id = ProxyRepositoryFactory.getInstance().getNextId();
myProperty.setId(id);
ItemState itemState = PropertiesFactory.eINSTANCE.createItemState();
itemState.setDeleted(false);
itemState.setPath("");
processItem.setState(itemState);
processItem.setProperty(myProperty);
myProperty.setLabel("myRoute");
myProperty.setVersion("0.1");
processItem.setProcess(TalendFileFactory.eINSTANCE.createProcessType());
// $NON-NLS-1$ //$NON-NLS-2$
IComponent component = ComponentsFactoryProvider.getInstance().get("cTimer", "CAMEL");
RouteProcess process = new RouteProcess(myProperty);
process.setId("routeprocess");
INode nodeTimer = new Node(component, process);
nodeTimer.setLabel("cTimer_1");
CamelCodeGenerator codeGenerator = new CamelCodeGenerator(process, false, false);
try {
String code = codeGenerator.generateProcessCode();
} catch (CodeGeneratorException e) {
e.printStackTrace();
fail("Test testGetTemplateURL() method failure.");
}
}
Aggregations