use of org.pentaho.di.trans.steps.file.BaseFileField in project pentaho-kettle by pentaho.
the class TextFileInputContentParsingTest method testFixedWidthCharacters.
@Test
public void testFixedWidthCharacters() throws Exception {
meta.content.header = false;
meta.content.fileType = "Fixed";
meta.content.fileFormat = "DOS";
meta.content.encoding = "ISO-8859-1";
meta.content.length = "Characters";
initByFile("test-fixed-length-characters.txt");
setFields(new BaseFileField("f1", 0, 3), new BaseFileField("f2", 3, 2), new BaseFileField("f3", 5, 2), new BaseFileField("f4", 7, 4));
process();
check(new Object[][] { { "ABC", "DE", "FG", "HIJK" }, { "LmN", "oP", "qR", "sTuV" } });
}
use of org.pentaho.di.trans.steps.file.BaseFileField in project pentaho-kettle by pentaho.
the class TextFileInputContentParsingTest method testBOM_UTF16BE.
@Test
public void testBOM_UTF16BE() throws Exception {
meta.content.encoding = "UTF-32LE";
meta.content.header = false;
initByFile("test-BOM-UTF-16BE.txt");
setFields(new BaseFileField("f1", -1, -1), new BaseFileField("f2", -1, -1));
process();
check(new Object[][] { { "data", "1" } });
}
use of org.pentaho.di.trans.steps.file.BaseFileField in project pentaho-kettle by pentaho.
the class TextFileInputContentParsingTest method testBOM_UTF8.
@Test
public void testBOM_UTF8() throws Exception {
meta.content.encoding = "UTF-32LE";
meta.content.header = false;
initByFile("test-BOM-UTF-8.txt");
setFields(new BaseFileField("f1", -1, -1), new BaseFileField("f2", -1, -1));
process();
check(new Object[][] { { "data", "1" } });
}
use of org.pentaho.di.trans.steps.file.BaseFileField in project pentaho-kettle by pentaho.
the class TextFileInputContentParsingTest method testHeader.
@Test
public void testHeader() throws Exception {
meta.content.header = false;
initByFile("default.csv");
setFields(new BaseFileField("f1", -1, -1), new BaseFileField("f2", -1, -1), new BaseFileField("f2", -1, -1));
process();
check(new Object[][] { { "Field 1", "Field 2", "Field 3" }, { "first", "1", "1.1" }, { "second", "2", "2.2" }, { "third", "3", "3.3" } });
}
use of org.pentaho.di.trans.steps.file.BaseFileField in project pentaho-kettle by pentaho.
the class TextFileInputContentParsingTest method testVfsGzipCompression.
@Test
public void testVfsGzipCompression() throws Exception {
meta.content.fileCompression = "None";
String url = "gz:" + this.getClass().getResource(inPrefix + "default.csv.gz");
initByURL(url);
setFields(new BaseFileField("f1", -1, -1), new BaseFileField("f2", -1, -1), new BaseFileField("f2", -1, -1));
process();
check(new Object[][] { { "first", "1", "1.1" }, { "second", "2", "2.2" }, { "third", "3", "3.3" } });
}
Aggregations