Skip to content

Commit

Permalink
test to reproduce SWORD/Abdera ParseException bug #384
Browse files Browse the repository at this point in the history
- upstream bug: swordapp/JavaServer2.0#6
  • Loading branch information
pdurbin committed Oct 20, 2014
1 parent b028eba commit 326f120
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
USERNAME=pete
PASSWORD=pete
DVN_SERVER=localhost:8181
DATAVERSE_ALIAS=peteTop
curl -s --insecure --data-binary "@scripts/api/data-deposit/data/atom-entry-study-894-invisible-character.xml" -H "Content-Type: application/atom+xml" -u $USERNAME:$PASSWORD https://$DVN_SERVER/dvn/api/data-deposit/v1/swordv2/collection/dataverse/$DATAVERSE_ALIAS \
| xmllint -format -
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!--
See also Sword API: Can't create study when hidden characters are introduced in atom.xml · Issue #894 · IQSS/dataverse - https://github.com/IQSS/dataverse/issues/894
The bad characeter is in "dcterms:publisher".
-->
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:dcterms="http://purl.org/dc/terms/">
<!-- some embedded metadata -->
<dcterms:title>smoke36_study</dcterms:title>
<dcterms:creator>last, first</dcterms:creator>
<dcterms:creator>Sotiri, elda</dcterms:creator>
<!-- Producer with financial or admin responsibility of the data -->
<dcterms:publisher></dcterms:publisher>
<!-- related publications -->
<dcterms:isReferencedBy holdingsURI="http://dx.doi.org/10.1038/dvn333" agency="DOI" IDNo="10.1038/dvn333">Peets, J., &amp; Stumptown, J. (2013). Roasting at Home. New England Journal of Coffee, 3(1), 22-34.</dcterms:isReferencedBy>
<!-- production date -->
<dcterms:date>2013-07-11</dcterms:date>
<!-- Other Identifier for the data in this study -->
<!--<dcterms:identifier>hdl:1XXZY.1/XYXZ</dcterms:identifier>-->
<dcterms:description>Considerations before you start roasting your own coffee at home.</dcterms:description>
<!-- keywords -->
<dcterms:subject>drink</dcterms:subject>
<dcterms:subject>beverage</dcterms:subject>
<dcterms:subject>caffeine</dcterms:subject>
<!-- geographic coverage -->
<dcterms:coverage>United States</dcterms:coverage>
<dcterms:coverage>World</dcterms:coverage>
<!-- kind of data -->
<dcterms:type>aggregate data</dcterms:type>
<!-- List of sources of the data collection-->
<dcterms:source>. something something something something</dcterms:source>
<!-- restrictions -->
<dcterms:rights>Creative Commons CC-BY 3.0 (unported) http://creativecommons.org/licenses/by/3.0/</dcterms:rights>
<!-- related materials -->
<dcterms:relation>Peets, John. 2010. Roasting Coffee at the Coffee Shop. Coffeemill Press</dcterms:relation>
</entry>
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
this.api.post(req, resp);
} catch (ParseException ex) {
/**
* @todo close https://redmine.hmdc.harvard.edu/issues/3305 if/when
* @todo close https://github.com/IQSS/dataverse/issues/893 if/when
* https://github.com/swordapp/JavaServer2.0/issues/6 is closed
*/
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Attempt to upload an empty Atom entry? org.apache.abdera.parser.ParseException caught. See also https://redmine.hmdc.harvard.edu/issues/3305 and https://github.com/swordapp/JavaServer2.0/issues/6");
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Attempt to upload an empty Atom entry? org.apache.abdera.parser.ParseException caught. See also https://github.com/IQSS/dataverse/issues/893 and https://github.com/swordapp/JavaServer2.0/issues/6");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ protected void doPut(HttpServletRequest req, HttpServletResponse resp)
this.api.put(req, resp);
} catch (ParseException ex) {
/**
* @todo close https://redmine.hmdc.harvard.edu/issues/3305 if/when
* @todo close https://github.com/IQSS/dataverse/issues/893 if/when
* https://github.com/swordapp/JavaServer2.0/issues/6 is closed
*/
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Attempt to upload an empty Atom entry? org.apache.abdera.parser.ParseException caught. See also https://redmine.hmdc.harvard.edu/issues/3305 and https://github.com/swordapp/JavaServer2.0/issues/6");
resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Attempt to upload an empty Atom entry? org.apache.abdera.parser.ParseException caught. See also https://github.com/IQSS/dataverse/issues/893 and https://github.com/swordapp/JavaServer2.0/issues/6");
}
}

Expand Down

0 comments on commit 326f120

Please sign in to comment.