Search in sources :

Example 61 with TextFileInputField

use of org.pentaho.di.trans.steps.textfileinput.TextFileInputField in project pentaho-kettle by pentaho.

the class TextFileInputCSVImportProgressDialogTest method fileMixFormatTestWithNoEnclosures.

@Test
public void fileMixFormatTestWithNoEnclosures() throws Exception {
    TextFileInputField[] inputFileFields = createInputFileFields("String", "Number", "Boolean", "Date");
    String fileContent = "String, int, boolean, date\n" + "レコード名1,1.7976E308,true,9999/12/31 23:59:59.999,\r\n" + "\"あa1\",123456789,false,2016/1/5 12:00:00.000\r\n";
    fileContentTest(fileContent, inputFileFields, TextFileInputMeta.FILE_FORMAT_MIXED);
}
Also used : TextFileInputField(org.pentaho.di.trans.steps.textfileinput.TextFileInputField) Matchers.anyString(org.mockito.Matchers.anyString) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 62 with TextFileInputField

use of org.pentaho.di.trans.steps.textfileinput.TextFileInputField in project pentaho-kettle by pentaho.

the class TextFileInputCSVImportProgressDialogTest method createField.

private TextFileInputField createField(String name) {
    TextFileInputField field = new TextFileInputField();
    field.setName(name);
    field.setType(ValueMetaInterface.TYPE_NONE);
    return field;
}
Also used : TextFileInputField(org.pentaho.di.trans.steps.textfileinput.TextFileInputField)

Example 63 with TextFileInputField

use of org.pentaho.di.trans.steps.textfileinput.TextFileInputField in project pentaho-kettle by pentaho.

the class TextFileInputCSVImportProgressDialogTest method fileUnixFormatTestWithNoEnclosures.

@Test
public void fileUnixFormatTestWithNoEnclosures() throws Exception {
    TextFileInputField[] inputFileFields = createInputFileFields("String", "Number", "Boolean", "Date");
    String fileContent = "String, int, boolean, date\n" + "レコード名1,1.7976E308,true,9999/12/31 23:59:59.999,\n" + "\"あa1\",123456789,false,2016/1/5 12:00:00.000\n";
    fileContentTest(fileContent, inputFileFields, TextFileInputMeta.FILE_FORMAT_UNIX);
}
Also used : TextFileInputField(org.pentaho.di.trans.steps.textfileinput.TextFileInputField) Matchers.anyString(org.mockito.Matchers.anyString) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

TextFileInputField (org.pentaho.di.trans.steps.textfileinput.TextFileInputField)63 Test (org.junit.Test)18 KettleException (org.pentaho.di.core.exception.KettleException)14 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)12 KettleStepException (org.pentaho.di.core.exception.KettleStepException)11 KettleXMLException (org.pentaho.di.core.exception.KettleXMLException)11 TableItem (org.eclipse.swt.widgets.TableItem)10 ArrayList (java.util.ArrayList)6 Matchers.anyString (org.mockito.Matchers.anyString)6 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)6 ValueMetaInterface (org.pentaho.di.core.row.ValueMetaInterface)5 KettleFileException (org.pentaho.di.core.exception.KettleFileException)4 SdkClientException (com.amazonaws.SdkClientException)3 File (java.io.File)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 DecimalFormat (java.text.DecimalFormat)2 DecimalFormatSymbols (java.text.DecimalFormatSymbols)2 SimpleDateFormat (java.text.SimpleDateFormat)2 Date (java.util.Date)2 HashMap (java.util.HashMap)2