Search in sources :

Example 1 with IESBRunContainerService

use of org.talend.designer.runprocess.IESBRunContainerService in project tesb-studio-se by Talend.

the class LocalESBRunContainerServiceTest method testCreateJavaProcessor.

/**
     * Test method for
     * {@link org.talend.designer.esb.runcontainer.core.LocalESBRunContainerService#createJavaProcessor(org.talend.core.model.process.IProcess, Property, boolean)}
     */
@Test
public void testCreateJavaProcessor() {
    IESBRunContainerService service = (IESBRunContainerService) GlobalServiceRegister.getDefault().getService(IESBRunContainerService.class);
    String[] esbComponents = { "tESBProviderRequest", "tRESTClient", "tRESTRequest", "tRESTResponse", "tESBConsumer", "tESBProviderFault", "tESBProviderRequest", "tESBProviderResponse" };
    for (String esbComponent : esbComponents) {
        Property property = PropertiesFactory.eINSTANCE.createProperty();
        property.setVersion("0.1");
        property.setId("property1");
        property.setLabel("ESBArtifact");
        ProcessItem processItem = PropertiesFactory.eINSTANCE.createProcessItem();
        processItem.setProperty(property);
        property.setItem(processItem);
        ProcessType process = TalendFileFactory.eINSTANCE.createProcessType();
        processItem.setProcess(process);
        NodeType node = TalendFileFactory.eINSTANCE.createNodeType();
        process.getNode().add(node);
        node.setComponentName(esbComponent);
        IComponent tESBComponent = ComponentsFactoryProvider.getInstance().get(esbComponent, ComponentCategory.CATEGORY_4_DI.getName());
        Process esbJob = new Process(property);
        Node tESBComponent_1 = new Node(tESBComponent, esbJob);
        esbJob.addNodeContainer(new NodeContainer(tESBComponent_1));
        Assert.assertNotNull(service.createJavaProcessor(esbJob, property, false));
    }
}
Also used : ProcessType(org.talend.designer.core.model.utils.emf.talendfile.ProcessType) IESBRunContainerService(org.talend.designer.runprocess.IESBRunContainerService) ProcessItem(org.talend.core.model.properties.ProcessItem) IComponent(org.talend.core.model.components.IComponent) NodeType(org.talend.designer.core.model.utils.emf.talendfile.NodeType) Node(org.talend.designer.core.ui.editor.nodes.Node) Process(org.talend.designer.core.ui.editor.process.Process) NodeContainer(org.talend.designer.core.ui.editor.nodecontainer.NodeContainer) Property(org.talend.core.model.properties.Property) Test(org.junit.Test)

Example 2 with IESBRunContainerService

use of org.talend.designer.runprocess.IESBRunContainerService in project tesb-studio-se by Talend.

the class LocalESBRunContainerServiceTest method testCreateJavaProcessor.

/**
 * Test method for
 * {@link org.talend.designer.esb.runcontainer.core.LocalESBRunContainerService#createJavaProcessor(org.talend.core.model.process.IProcess, Property, boolean)}
 */
@Test
public void testCreateJavaProcessor() {
    IESBRunContainerService service = (IESBRunContainerService) GlobalServiceRegister.getDefault().getService(IESBRunContainerService.class);
    String[] esbComponents = { "tESBProviderRequest", "tRESTClient", "tRESTRequest", "tRESTResponse", "tESBConsumer", "tESBProviderFault", "tESBProviderRequest", "tESBProviderResponse" };
    for (String esbComponent : esbComponents) {
        Property property = PropertiesFactory.eINSTANCE.createProperty();
        property.setVersion("0.1");
        property.setId("property1");
        property.setLabel("ESBArtifact");
        ProcessItem processItem = PropertiesFactory.eINSTANCE.createProcessItem();
        processItem.setProperty(property);
        property.setItem(processItem);
        ProcessType process = TalendFileFactory.eINSTANCE.createProcessType();
        processItem.setProcess(process);
        NodeType node = TalendFileFactory.eINSTANCE.createNodeType();
        process.getNode().add(node);
        node.setComponentName(esbComponent);
        IComponent tESBComponent = ComponentsFactoryProvider.getInstance().get(esbComponent, ComponentCategory.CATEGORY_4_DI.getName());
        Process esbJob = new Process(property);
        Node tESBComponent_1 = new Node(tESBComponent, esbJob);
        esbJob.addNodeContainer(new NodeContainer(tESBComponent_1));
        Assert.assertNotNull(service.createJavaProcessor(esbJob, property, false));
    }
}
Also used : ProcessType(org.talend.designer.core.model.utils.emf.talendfile.ProcessType) IESBRunContainerService(org.talend.designer.runprocess.IESBRunContainerService) ProcessItem(org.talend.core.model.properties.ProcessItem) IComponent(org.talend.core.model.components.IComponent) NodeType(org.talend.designer.core.model.utils.emf.talendfile.NodeType) Node(org.talend.designer.core.ui.editor.nodes.Node) Process(org.talend.designer.core.ui.editor.process.Process) NodeContainer(org.talend.designer.core.ui.editor.nodecontainer.NodeContainer) Property(org.talend.core.model.properties.Property) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 IComponent (org.talend.core.model.components.IComponent)2 ProcessItem (org.talend.core.model.properties.ProcessItem)2 Property (org.talend.core.model.properties.Property)2 NodeType (org.talend.designer.core.model.utils.emf.talendfile.NodeType)2 ProcessType (org.talend.designer.core.model.utils.emf.talendfile.ProcessType)2 NodeContainer (org.talend.designer.core.ui.editor.nodecontainer.NodeContainer)2 Node (org.talend.designer.core.ui.editor.nodes.Node)2 Process (org.talend.designer.core.ui.editor.process.Process)2 IESBRunContainerService (org.talend.designer.runprocess.IESBRunContainerService)2