+
diff --git a/src/main/webapp/resources/css/structure.css b/src/main/webapp/resources/css/structure.css
index 60be8b7fda6..16f6586a566 100644
--- a/src/main/webapp/resources/css/structure.css
+++ b/src/main/webapp/resources/css/structure.css
@@ -137,6 +137,7 @@ td.col-select-width, th.col-select-width {width:36px;}
.no-margin-bottom {margin-bottom:0 !important;}
.margin-sides {margin-left:1em; margin-right:1em;}
.padding-12 {padding: 12px;}
+.padding-6 {padding: 6px;}
.padding-none {padding: 0 !important;}
.clear-both {clear:both;}
@@ -901,6 +902,7 @@ div.ui-selectcheckboxmenu-panel, div.ui-selectonemenu-panel, div.ui-autocomplete
/* Overwrite Primefaces */
.ui-tabs.ui-widget-content .ui-tabs-nav li.ui-tabs-selected a {color: #555555;}
button.btn-default.ui-button-text-only .ui-button-text {padding:0; font-size:14px;}
+button.btn-default span.ui-button-text {line-height:inherit !important;}
div.ui-widget-overlay {background:#ccc; opacity:.6;}
.ui-confirm-dialog-severity {margin-top:3px;}
.ui-widget-content a.btn-default {color:#333;}
diff --git a/src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java b/src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java
index fbd030ab109..4d8c6e2a8d9 100644
--- a/src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java
+++ b/src/test/java/edu/harvard/iq/dataverse/api/FilesIT.java
@@ -116,20 +116,17 @@ public void test_001_AddFileGood() {
//addResponse.prettyPrint();
msgt("Here it is: " + addResponse.prettyPrint());
String successMsg = BundleUtil.getStringFromBundle("file.addreplace.success.add");
-
addResponse.then().assertThat()
/**
* @todo We have a need to show human readable success messages
* via API in a consistent location.
*/
- // .body("message", equalTo(successMsg))
.body("status", equalTo(AbstractApiBean.STATUS_OK))
.body("data.files[0].categories[0]", equalTo("Data"))
.body("data.files[0].dataFile.contentType", equalTo("image/png"))
.body("data.files[0].dataFile.description", equalTo("my description"))
.body("data.files[0].directoryLabel", equalTo("data/subdir1"))
-// .body("data.files[0].dataFile.tags", nullValue())
.body("data.files[0].dataFile.tabularTags", nullValue())
.body("data.files[0].label", equalTo("dataverseproject.png"))
// not sure why description appears in two places
@@ -138,18 +135,20 @@ public void test_001_AddFileGood() {
//------------------------------------------------
- // Try to add the same file again -- and fail
+ // Try to add the same file again -- and get warning
//------------------------------------------------
Response addTwiceResponse = UtilIT.uploadFileViaNative(datasetId.toString(), pathToFile, apiToken);
msgt("2nd requests: " + addTwiceResponse.prettyPrint()); //addResponse.prettyPrint();
- String errMsg = BundleUtil.getStringFromBundle("file.addreplace.error.duplicate_file");
-
+ String dupeName = "dataverseproject.png";
+
+ String errMsg = BundleUtil.getStringFromBundle("file.addreplace.warning.duplicate_file",
+ Arrays.asList(dupeName));
+ String errMsgFromResponse = JsonPath.from(addTwiceResponse.body().asString()).getString("message");
addTwiceResponse.then().assertThat()
- .body("message", Matchers.startsWith(errMsg))
- .body("status", equalTo(AbstractApiBean.STATUS_ERROR))
- .statusCode(BAD_REQUEST.getStatusCode());
+ .statusCode(OK.getStatusCode());
+ assertTrue(errMsgFromResponse.contains(errMsg));
}
@@ -632,7 +631,7 @@ public void testForceReplaceAndUpdate() {
.statusCode(OK.getStatusCode());
Long newDfId = JsonPath.from(replaceResp.body().asString()).getLong("data.files[0].dataFile.id");
-
+ System.out.print("newDfId: " + newDfId);
//Adding an additional fileMetadata update tests after this to ensure updating replaced files works
msg("Update file metadata for old file, will error");
String updateDescription = "New description.";
@@ -645,6 +644,7 @@ public void testForceReplaceAndUpdate() {
//Adding an additional fileMetadata update tests after this to ensure updating replaced files works
msg("Update file metadata for new file");
//"junk" passed below is to test that it is discarded
+ System.out.print("params: " + String.valueOf(newDfId) + " " + updateJsonString + " " + apiToken);
Response updateMetadataResponse = UtilIT.updateFileMetadata(String.valueOf(newDfId), updateJsonString, apiToken);
assertEquals(OK.getStatusCode(), updateMetadataResponse.getStatusCode());
//String updateMetadataResponseString = updateMetadataResponse.body().asString();
@@ -1264,8 +1264,8 @@ public void testFileMetaDataGetUpdateRoundTrip() throws InterruptedException {
assertEquals(updateCategory, JsonPath.from(getUpMetadataResponseString).getString("categories[0]"));
assertNull(JsonPath.from(getUpMetadataResponseString).getString("provFreeform")); //unupdated fields are not persisted
assertEquals(updateDataFileTag, JsonPath.from(getUpMetadataResponseString).getString("dataFileTags[0]"));
-
- //We haven't published so the non-draft call should still give the pre-edit metadata
+
+//We haven't published so the non-draft call should still give the pre-edit metadata
Response getOldMetadataResponse = UtilIT.getDataFileMetadata(origFileId, apiToken);
String getOldMetadataResponseString = getOldMetadataResponse.body().asString();
msg("Old Published (shouldn't be updated):");
@@ -1320,7 +1320,7 @@ public void testDataSizeInDataverse() throws InterruptedException {
.statusCode(OK.getStatusCode());
// wait for it to ingest...
- assertTrue("Failed test if Ingest Lock exceeds max duration " + pathToFile , UtilIT.sleepForLock(datasetId.longValue(), "Ingest", apiToken, UtilIT.MAXIMUM_INGEST_LOCK_DURATION));
+ assertTrue("Failed test if Ingest Lock exceeds max duration " + pathToFile , UtilIT.sleepForLock(datasetId.longValue(), "Ingest", apiToken, 5));
// sleep(10000);
Response publishDataversetResp = UtilIT.publishDataverseViaSword(dataverseAlias, apiToken);
diff --git a/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.xml b/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.xml
index 79e9e363994..70a2e139929 100644
--- a/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.xml
+++ b/src/test/java/edu/harvard/iq/dataverse/export/ddi/dataset-finch1.xml
@@ -7,7 +7,7 @@
doi:10.5072/FK2/PCA2E3
-
+
1
Finch, Fiona, 2015, "Darwin's Finches", https://doi.org/10.5072/FK2/PCA2E3, Root Dataverse, V1
diff --git a/src/test/java/edu/harvard/iq/dataverse/export/ddi/exportfull.xml b/src/test/java/edu/harvard/iq/dataverse/export/ddi/exportfull.xml
index d9be1217fc9..9b803c9f1bb 100644
--- a/src/test/java/edu/harvard/iq/dataverse/export/ddi/exportfull.xml
+++ b/src/test/java/edu/harvard/iq/dataverse/export/ddi/exportfull.xml
@@ -10,7 +10,7 @@
Root
2020-02-19
-
+
1
LastAuthor1, FirstAuthor1; LastAuthor2, FirstAuthor2, 2020, "Replication Data for: Title", https://doi.org/10.5072/FK2/WKUKGV, Root, V1