Package org.gbif.utils.file.tabular
Class TabularDataFileReaderTest
java.lang.Object
org.gbif.utils.file.tabular.TabularDataFileReaderTest
Unit tests for
TabularDataFileReader.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidTest a CSV with all cells quoted.voidTest extracting a CSV file containing embedded JSON, which itself contains escaped quotes.voidTest a CSV file that includes a newline character (\n) inside a properly quoted cell.voidvoidvoidEnsure if we can escape a quote character with a backslashvoidvoidtestTab()Testing classic non quoted tab files with escaped \t tabs.voidTSV cannot encode tabs or newlines, so there is no escape character.voidvoid
-
Constructor Details
-
TabularDataFileReaderTest
public TabularDataFileReaderTest()
-
-
Method Details
-
testCsvOptionalQuotes
- Throws:
IOExceptionParseException
-
testEscapedQuotes
Ensure if we can escape a quote character with a backslash- Throws:
IOExceptionParseException
-
testWrongEscapedQuotes1
- Throws:
IOException
-
testWrongEscapedQuotes2
- Throws:
IOException
-
testCsvAlwaysQuotes
Test a CSV with all cells quoted.- Throws:
IOExceptionParseException
-
testCsvMultiline
Test a CSV file that includes a newline character (\n) inside a properly quoted cell.- Throws:
IOExceptionParseException
-
testTab
Testing classic non quoted tab files with escaped \t tabs.- Throws:
IOExceptionParseException
-
testCsvWithComment
- Throws:
IOExceptionParseException
-
testIgnoreEmptyLines
- Throws:
IOExceptionParseException
-
testCsvJsonEscapedQuotes
Test extracting a CSV file containing embedded JSON, which itself contains escaped quotes. JSON value like: { "test": "value, \"like\" this" } Would become in CSV: "{ ""test"": ""value, \""like\"" this"" }"- Throws:
IOExceptionParseException
-
testTsvBackslashes
TSV cannot encode tabs or newlines, so there is no escape character.- Throws:
IOExceptionParseException
-