use of org.talend.designer.core.ui.editor.process.Process 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.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.
the class GenericNodeConnectorTest method before.
@Before
public void before() {
process = new Process(createProperty());
testNode = new Node(testComponent, process);
//$NON-NLS-1$
TestProperties testProps = (TestProperties) new TestProperties("test").init();
testNode.setComponentProperties(testProps);
}
use of org.talend.designer.core.ui.editor.process.Process 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));
}
}
use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.
the class ComponentListControllerTest method testrenameComponentUniqueName.
@Test
public void testrenameComponentUniqueName() {
//---first
String oldConnectionName = "joblet3_1";
String newConnectionName = "joblet1_1_joblet2_1_joblet3_1";
List<Node> nodesToUpdate = new ArrayList<Node>();
IComponent component = ComponentsFactoryProvider.getInstance().get("tMysqlInput", ComponentCategory.CATEGORY_4_DI.getName());
Property property = PropertiesFactory.eINSTANCE.createProperty();
property.setAuthor(((RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getUser());
property.setVersion(VersionUtils.DEFAULT_VERSION);
Process process = new Process(property);
Node node = new Node(component, process);
nodesToUpdate.add(node);
IElementParameter param = node.getElementParameter("CONNECTION");
param.setValue("joblet3_1_joblet4_1_joblet5_1_tMysqlConnection_1");
ComponentListController.renameComponentUniqueName(oldConnectionName, newConnectionName, nodesToUpdate);
assertTrue(param.getValue().equals("joblet1_1_joblet2_1_joblet3_1_joblet4_1_joblet5_1_tMysqlConnection_1"));
//---second
oldConnectionName = "tMysqlConnection_1";
newConnectionName = "joblet1_1_joblet2_1_tMysqlConnection_1";
param.setValue("tMysqlConnection_1_joblet4_1_joblet5_1_tMysqlConnection_1");
ComponentListController.renameComponentUniqueName(oldConnectionName, newConnectionName, nodesToUpdate);
assertTrue(param.getValue().equals("joblet1_1_joblet2_1_tMysqlConnection_1_joblet4_1_joblet5_1_tMysqlConnection_1"));
}
use of org.talend.designer.core.ui.editor.process.Process in project tdi-studio-se by Talend.
the class PostgresGenerationManagerTest method init.
private void init(String schema, String main_table, String lookup_table) {
List<IConnection> incomingConnections = new ArrayList<IConnection>();
String[] mainTableEntities = new String[] { "id", "name", "classNum" };
String[] lookupEndtities = new String[] { "id", "score" };
incomingConnections.add(mockConnection(schema, main_table, mainTableEntities));
incomingConnections.add(mockConnection(schema, lookup_table, lookupEndtities));
component.setIncomingConnections(incomingConnections);
ExternalDbMapData externalData = new ExternalDbMapData();
List<ExternalDbMapTable> inputs = new ArrayList<ExternalDbMapTable>();
List<ExternalDbMapTable> outputs = new ArrayList<ExternalDbMapTable>();
// main table
ExternalDbMapTable inputTable = new ExternalDbMapTable();
inputTable.setTableName(schema + "." + main_table);
List<ExternalDbMapEntry> entities = getMetadataEntities(mainTableEntities, new String[3]);
inputTable.setMetadataTableEntries(entities);
inputs.add(inputTable);
// lookup table
inputTable = new ExternalDbMapTable();
inputTable.setTableName(schema + "." + lookup_table);
entities = getMetadataEntities(lookupEndtities, new String[2]);
inputTable.setMetadataTableEntries(entities);
inputs.add(inputTable);
// output
ExternalDbMapTable outputTable = new ExternalDbMapTable();
outputTable.setName("grade");
List<ExternalDbMapEntry> conditions = new ArrayList<ExternalDbMapEntry>();
conditions.add(new ExternalDbMapEntry(schema + "." + main_table + ".id =3"));
outputTable.setCustomWhereConditionsEntries(conditions);
String[] names = new String[] { "id", "name", "classNum", "score" };
String[] expressions = new String[] { schema + "." + main_table + ".id", schema + "." + main_table + ".name", schema + "." + main_table + ".classNum", schema + "." + lookup_table + ".score" };
outputTable.setMetadataTableEntries(getMetadataEntities(names, expressions));
outputs.add(outputTable);
externalData.setInputTables(inputs);
externalData.setOutputTables(outputs);
component.setExternalData(externalData);
List<IMetadataTable> metadataList = new ArrayList<IMetadataTable>();
MetadataTable metadataTable = getMetadataTable(names);
metadataTable.setLabel("grade");
metadataList.add(metadataTable);
component.setMetadataList(metadataList);
Process process = mock(Process.class);
when(process.getContextManager()).thenReturn(new JobContextManager());
component.setProcess(process);
}
Aggregations