-
Notifications
You must be signed in to change notification settings - Fork 33
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.
- Loading branch information
Showing
3 changed files
with
38 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
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
21 changes: 21 additions & 0 deletions
21
jr-objects/src/test/java/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,21 @@ | ||
package com.fasterxml.jackson.jr | ||
|
||
import com.fasterxml.jackson.jr.ob.JSON | ||
import com.fasterxml.jackson.jr.ob.TestBase | ||
|
||
class GroovyTest extends TestBase { | ||
|
||
void testSimpleObject() throws Exception { | ||
var data = JSON.std.asString(new MyClass()) | ||
var expected = "{\"aDouble\":0.0,\"aStr\":\"stringData\",\"anInt\":0,\"metaClass\":{}}"; | ||
assertEquals(data, expected) | ||
} | ||
|
||
private class MyClass { | ||
public int anInt; //testing groovy primitive | ||
public String aStr = "stringData"; //testing allocated object | ||
|
||
public double aDouble; // | ||
public Double aDoublesd; //testing boxing object | ||
} | ||
} |