groovy git commit: Refine the test for GROOVY-8228 further

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

groovy git commit: Refine the test for GROOVY-8228 further

sunlan
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X d10beb9e9 -> 9039c8592


Refine the test for GROOVY-8228 further

(cherry picked from commit 9949525)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/9039c859
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/9039c859
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/9039c859

Branch: refs/heads/GROOVY_2_6_X
Commit: 9039c8592f929b4972f6cb1cf1bad4d1d2af3a1a
Parents: d10beb9
Author: sunlan <[hidden email]>
Authored: Wed Aug 9 12:44:42 2017 +0800
Committer: sunlan <[hidden email]>
Committed: Wed Aug 9 12:45:10 2017 +0800

----------------------------------------------------------------------
 .../src/test/resources/bugs/GROOVY-8228.groovy      | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/9039c859/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-8228.groovy
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-8228.groovy b/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-8228.groovy
index 19045ae..9944a75 100644
--- a/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-8228.groovy
+++ b/subprojects/parser-antlr4/src/test/resources/bugs/GROOVY-8228.groovy
@@ -77,16 +77,30 @@ assert ['JSR308Interface1<java.lang.String>', 'JSR308Interface2<java.lang.String
 Method testMethod = JSR308Class.class.getDeclaredMethods().find(e -> e.name == 'test')
 assert [IOException, SQLException] == testMethod.getAnnotatedExceptionTypes().collect(e -> e.type)
 assert 'java.util.List<java.lang.String>' == testMethod.getAnnotatedReturnType().type.typeName
+
+// 1)
 assert ['java.util.List<?>', 'java.util.List'].contains(testMethod.getAnnotatedParameterTypes().collect(e -> e.type.typeName).get(0))
 
 Method test2Method = JSR308Class.class.getDeclaredMethods().find(e -> e.name == 'test2')
 assert JSR308Class.class == test2Method.getAnnotatedReceiverType().type
 
+
+// 2)
 Parameter listParameter = testMethod.getParameters()[0]
 assert ['java.util.List<?>', 'java.util.List'].contains(listParameter.getAnnotatedType().type.typeName)
 
 Field nameField = JSR308Class.class.getDeclaredField('name');
 assert String.class == nameField.getAnnotatedType().type
 
+
+// 3)
 TypeVariable tv = JSR308Interface2.class.getTypeParameters()[0]
-assert [CharSequence.class] == tv.getAnnotatedBounds().collect(e -> e.type)
+assert [CharSequence.class, null].contains(tv.getAnnotatedBounds().collect(e -> e.type).get(0))
+
+// the above 3 tests get different result when running in the different CI(travis-ci and teamcity)
+// travis-ci succeeds:  https://travis-ci.org/apache/groovy/builds/262506189
+// teamcity fails:      http://ci.groovy-lang.org/viewLog.html?buildId=41265&tab=buildResultsDiv&buildTypeId=Groovy_Jdk8Build_PlusSnapshotDeploy
+//                      http://ci.groovy-lang.org/viewLog.html?buildId=41260&tab=buildResultsDiv&buildTypeId=Groovy_Jdk8Build_PlusSnapshotDeploy
+//                      http://ci.groovy-lang.org/viewLog.html?buildId=41257&tab=buildResultsDiv&buildTypeId=Groovy_Jdk8Build_PlusSnapshotDeploy
+//
+// I guess the difference is related to the version of JDK8 deployed(Maybe it is a bug of Java8)

Loading...