Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xwiki-platform
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
XWiki
xwiki-platform
Commits
535d11a1
Commit
535d11a1
authored
9 months ago
by
Simon Urli
Browse files
Options
Downloads
Patches
Plain Diff
XWIKI-22187: Cannot get revisions with a criteria on a document not stored in DB
* Fix text blocks which are not allowed in java 11
parent
97d570e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-test/xwiki-platform-flamingo-skin-test-docker/src/test/it/org/xwiki/flamingo/test/docker/VersionIT.java
+24
-26
24 additions, 26 deletions
...src/test/it/org/xwiki/flamingo/test/docker/VersionIT.java
with
24 additions
and
26 deletions
xwiki-platform-core/xwiki-platform-flamingo/xwiki-platform-flamingo-skin/xwiki-platform-flamingo-skin-test/xwiki-platform-flamingo-skin-test-docker/src/test/it/org/xwiki/flamingo/test/docker/VersionIT.java
+
24
−
26
View file @
535d11a1
...
...
@@ -671,34 +671,32 @@ void getRevisionsWithCriteria(TestUtils testUtils, TestReference testReference,
String
currentTestReference
=
testUtils
.
serializeReference
(
testReference
);
String
targetTestReference
=
"xwiki:Test.getRevisionsWithCriteriaFoo.WebHome"
;
String
script
=
String
.
format
(
"""
{{velocity}}
#set ($myTest = "%s")
#set ($startAt = 0)
#set ($endAt = -1)
#set ($criteria = $xwiki.criteriaService.revisionCriteriaFactory.createRevisionCriteria('', $minorVersions))
#set ($range = $xwiki.criteriaService.rangeFactory.createRange($startAt, $endAt))
#set ($discard = $criteria.setRange($range))
#set ($myDoc = $xwiki.getDocument($myTest))
#set ($xwikiDoc = $myDoc.document)
#set ($discard = $myDoc.document.loadArchive($xcontext.context))
XWiki Doc: $xwikiDoc
#set ($revisions = $xwikiDoc.getRevisions($criteria, $xcontext.context))
Revision: $revisions
#set ($newRef = $services.model.resolveDocument("%s"))
#set ($discard = $xwikiDoc.setDocumentReference($newRef))
XWiki Doc: $xwikiDoc
#set ($revisions = $xwikiDoc.getRevisions($criteria, $xcontext.context))
Revision: $revisions
{{/velocity}}
"""
,
currentTestReference
,
targetTestReference
);
String
script
=
String
.
format
(
"{{velocity}}\n"
+
"#set ($myTest = \"%s\")\n"
+
"#set ($startAt = 0)\n"
+
"#set ($endAt = -1)\n"
+
"#set ($criteria = $xwiki.criteriaService.revisionCriteriaFactory.createRevisionCriteria('', "
+
"$minorVersions))\n"
+
"#set ($range = $xwiki.criteriaService.rangeFactory.createRange($startAt, $endAt))\n"
+
"#set ($discard = $criteria.setRange($range))\n"
+
"#set ($myDoc = $xwiki.getDocument($myTest))\n"
+
"#set ($xwikiDoc = $myDoc.document)\n"
+
"#set ($discard = $myDoc.document.loadArchive($xcontext.context))\n"
+
"XWiki Doc: $xwikiDoc\n"
+
"#set ($revisions = $xwikiDoc.getRevisions($criteria, $xcontext.context))\n"
+
"Revision: $revisions\n"
+
"#set ($newRef = $services.model.resolveDocument(\"%s\"))\n"
+
"#set ($discard = $xwikiDoc.setDocumentReference($newRef))\n"
+
"XWiki Doc: $xwikiDoc\n"
+
"#set ($revisions = $xwikiDoc.getRevisions($criteria, $xcontext.context))\n"
+
"Revision: $revisions\n"
+
"{{/velocity}}"
,
currentTestReference
,
targetTestReference
);
String
obtainedResult
=
testUtils
.
executeWikiPlain
(
script
,
Syntax
.
XWIKI_2_1
);
String
expectedResult
=
String
.
format
(
"""
XWiki Doc: %s
Revision: [5.1]
XWiki Doc: %s
Revision: [5.1]"""
,
String
expectedResult
=
String
.
format
(
"XWiki Doc: %s\n"
+
"Revision: [5.1]\n"
+
"XWiki Doc: %s\n"
+
"Revision: [5.1]"
,
currentTestReference
.
substring
(
"xwiki:"
.
length
()),
targetTestReference
.
substring
(
"xwiki:"
.
length
()));
assertEquals
(
expectedResult
,
obtainedResult
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment