Skip to content

Commit

Permalink
fixes the API tests. #3437
Browse files Browse the repository at this point in the history
  • Loading branch information
landreev committed Jan 10, 2024
1 parent 00d61d3 commit 7e30c4a
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ private static void setupDatasets() {
// So wait for all of this to finish.
UtilIT.sleepForReexport(singleSetDatasetPersistentId, adminUserAPIKey, 10);

// ... And let's create 4 more datasets for a multi-dataset experiment:
// ... And let's create 5 more datasets for a multi-dataset experiment:

for (int i = 0; i < 4; i++) {
for (int i = 0; i < 5; i++) {
// create dataset:
createDatasetResponse = UtilIT.createRandomDatasetViaNativeApi(dataverseAlias, adminUserAPIKey);
createDatasetResponse.prettyPrint();
Expand Down Expand Up @@ -653,9 +653,13 @@ public void testMultiRecordOaiSet() throws InterruptedException {
// in the class init:

String setName = UtilIT.getRandomString(6);
String setQuery = "(dsPersistentId:" + singleSetDatasetIdentifier;
String setQuery = "";
for (String persistentId : extraDatasetsIdentifiers) {
setQuery = setQuery.concat(" OR dsPersistentId:" + persistentId);
if (setQuery.equals("")) {
setQuery = "(dsPersistentId:" + persistentId;
} else {
setQuery = setQuery.concat(" OR dsPersistentId:" + persistentId);
}
}
setQuery = setQuery.concat(")");

Expand Down Expand Up @@ -796,7 +800,6 @@ public void testMultiRecordOaiSet() throws InterruptedException {

boolean allDatasetsListed = true;

allDatasetsListed = persistentIdsInListIdentifiers.contains(singleSetDatasetIdentifier);
for (String persistentId : extraDatasetsIdentifiers) {
allDatasetsListed = allDatasetsListed && persistentIdsInListIdentifiers.contains(persistentId);
}
Expand Down Expand Up @@ -921,12 +924,11 @@ public void testMultiRecordOaiSet() throws InterruptedException {
// Record the last identifier listed on this final page:
persistentIdsInListRecords.add(ret.get(0).substring(ret.get(0).lastIndexOf('/') + 1));

// Finally, let's confirm that the expected 5 datasets have been listed
// Finally, let's confirm again that the expected 5 datasets have been listed
// as part of this Set:

allDatasetsListed = true;

allDatasetsListed = persistentIdsInListRecords.contains(singleSetDatasetIdentifier);
for (String persistentId : extraDatasetsIdentifiers) {
allDatasetsListed = allDatasetsListed && persistentIdsInListRecords.contains(persistentId);
}
Expand Down

0 comments on commit 7e30c4a

Please sign in to comment.