-
Notifications
You must be signed in to change notification settings - Fork 76
MLE-28334 Implement Fragment Option #1937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jonmille
wants to merge
2
commits into
develop
Choose a base branch
from
MLE-28334-Fragment-Option
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
28 changes: 28 additions & 0 deletions
28
marklogic-client-api/src/test/java/com/marklogic/client/test/junit5/RequiresML12Dot1.java
This file contains hidden or 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,28 @@ | ||
| /* | ||
| * Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. | ||
| */ | ||
| package com.marklogic.client.test.junit5; | ||
|
|
||
| import com.marklogic.client.test.Common; | ||
| import com.marklogic.client.test.MarkLogicVersion; | ||
| import org.junit.jupiter.api.extension.ConditionEvaluationResult; | ||
| import org.junit.jupiter.api.extension.ExecutionCondition; | ||
| import org.junit.jupiter.api.extension.ExtensionContext; | ||
|
|
||
| public class RequiresML12Dot1 implements ExecutionCondition { | ||
|
|
||
| private static MarkLogicVersion markLogicVersion; | ||
|
|
||
| @Override | ||
| public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { | ||
| if (markLogicVersion == null) { | ||
| markLogicVersion = Common.getMarkLogicVersion(); | ||
| } | ||
| boolean supported = | ||
| (markLogicVersion.getMajor() == 12 && markLogicVersion.getMinor() != null && markLogicVersion.getMinor() >= 1) || | ||
| markLogicVersion.getMajor() > 12; | ||
| return supported ? | ||
| ConditionEvaluationResult.enabled("MarkLogic is version 12.1 or higher") : | ||
| ConditionEvaluationResult.disabled("MarkLogic is version 12.0.x or lower"); | ||
| } | ||
| } |
54 changes: 54 additions & 0 deletions
54
...ient-api/src/test/java/com/marklogic/client/test/rows/AbstractFromSearchFragmentTest.java
This file contains hidden or 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,54 @@ | ||
| /* | ||
| * Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. | ||
| */ | ||
| package com.marklogic.client.test.rows; | ||
|
|
||
| import com.marklogic.client.test.Common; | ||
| import org.junit.jupiter.api.AfterEach; | ||
| import org.junit.jupiter.api.BeforeEach; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| /** | ||
| * Shared test fixture for {@link FromSearchWithFragmentTest} and | ||
| * {@link FromSearchDocsWithFragmentTest}. Holds the XQuery setup/teardown scripts and | ||
| * expected URI constants so that changes to the test documents only need to be made in | ||
| * one place. | ||
| */ | ||
| abstract class AbstractFromSearchFragmentTest extends AbstractOpticUpdateTest { | ||
|
|
||
| static final String SETUP_XQUERY = | ||
| "xquery version '1.0-ml';" + | ||
| "let $jsondoc1 := object-node {'AllDataTypes': array-node {object-node {'word':'dog'}, object-node {'rank':1}, object-node {'score':4}}}" + | ||
| "let $jsondoc2 := object-node {'AllDataTypes': array-node {object-node {'word':'cat'}, object-node {'rank':2}, object-node {'score':5}}}" + | ||
| "let $jsondoc3 := object-node {'AllDataTypes': array-node {object-node {'word':'duck'}, object-node {'rank':3}, object-node {'score':6}}}" + | ||
| "return (" + | ||
| "xdmp:document-insert('range-prop-1.json', $jsondoc1, xdmp:default-permissions(), ('elemCol','jsondoc-range','from-search-fragment-test'))," + | ||
| "xdmp:document-insert('range-prop-2.json', $jsondoc2, xdmp:default-permissions(), ('elemCol','jsondoc-range','from-search-fragment-test'))," + | ||
| "xdmp:document-insert('range-prop-3.json', $jsondoc3, xdmp:default-permissions(), ('elemCol','jsondoc-range','from-search-fragment-test'))," + | ||
| "xdmp:document-set-properties('range-prop-1.json', (<my-prop>opticfragmentpropvalue prop1value</my-prop>))," + | ||
| "xdmp:document-set-properties('range-prop-2.json', (<my-prop>opticfragmentpropvalue prop2value</my-prop>))," + | ||
| "xdmp:document-set-properties('range-prop-3.json', (<my-prop>opticfragmentpropvalue prop3value</my-prop>))," + | ||
| "xdmp:lock-acquire('range-prop-1.json', 'exclusive', '0', 'dog rose', xs:unsignedLong(120))," + | ||
| "xdmp:lock-acquire('range-prop-2.json', 'exclusive', '0', 'cat tulip', xs:unsignedLong(120))," + | ||
| "xdmp:lock-acquire('range-prop-3.json', 'exclusive', '0', 'duck lily', xs:unsignedLong(120))" + | ||
| ")"; | ||
|
|
||
| static final String TEARDOWN_XQUERY = | ||
| "xquery version '1.0-ml';" + | ||
| "for $uri in ('range-prop-1.json', 'range-prop-2.json', 'range-prop-3.json') return xdmp:document-delete($uri)"; | ||
|
|
||
| static final List<String> EXPECTED_URIS = List.of( | ||
| "range-prop-1.json", "range-prop-2.json", "range-prop-3.json"); | ||
|
|
||
| @BeforeEach | ||
| void setupTest() { | ||
| rowManager.withUpdate(false); | ||
| Common.newEvalClient().newServerEval().xquery(SETUP_XQUERY).evalAs(String.class); | ||
| } | ||
|
|
||
| @AfterEach | ||
| void teardownTest() { | ||
| Common.newEvalClient().newServerEval().xquery(TEARDOWN_XQUERY).evalAs(String.class); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.