diff --git a/jr-objects/pom.xml b/jr-objects/pom.xml index 530fb62e..69cd53a4 100644 --- a/jr-objects/pom.xml +++ b/jr-objects/pom.xml @@ -40,12 +40,6 @@ has no other dependencies, and provides additional builder-style content generat jackson-core ${jackson.version.core} - - org.apache.groovy - groovy - 4.0.18 - test - @@ -58,22 +52,6 @@ has no other dependencies, and provides additional builder-style content generat https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/2.17/ - - - - - - org.codehaus.gmaven - gmaven-plugin - 1.5 - - - - testCompile - - - com.google.code.maven-replacer-plugin @@ -91,5 +69,4 @@ has no other dependencies, and provides additional builder-style content generat - diff --git a/jr-objects/src/test/groovy/com/fasterxml/jackson/jr/GroovyTest.groovy b/jr-objects/src/test/groovy/com/fasterxml/jackson/jr/GroovyTest.groovy deleted file mode 100644 index 0af7b401..00000000 --- a/jr-objects/src/test/groovy/com/fasterxml/jackson/jr/GroovyTest.groovy +++ /dev/null @@ -1,62 +0,0 @@ -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 -} diff --git a/jr-test-module/pom.xml b/jr-test-module/pom.xml new file mode 100644 index 00000000..1541cadf --- /dev/null +++ b/jr-test-module/pom.xml @@ -0,0 +1,88 @@ + + 4.0.0 + + com.fasterxml.jackson.jr + jackson-jr-parent + 2.17.0-SNAPSHOT + + jackson-jr-test-module + pom + Test Module with higher JDK Version + Groovy support to test Jackson-Jr + https://github.com/FasterXML/jackson-jr + + + 17 + 17 + UTF-8 + + + + + com.fasterxml.jackson.jr + jackson-jr-objects + test + + + org.apache.groovy + groovy + 4.0.18 + test + + + + + + + + + org.codehaus.gmaven + gmaven-plugin + 1.5 + + + org.apache.groovy + groovy + 4.0.18 + + + + 2.0 + 2.0 + + + + + testCompile + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${maven.compiler.source} + ${maven.compiler.target} + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + test + + + + + + **/*Test.java + + + + + + + diff --git a/jr-test-module/src/test/groovy/GroovyObjectSupportTest.groovy b/jr-test-module/src/test/groovy/GroovyObjectSupportTest.groovy new file mode 100644 index 00000000..b19e70b7 --- /dev/null +++ b/jr-test-module/src/test/groovy/GroovyObjectSupportTest.groovy @@ -0,0 +1,57 @@ +import com.fasterxml.jackson.jr.ob.JSON +import org.junit.Assert +import org.junit.Test + +class GroovyObjectSupportTest { + @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 +} diff --git a/pom.xml b/pom.xml index 22273bce..d8aacfe4 100644 --- a/pom.xml +++ b/pom.xml @@ -26,6 +26,7 @@ jr-stree jr-annotation-support jr-extension-javatime + jr-test-module jr-all