You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/10/08 07:49:25 UTC
[groovy] branch GROOVY-8258 updated: GROOVY-8258: Tweak the test
case for json
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch GROOVY-8258
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/GROOVY-8258 by this push:
new db6c135 GROOVY-8258: Tweak the test case for json
db6c135 is described below
commit db6c1358f1bbb92a6b56f286160a67fa8bea7d66
Author: Daniel Sun <su...@apache.org>
AuthorDate: Thu Oct 8 15:48:45 2020 +0800
GROOVY-8258: Tweak the test case for json
---
.../test/groovy/org/apache/groovy/linq/GinqTest.groovy | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/subprojects/groovy-linq/src/test/groovy/org/apache/groovy/linq/GinqTest.groovy b/subprojects/groovy-linq/src/test/groovy/org/apache/groovy/linq/GinqTest.groovy
index 8f48659..09db9c4 100644
--- a/subprojects/groovy-linq/src/test/groovy/org/apache/groovy/linq/GinqTest.groovy
+++ b/subprojects/groovy-linq/src/test/groovy/org/apache/groovy/linq/GinqTest.groovy
@@ -1228,18 +1228,18 @@ class GinqTest {
{"id": 3, "name": "Eric"}
],
"tasks": [
- {"id": 1, "assignee": 1, "content": "task1"},
- {"id": 2, "assignee": 1, "content": "task2"},
- {"id": 3, "assignee": 2, "content": "task3"},
- {"id": 4, "assignee": 3, "content": "task4"}
+ {"id": 1, "assignee": 1, "content": "task1", "manDay": 6},
+ {"id": 2, "assignee": 1, "content": "task2", "manDay": 1},
+ {"id": 3, "assignee": 2, "content": "task3", "manDay": 3},
+ {"id": 4, "assignee": 3, "content": "task4", "manDay": 5}
]
}
''')
def expected = [
- [taskId: 1, taskContent: 'task1', assignee: 'Daniel'],
- [taskId: 3, taskContent: 'task3', assignee: 'Paul'],
- [taskId: 4, taskContent: 'task4', assignee: 'Eric']
+ [taskId: 1, taskContent: 'task1', assignee: 'Daniel', manDay: 6],
+ [taskId: 4, taskContent: 'task4', assignee: 'Eric', manDay: 5],
+ [taskId: 3, taskContent: 'task3', assignee: 'Paul', manDay: 3]
]
assert expected == GINQ {
@@ -1247,7 +1247,8 @@ class GinqTest {
innerJoin t in json.tasks
on t.assignee == p.id
where t.id in [1, 3, 4]
- select (taskId: t.id, taskContent: t.content, assignee: p.name)
+ orderBy t.manDay in desc
+ select (taskId: t.id, taskContent: t.content, assignee: p.name, manDay: t.manDay)
}.toList()
}
}