-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
de32372
commit 11d9b68
Showing
12 changed files
with
61 additions
and
15 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
25 changes: 25 additions & 0 deletions
25
...e/src/test/java/com/fasterxml/jackson/dataformat/smile/gen/GeneratorInvalidCallsTest.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,25 @@ | ||
package com.fasterxml.jackson.dataformat.smile.gen; | ||
|
||
import java.io.ByteArrayOutputStream; | ||
|
||
import com.fasterxml.jackson.core.JsonGenerationException; | ||
|
||
import com.fasterxml.jackson.dataformat.smile.*; | ||
|
||
public class GeneratorInvalidCallsTest extends SmileTestBase | ||
{ | ||
final SmileFactory SMILE_F = new SmileFactory(); | ||
|
||
public void testInvalidFieldNameInRoot() throws Exception | ||
{ | ||
ByteArrayOutputStream out = new ByteArrayOutputStream(); | ||
SmileGenerator gen = SMILE_F.createGenerator(out); | ||
try { | ||
gen.writeStringField("a", "b"); | ||
fail("Should NOT allow writing of FIELD_NAME in root context"); | ||
} catch (JsonGenerationException e) { | ||
verifyException(e, "Can not write a field name"); | ||
} | ||
gen.close(); | ||
} | ||
} |
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
5 changes: 4 additions & 1 deletion
5
...dataformat/smile/TestGeneratorBinary.java → ...format/smile/gen/TestGeneratorBinary.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
4 changes: 2 additions & 2 deletions
4
...mat/smile/TestGeneratorBufferRecycle.java → ...smile/gen/TestGeneratorBufferRecycle.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
7 changes: 6 additions & 1 deletion
7
...at/smile/TestGeneratorLongSharedRefs.java → ...mile/gen/TestGeneratorLongSharedRefs.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
4 changes: 2 additions & 2 deletions
4
...ormat/smile/TestGeneratorLongStrings.java → ...t/smile/gen/TestGeneratorLongStrings.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
3 changes: 2 additions & 1 deletion
3
...ataformat/smile/TestGeneratorNumbers.java → ...ormat/smile/gen/TestGeneratorNumbers.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
5 changes: 3 additions & 2 deletions
5
...ataformat/smile/TestGeneratorSymbols.java → ...ormat/smile/gen/TestGeneratorSymbols.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
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
4 changes: 2 additions & 2 deletions
4
...le/TestGeneratorWithSerializedString.java → ...en/TestGeneratorWithSerializedString.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
5 changes: 4 additions & 1 deletion
5
...ormat/smile/TestSmileGeneratorBinary.java → ...t/smile/gen/TestSmileGeneratorBinary.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