Search in sources :

Example 31 with ValueMetaBase

use of org.pentaho.di.core.row.value.ValueMetaBase in project pentaho-cassandra-plugin by pentaho.

the class CQL3SSTableWriterTest method getCql3SSTableWriter.

private CQL3SSTableWriter getCql3SSTableWriter() {
    CQL3SSTableWriter writer = new CQL3SSTableWriterStub();
    writer.setPrimaryKey(KEY_FIELD);
    RowMetaInterface rmi = mock(RowMetaInterface.class);
    ValueMetaInterface one = new ValueMetaBase(KEY_FIELD, ValueMetaBase.TYPE_INTEGER);
    ValueMetaInterface two = new ValueMetaBase(COLUMN, ValueMetaBase.TYPE_STRING);
    List<ValueMetaInterface> valueMetaList = new ArrayList<ValueMetaInterface>();
    valueMetaList.add(one);
    valueMetaList.add(two);
    String[] fieldNames = new String[] { "key", "two" };
    doReturn(valueMetaList).when(rmi).getValueMetaList();
    doReturn(fieldNames).when(rmi).getFieldNames();
    writer.setRowMeta(rmi);
    writer.setBufferSize(BUFFER_SIZE);
    writer.setTable(TABLE);
    writer.setKeyspace(KEY_SPACE);
    writer.setDirectory(DIRECTORY_PATH);
    writer.setPartitionerClass("org.apache.cassandra.dht.Murmur3Partitioner");
    return writer;
}
Also used : ArrayList(java.util.ArrayList) RowMetaInterface(org.pentaho.di.core.row.RowMetaInterface) ValueMetaInterface(org.pentaho.di.core.row.ValueMetaInterface) ValueMetaBase(org.pentaho.di.core.row.value.ValueMetaBase)

Aggregations

ValueMetaBase (org.pentaho.di.core.row.value.ValueMetaBase)31 RowMeta (org.pentaho.di.core.row.RowMeta)26 Test (org.junit.Test)25 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)16 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)13 ArrayList (java.util.ArrayList)7 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)7 Matchers.anyString (org.mockito.Matchers.anyString)3 Strings.nullToEmpty (com.google.common.base.Strings.nullToEmpty)2 XmlObject (com.sforce.ws.bind.XmlObject)2 List (java.util.List)2 SWT (org.eclipse.swt.SWT)2 CTabFolder (org.eclipse.swt.custom.CTabFolder)2 CTabItem (org.eclipse.swt.custom.CTabItem)2 ModifyListener (org.eclipse.swt.events.ModifyListener)2 Image (org.eclipse.swt.graphics.Image)2 FormAttachment (org.eclipse.swt.layout.FormAttachment)2 FormData (org.eclipse.swt.layout.FormData)2 FormLayout (org.eclipse.swt.layout.FormLayout)2 Button (org.eclipse.swt.widgets.Button)2