use of org.talend.core.model.metadata.MetadataColumn in project tdi-studio-se by Talend.
the class ConnectionCreateActionTest method createSimpleMetadata.
private IMetadataTable createSimpleMetadata() {
IMetadataTable table = new org.talend.core.model.metadata.MetadataTable();
IMetadataColumn column1 = new MetadataColumn();
//$NON-NLS-1$
column1.setLabel("C1");
//$NON-NLS-1$
column1.setTalendType("id_String");
table.getListColumns().add(column1);
IMetadataColumn column2 = new MetadataColumn();
//$NON-NLS-1$
column2.setLabel("C2");
//$NON-NLS-1$
column2.setTalendType("id_String");
table.getListColumns().add(column2);
IMetadataColumn column3 = new MetadataColumn();
//$NON-NLS-1$
column3.setLabel("C3");
//$NON-NLS-1$
column3.setTalendType("id_Integer");
table.getListColumns().add(column3);
return table;
}
use of org.talend.core.model.metadata.MetadataColumn in project tdi-studio-se by Talend.
the class NodeQueryCheckUtilTest method createSimpleMetadata.
private IMetadataTable createSimpleMetadata() {
IMetadataTable table = new org.talend.core.model.metadata.MetadataTable();
IMetadataColumn column1 = new MetadataColumn();
//$NON-NLS-1$
column1.setLabel("C1");
//$NON-NLS-1$
column1.setTalendType("id_String");
table.getListColumns().add(column1);
IMetadataColumn column2 = new MetadataColumn();
//$NON-NLS-1$
column2.setLabel("C2");
//$NON-NLS-1$
column2.setTalendType("id_String");
table.getListColumns().add(column2);
IMetadataColumn column3 = new MetadataColumn();
//$NON-NLS-1$
column3.setLabel("C3");
//$NON-NLS-1$
column3.setTalendType("id_String");
table.getListColumns().add(column3);
IMetadataColumn column4 = new MetadataColumn();
//$NON-NLS-1$
column4.setLabel("C4");
//$NON-NLS-1$
column4.setTalendType("id_String");
table.getListColumns().add(column4);
return table;
}
use of org.talend.core.model.metadata.MetadataColumn in project tdi-studio-se by Talend.
the class FunctionManagerExtTest method testGetOneColDataNull2.
@Test
public void testGetOneColDataNull2() {
// test function/function name as null or ""
FunctionManagerExt functionManagerExt = new FunctionManagerExt();
MetadataColumn newColumn = new MetadataColumn();
//$NON-NLS-1$
newColumn.setLabel("newColumn");
newColumn.setTalendType(JavaTypesManager.STRING.getId());
MetadataColumnExt columnExt = new MetadataColumnExt(newColumn);
assertNull(functionManagerExt.getOneColData(columnExt));
Function function = new Function();
columnExt.setFunction(function);
String value = functionManagerExt.getOneColData(columnExt);
//$NON-NLS-1$
assertEquals(value, "");
}
use of org.talend.core.model.metadata.MetadataColumn in project tdi-studio-se by Talend.
the class FunctionManagerExtTest method testGetOneColDataDefaultFunction.
@Test
public void testGetOneColDataDefaultFunction() {
FunctionManagerExt functionManagerExt = new FunctionManagerExt();
MetadataColumn newColumn = new MetadataColumn();
//$NON-NLS-1$
newColumn.setLabel("newColumn");
newColumn.setTalendType(JavaTypesManager.STRING.getId());
MetadataColumnExt columnExt = new MetadataColumnExt(newColumn);
// Function name as "PURE_PERL_NAME"
Function function = new Function();
function.setName(PURE_PERL_NAME);
function.setDescription(PURE_PERL_DESC);
StringParameter param = new StringParameter();
param.setName(PURE_PERL_PARAM);
//$NON-NLS-1$
param.setValue("value1");
List<Parameter> params = new ArrayList<Parameter>();
params.add(param);
function.setParameters(params);
columnExt.setFunction(function);
String value = functionManagerExt.getOneColData(columnExt);
assertEquals(value, param.getValue());
}
use of org.talend.core.model.metadata.MetadataColumn in project tdi-studio-se by Talend.
the class JavaProcessorUtilitiesTest method createMetadataColumns.
private void createMetadataColumns(IMetadataTable table, int columns) {
for (int i = 0; i < columns; i++) {
MetadataColumn newColumn = new MetadataColumn();
newColumn.setLabel("newColumn" + i);
newColumn.setTalendType("id_String");
table.getListColumns().add(newColumn);
}
}
Aggregations