From: Aron Roberts Date: Fri, 4 Feb 2011 00:50:25 +0000 (+0000) Subject: CSPACE-3237: Added minimal test verifying that data enclosed in double-quotes can... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=217f409689bf47fbecde41a2542aca199f7c483e;p=tmp%2Fjakarta-migration.git CSPACE-3237: Added minimal test verifying that data enclosed in double-quotes can be roundtripped to and from the repository in the services layer, on a create. --- diff --git a/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java b/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java index d4be6c165..07ffd2ef6 100644 --- a/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java +++ b/services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java @@ -218,6 +218,31 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl { 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 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. * diff --git a/services/collectionobject/client/src/test/resources/test-data/cspace-3237-double-quotes.xml b/services/collectionobject/client/src/test/resources/test-data/cspace-3237-double-quotes.xml new file mode 100644 index 000000000..ac2dd9652 --- /dev/null +++ b/services/collectionobject/client/src/test/resources/test-data/cspace-3237-double-quotes.xml @@ -0,0 +1,21 @@ + + + + + 2 + "this is enclosed in double quotes" + + + "this is enclosed in double quotes" + "this is enclosed in double quotes, prefixed and suffixed by horizontal space chars" + some text "this is enclosed in double quotes" some text + +