use of org.pentaho.di.core.row.value.ValueMetaString in project pentaho-kettle by pentaho.
the class JmsDelegate method getRowMeta.
/**
* Creates a rowMeta for output field names
*/
RowMetaInterface getRowMeta() {
RowMeta rowMeta = new RowMeta();
rowMeta.addValueMeta(new ValueMetaString(messageField));
rowMeta.addValueMeta(new ValueMetaString(destinationField));
return rowMeta;
}
use of org.pentaho.di.core.row.value.ValueMetaString in project pentaho-kettle by pentaho.
the class MQTTConsumerMeta method getRowMeta.
@Override
public RowMeta getRowMeta(String origin, VariableSpace space) {
RowMeta rowMeta = new RowMeta();
rowMeta.addValueMeta(new ValueMetaString(msgOutputName));
rowMeta.addValueMeta(new ValueMetaString(topicOutputName));
return rowMeta;
}
use of org.pentaho.di.core.row.value.ValueMetaString in project pentaho-kettle by pentaho.
the class SalesforceUpdateMetaTest method testGetFields.
@Test
public void testGetFields() throws KettleStepException {
SalesforceUpdateMeta meta = new SalesforceUpdateMeta();
meta.setDefault();
RowMetaInterface r = new RowMeta();
meta.getFields(r, "thisStep", null, null, new Variables(), null, null);
assertEquals(0, r.size());
r.clear();
r.addValueMeta(new ValueMetaString("testString"));
meta.getFields(r, "thisStep", null, null, new Variables(), null, null);
assertEquals(1, r.size());
assertEquals(ValueMetaInterface.TYPE_STRING, r.getValueMeta(0).getType());
assertEquals("testString", r.getValueMeta(0).getName());
}
use of org.pentaho.di.core.row.value.ValueMetaString in project pentaho-kettle by pentaho.
the class SalesforceUpdateTest method testWriteToSalesForceForNullExtIdField_WithExtIdYES.
@Test
public void testWriteToSalesForceForNullExtIdField_WithExtIdYES() throws Exception {
SalesforceUpdate sfInputStep = new SalesforceUpdate(smh.stepMeta, smh.stepDataInterface, 0, smh.transMeta, smh.trans);
SalesforceUpdateMeta meta = generateSalesforceUpdateMeta(new String[] { ACCOUNT_EXT_ID_ACCOUNT_ID_C_ACCOUNT }, new Boolean[] { true });
SalesforceUpdateData data = generateSalesforceUpdateData();
sfInputStep.init(meta, data);
RowMeta rowMeta = new RowMeta();
ValueMetaBase valueMeta = new ValueMetaString("AccExtId");
rowMeta.addValueMeta(valueMeta);
smh.initStepDataInterface.inputRowMeta = rowMeta;
sfInputStep.writeToSalesForce(new Object[] { null });
assertEquals(1, data.sfBuffer[0].getFieldsToNull().length);
assertEquals(ACCOUNT_ID, data.sfBuffer[0].getFieldsToNull()[0]);
assertNull(SalesforceConnection.getChildren(data.sfBuffer[0]));
}
use of org.pentaho.di.core.row.value.ValueMetaString in project pentaho-kettle by pentaho.
the class SalesforceUpdateTest method testWriteToSalesForceForNotNullExtIdField_WithExtIdYES.
@Test
public void testWriteToSalesForceForNotNullExtIdField_WithExtIdYES() throws Exception {
SalesforceUpdate sfInputStep = new SalesforceUpdate(smh.stepMeta, smh.stepDataInterface, 0, smh.transMeta, smh.trans);
SalesforceUpdateMeta meta = generateSalesforceUpdateMeta(new String[] { ACCOUNT_EXT_ID_ACCOUNT_ID_C_ACCOUNT }, new Boolean[] { true });
SalesforceUpdateData data = generateSalesforceUpdateData();
sfInputStep.init(meta, data);
RowMeta rowMeta = new RowMeta();
ValueMetaBase valueMeta = new ValueMetaString("AccExtId");
rowMeta.addValueMeta(valueMeta);
smh.initStepDataInterface.inputRowMeta = rowMeta;
sfInputStep.writeToSalesForce(new Object[] { "tkas88" });
assertEquals(0, data.sfBuffer[0].getFieldsToNull().length);
assertEquals(1, SalesforceConnection.getChildren(data.sfBuffer[0]).length);
assertEquals(Constants.PARTNER_SOBJECT_NS, SalesforceConnection.getChildren(data.sfBuffer[0])[0].getName().getNamespaceURI());
assertEquals("Account", SalesforceConnection.getChildren(data.sfBuffer[0])[0].getName().getLocalPart());
assertNull(SalesforceConnection.getChildren(data.sfBuffer[0])[0].getValue());
assertFalse(SalesforceConnection.getChildren(data.sfBuffer[0])[0].hasChildren());
}
Aggregations