Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
e1df5dad
Commit
e1df5dad
authored
5 years ago
by
piotr.kupczyk@id.ethz.ch
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-7583 : ObjectTypeForm - add a test for v3.executeOperations executeInOrder flag
parent
51cbe8af
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
openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExecuteOperationsTest.java
+46
-0
46 additions, 0 deletions
...is/openbis/systemtest/asapi/v3/ExecuteOperationsTest.java
with
46 additions
and
0 deletions
openbis/sourceTest/java/ch/ethz/sis/openbis/systemtest/asapi/v3/ExecuteOperationsTest.java
+
46
−
0
View file @
e1df5dad
...
...
@@ -57,6 +57,7 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.entitytype.id.EntityTypePermId;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.history.PropertyHistoryEntry
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.operation.AsynchronousOperationExecutionOptions
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.operation.AsynchronousOperationExecutionResults
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.operation.IOperationExecutionResults
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.operation.OperationExecution
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.operation.OperationExecutionEmailNotification
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.operation.OperationExecutionState
;
...
...
@@ -78,8 +79,11 @@ import ch.ethz.sis.openbis.generic.asapi.v3.dto.space.Space;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.space.create.CreateSpacesOperation
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.space.create.CreateSpacesOperationResult
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.space.create.SpaceCreation
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.space.delete.DeleteSpacesOperation
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.space.delete.SpaceDeletionOptions
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.space.fetchoptions.SpaceFetchOptions
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.space.get.GetSpacesOperation
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.space.get.GetSpacesOperationResult
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.space.id.ISpaceId
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.space.id.SpacePermId
;
import
ch.ethz.sis.openbis.generic.asapi.v3.dto.space.search.SpaceSearchCriteria
;
...
...
@@ -941,6 +945,48 @@ public class ExecuteOperationsTest extends AbstractOperationExecutionTest
"execute-operations OPERATIONS('[CreateSpacesOperation 1 creation(s)]') EXECUTION_OPTIONS('SynchronousOperationExecutionOptions[description=test-description,notification=OperationExecutionEmailNotification[emails=[test@email.com]]]')"
);
}
@Test
public
void
testExecuteWithExecuteInOrder
()
{
SpacePermId
id
=
new
SpacePermId
(
"EXECUTE_IN_ORDER_TEST"
);
SpaceCreation
creation
=
new
SpaceCreation
();
creation
.
setCode
(
id
.
getPermId
());
CreateSpacesOperation
create
=
new
CreateSpacesOperation
(
Arrays
.
asList
(
creation
));
GetSpacesOperation
get
=
new
GetSpacesOperation
(
Arrays
.
asList
(
id
),
new
SpaceFetchOptions
());
SpaceDeletionOptions
deletionOptions
=
new
SpaceDeletionOptions
();
deletionOptions
.
setReason
(
"testing"
);
DeleteSpacesOperation
delete
=
new
DeleteSpacesOperation
(
Arrays
.
asList
(
id
),
deletionOptions
);
String
sessionToken
=
v3api
.
login
(
TEST_USER
,
PASSWORD
);
List
<
IOperation
>
operations
=
Arrays
.
asList
(
create
,
get
,
delete
,
get
);
// in order
SynchronousOperationExecutionOptions
inOrderOptions
=
new
SynchronousOperationExecutionOptions
();
inOrderOptions
.
setExecuteInOrder
(
true
);
SynchronousOperationExecutionResults
inOrderResults
=
(
SynchronousOperationExecutionResults
)
v3api
.
executeOperations
(
sessionToken
,
operations
,
inOrderOptions
);
GetSpacesOperationResult
firstGetResults
=
(
GetSpacesOperationResult
)
inOrderResults
.
getResults
().
get
(
1
);
assertNotNull
(
firstGetResults
.
getObjectMap
().
get
(
id
));
GetSpacesOperationResult
secondGetResults
=
(
GetSpacesOperationResult
)
inOrderResults
.
getResults
().
get
(
3
);
assertNull
(
secondGetResults
.
getObjectMap
().
get
(
id
));
// not in order
SynchronousOperationExecutionOptions
notInOrderOptions
=
new
SynchronousOperationExecutionOptions
();
SynchronousOperationExecutionResults
notInOrderResults
=
(
SynchronousOperationExecutionResults
)
v3api
.
executeOperations
(
sessionToken
,
operations
,
notInOrderOptions
);
firstGetResults
=
(
GetSpacesOperationResult
)
notInOrderResults
.
getResults
().
get
(
1
);
assertNotNull
(
firstGetResults
.
getObjectMap
().
get
(
id
));
secondGetResults
=
(
GetSpacesOperationResult
)
notInOrderResults
.
getResults
().
get
(
3
);
assertNotNull
(
secondGetResults
.
getObjectMap
().
get
(
id
));
}
private
OperationExecution
executeWithAvailabilities
(
String
sessionToken
,
Integer
availability
,
Integer
summaryAvailability
,
Integer
detailsAvailability
)
{
...
...
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