use of org.pentaho.di.trans.steps.file.BaseFileField in project pentaho-kettle by pentaho.
the class TextFileInputContentParsingTest method testEscape.
@Test
public void testEscape() throws Exception {
meta.content.escapeCharacter = "\\";
initByFile("escape.csv");
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;third", "3", "3.3" } });
}
use of org.pentaho.di.trans.steps.file.BaseFileField in project pentaho-kettle by pentaho.
the class TextFileInputContentParsingTest method testGzipCompression.
@Test
public void testGzipCompression() throws Exception {
meta.content.fileCompression = "GZip";
initByFile("default.csv.gz");
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" } });
}
use of org.pentaho.di.trans.steps.file.BaseFileField in project pentaho-kettle by pentaho.
the class TextFileInputContentParsingTest method testFixedWidth.
@Test
public void testFixedWidth() throws Exception {
meta.content.fileType = "Fixed";
initByFile("fixed.csv");
setFields(new BaseFileField("f1", 0, 7), new BaseFileField("f2", 8, 7), new BaseFileField("f3", 16, 7));
process();
check(new Object[][] { { "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 testVfsBzip2Compression.
@Test
public void testVfsBzip2Compression() throws Exception {
meta.content.fileCompression = "None";
String url = "bz2:" + this.getClass().getResource(inPrefix + "default.csv.bz2");
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" } });
}
use of org.pentaho.di.trans.steps.file.BaseFileField in project pentaho-kettle by pentaho.
the class TextFileInputContentParsingTest method testFilterEmptyBacklog5381.
@Test
public void testFilterEmptyBacklog5381() throws Exception {
meta.content.header = false;
meta.content.fileType = "Fixed";
meta.content.noEmptyLines = true;
meta.content.fileFormat = "mixed";
initByFile("filterempty-BACKLOG-5381.csv");
setFields(new BaseFileField("f", 0, 100));
process();
check(new Object[][] { { "FirstLine => FirstLine " }, { "ThirdLine => SecondLine" }, { "SixthLine => ThirdLine" }, { "NinthLine => FourthLine" }, { "" } });
}
Aggregations