-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
csv/src/test/java/com/fasterxml/jackson/dataformat/csv/NullReader122Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.fasterxml.jackson.dataformat.csv; | ||
|
||
import java.io.*; | ||
import java.util.Map; | ||
|
||
import com.fasterxml.jackson.databind.ObjectReader; | ||
|
||
public class NullReader122Test extends ModuleTestBase | ||
{ | ||
private final CsvMapper MAPPER = mapperForCsv(); | ||
|
||
// for [dataformats-text#122]: passing `null` Reader leads to infinite loop | ||
public void testEmptyStream() throws Exception { | ||
CsvSchema columns = CsvSchema.emptySchema().withHeader().withColumnSeparator(';'); | ||
ObjectReader r = MAPPER.readerFor(Map.class).with(columns); | ||
try { | ||
/*Object ob =*/ r.readValue((Reader) null); | ||
fail("Should not pass"); | ||
} catch (IllegalArgumentException e) { | ||
verifyException(e, "Can not pass `null`"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters