forked from FasterXML/jackson-jr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skipping over groovy metadata class + groovy test. (FasterXML#118)
- Loading branch information
Showing
6 changed files
with
127 additions
and
11 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
62 changes: 62 additions & 0 deletions
62
jr-objects/src/test/groovy/com/fasterxml/jackson/jr/GroovyTest.groovy
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,62 @@ | ||
package com.fasterxml.jackson.jr | ||
|
||
import org.junit.Test | ||
import org.junit.Assert | ||
|
||
import com.fasterxml.jackson.jr.ob.JSON | ||
import com.fasterxml.jackson.jr.ob.TestBase | ||
|
||
class GroovyTest | ||
{ | ||
@Test | ||
void testSimpleGroovyObject() throws Exception { | ||
def json = JSON.std.asString(new GroovyOb()) | ||
def expected = """{"AAAAA_A_Field_Starting_With_Two_Capital_Letters":"XYZ","aDouble":0.0,"aPublicInitializedInteger":56,"aPublicInitializedIntegerObject":1516,"aPublicUninitializedInteger":0,"anInitializedIntegerObject":1112,"anInitializedPublicString":"stringData","anInitializedString":"ABC","anInteger":0,"anIntegerWithValue":12}""" | ||
Assert.assertEquals(json, expected) | ||
} | ||
} | ||
|
||
class GroovyOb { | ||
int anInteger | ||
int anIntegerWithValue = 12 | ||
|
||
static int anStaticInteger = 34 | ||
static int anStaticIntegerWithValue = 34 | ||
|
||
public int aPublicUninitializedInteger | ||
public int aPublicInitializedInteger = 56 | ||
|
||
private int aPrivateUninitializedInteger | ||
private int aPrivateInitializedInteger = 78 | ||
|
||
public static int aPublicStaticUninitializedInteger | ||
public static int aPublicStaticInitializedInteger = 910 | ||
|
||
Integer anIntegerObject | ||
Integer anInitializedIntegerObject = 1112 | ||
|
||
static Integer aStaticIntegerObject | ||
static Integer aStaticInitializedIntegerObject = 1314 | ||
|
||
public Integer aPublicUninitializedIntegerObject | ||
public Integer aPublicInitializedIntegerObject = 1516 | ||
|
||
public static Integer aPublicStaticUninitializedIntegerObject | ||
public static Integer aPublicStaticInitializedIntegerObject = 1718 | ||
|
||
String aString | ||
String anInitializedString = "ABC" | ||
|
||
static String aStaticString = "jacksonJR" | ||
|
||
public String aPublicString | ||
public String anInitializedPublicString = "stringData" | ||
|
||
public String AAAAA_A_Field_Starting_With_Two_Capital_Letters = "XYZ" | ||
//Other Items | ||
public static String staticStr = "jacksonJR" // Public Static Object | ||
static int anStaticInt // Uninitialized Static Object | ||
public double aDouble // uninitialized primitive | ||
public Double aDoubleObject // testing boxing object | ||
private int hiddenvalue = 123 // private value | ||
} |
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
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