-
-
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
1 parent
26c5b56
commit 65a0693
Showing
3 changed files
with
53 additions
and
4 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
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
50 changes: 50 additions & 0 deletions
50
...c/test/java/com/fasterxml/jackson/dataformat/yaml/failing/MultipleDocumentsWriteTest.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,50 @@ | ||
package com.fasterxml.jackson.dataformat.yaml.failing; | ||
|
||
import java.io.StringWriter; | ||
import java.util.Collections; | ||
|
||
import com.fasterxml.jackson.databind.*; | ||
|
||
import com.fasterxml.jackson.dataformat.yaml.ModuleTestBase; | ||
|
||
// for [dataformats-text#163] | ||
public class MultipleDocumentsWriteTest extends ModuleTestBase | ||
{ | ||
static class POJO163 { | ||
public int value; | ||
|
||
public POJO163(int v) { value = v; } | ||
} | ||
|
||
public void testWriteMultipleDocsBeans() throws Exception | ||
{ | ||
ObjectMapper mapper = newObjectMapper(); | ||
StringWriter w = new StringWriter(); | ||
try (SequenceWriter seqW = mapper.writer().writeValues(w)) { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
seqW.write(new POJO163(42)); | ||
seqW.write(new POJO163(28)); | ||
} | ||
w.close(); | ||
|
||
String yaml = w.toString(); | ||
|
||
// !!! TODO: actual expected multi-doc contents: | ||
assertEquals("foo", yaml); | ||
} | ||
|
||
public void testWriteMultipleDocsLists() throws Exception | ||
{ | ||
ObjectMapper mapper = newObjectMapper(); | ||
StringWriter w = new StringWriter(); | ||
try (SequenceWriter seqW = mapper.writer().writeValues(w)) { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
seqW.write(Collections.singleton(42)); | ||
seqW.write(Collections.singleton(28)); | ||
} | ||
w.close(); | ||
|
||
String yaml = w.toString(); | ||
|
||
// !!! TODO: actual expected multi-doc contents: | ||
assertEquals("foo", yaml); | ||
} | ||
} |
@cowtowncoder You can try adding
sequenceWriter.init(true);
here. Exception might resolve, since I was also getting some exception without this.