Search in sources :

Example 61 with ValueMetaString

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;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta)

Example 62 with ValueMetaString

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;
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta)

Example 63 with ValueMetaString

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());
}
Also used : Variables(org.pentaho.di.core.variables.Variables) ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) SalesforceMetaTest(org.pentaho.di.trans.steps.salesforce.SalesforceMetaTest) Test(org.junit.Test)

Example 64 with ValueMetaString

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]));
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) ValueMetaBase(org.pentaho.di.core.row.value.ValueMetaBase) Test(org.junit.Test)

Example 65 with ValueMetaString

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());
}
Also used : ValueMetaString(org.pentaho.di.core.row.value.ValueMetaString) RowMeta(org.pentaho.di.core.row.RowMeta) ValueMetaBase(org.pentaho.di.core.row.value.ValueMetaBase) Test(org.junit.Test)

Aggregations

ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)447 RowMeta (org.pentaho.di.core.row.RowMeta)219 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)181 Test (org.junit.Test)179 ValueMetaInteger (org.pentaho.di.core.row.value.ValueMetaInteger)176 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)141 RowMetaAndData (org.pentaho.di.core.RowMetaAndData)86 ValueMetaBoolean (org.pentaho.di.core.row.value.ValueMetaBoolean)67 ValueMetaNumber (org.pentaho.di.core.row.value.ValueMetaNumber)66 ValueMetaDate (org.pentaho.di.core.row.value.ValueMetaDate)57 KettleException (org.pentaho.di.core.exception.KettleException)40 ArrayList (java.util.ArrayList)33 LongObjectId (org.pentaho.di.repository.LongObjectId)29 ValueMetaBigNumber (org.pentaho.di.core.row.value.ValueMetaBigNumber)27 ValueMetaBinary (org.pentaho.di.core.row.value.ValueMetaBinary)26 ObjectId (org.pentaho.di.repository.ObjectId)26 ValueMetaTimestamp (org.pentaho.di.core.row.value.ValueMetaTimestamp)21 RowSet (org.pentaho.di.core.RowSet)18 Date (java.util.Date)17 ValueMetaBase (org.pentaho.di.core.row.value.ValueMetaBase)16