Assert.assertTrue(descriptions.size() > 0);
}
+ // Verify that values are preserved when enclosed in double quote marks.
+ @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+ dependsOnMethods = {"create", "testSubmitRequest"}, groups = {"cspace3237group"})
+ public void doubleQuotesEnclosingFieldContents(String testName) throws Exception {
+ if (logger.isDebugEnabled()) {
+ logger.debug(testBanner(testName, CLASS_NAME));
+ }
+ String newId =
+ createFromXmlFile(testName, "./test-data/cspace-3237-double-quotes.xml", true);
+ CollectionobjectsCommon collectionObject = readCollectionObjectCommonPart(newId);
+
+ Assert.assertTrue(collectionObject.getDistinguishingFeatures().matches("^\\\".+?\\\""));
+
+ BriefDescriptionList descriptionList = collectionObject.getBriefDescriptions();
+ List<String> descriptions = descriptionList.getBriefDescription();
+ Assert.assertTrue(descriptions.size() > 0);
+ Assert.assertNotNull(descriptions.get(0));
+ Assert.assertTrue(descriptions.get(0).matches("^\\\".+?\\\""));
+
+ if (logger.isDebugEnabled()) {
+ logger.debug(objectAsXmlString(collectionObject,
+ CollectionobjectsCommon.class));
+ }
+ }
+
/**
* Creates the from xml rfw s1.
*
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Document : cspace-3237-double-quotes.xml
+ Created on :
+ Author :
+ Description: Test data for http://issues.collectionspace.org/browse/CSPACE-3237
+-->
+
+<ns2:collectionobjects_common
+ xmlns:ns2="http://collectionspace.org/services/collectionobject"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://collectionspace.org/services/collectionobject http://services.collectionspace.org/collectionobject/collectionobjects_common.xsd">
+ <objectNumber>2</objectNumber>
+ <distinguishingFeatures>"this is enclosed in double quotes"</distinguishingFeatures>
+ <briefDescriptions>
+ <!-- First value instance of this repeatable field is blank -->
+ <briefDescription>"this is enclosed in double quotes"</briefDescription>
+ <briefDescription> "this is enclosed in double quotes, prefixed and suffixed by horizontal space chars" </briefDescription>
+ <briefDescription>some text "this is enclosed in double quotes" some text</briefDescription>
+ </briefDescriptions>
+</ns2:collectionobjects_common>