use of org.talend.core.model.components.IComponent in project tdi-studio-se by Talend.
the class ComponentsUtilsTest method testLoadComponents.
@Test
public void testLoadComponents() {
ComponentService componentService = ComponentsUtils.getComponentService();
Set<ComponentDefinition> componentDefinitions = componentService.getAllComponents();
Set<IComponent> coms = ComponentsFactoryProvider.getInstance().getComponents();
List<IComponent> comList = new ArrayList<IComponent>();
for (ComponentDefinition componentDefinition : componentDefinitions) {
for (IComponent com : coms) {
if (com.getName().equals(componentDefinition.getName())) {
comList.add(com);
break;
}
}
}
coms.removeAll(comList);
ComponentsUtils.loadComponents(componentService);
coms = ComponentsFactoryProvider.getInstance().getComponents();
for (ComponentDefinition componentDefinition : componentDefinitions) {
if (!componentDefinition.getName().equals("tJIRAInput")) {
continue;
}
for (IComponent com : coms) {
if (com.getName().equals(componentDefinition.getName())) {
assertFalse("Component loaded: " + componentDefinition.getName(), true);
}
}
}
}
use of org.talend.core.model.components.IComponent in project tdi-studio-se by Talend.
the class ComponentContextPropertyValueEvaluatorTest method before.
@Before
public void before() {
//$NON-NLS-1$ //$NON-NLS-2$
IComponent component = ComponentsFactoryProvider.getInstance().get("tSalesforceInput", "DI");
node = new Node(component, new Process(new FakePropertyImpl()));
props = node.getComponentProperties();
evaluator = new ComponentContextPropertyValueEvaluator(node);
}
use of org.talend.core.model.components.IComponent in project tdi-studio-se by Talend.
the class ComponentTest method testGetElementParameterValueFromComponentProperties.
@Test
public void testGetElementParameterValueFromComponentProperties() {
//$NON-NLS-1$ //$NON-NLS-2$
IComponent sfComponent = ComponentsFactoryProvider.getInstance().get("tSalesforceInput", "DI");
INode node = new Node(sfComponent, new Process(new FakePropertyImpl()));
ComponentProperties props = node.getComponentProperties();
Form form = props.getForm(Form.MAIN);
IElementParameter param = new GenericElementParameter(node, node.getComponentProperties(), form, form.getWidget("condition"), //$NON-NLS-1$
null);
Object obj = component.getElementParameterValueFromComponentProperties(node, param);
Assert.assertNotNull(obj);
}
use of org.talend.core.model.components.IComponent in project tdi-studio-se by Talend.
the class GenericElementParameterTest method before.
@Before
public void before() {
ComponentService componentService = ComponentsUtils.getComponentService();
//$NON-NLS-1$
TestProperties props = (TestProperties) new TestProperties("test").init();
Form form = props.getForm(Form.MAIN);
//$NON-NLS-1$ //$NON-NLS-2$
IComponent component = ComponentsFactoryProvider.getInstance().get("tSalesforceConnection", "DI");
INode node = new Node(component, new Process(new FakePropertyImpl()));
parameter = new GenericElementParameter(node, props, form, form.getWidget(props.userId), componentService);
}
use of org.talend.core.model.components.IComponent 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));
}
}
Aggregations