]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-2779: Added test to create a CollectionObject, one of whose fields contains...
authorAron Roberts <aron@socrates.berkeley.edu>
Tue, 12 Oct 2010 00:46:13 +0000 (00:46 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Tue, 12 Oct 2010 00:46:13 +0000 (00:46 +0000)
services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java
services/collectionobject/client/src/test/resources/test-data/cspace-2779-utf-8-create.xml [new file with mode: 0644]

index 544bdbc41bb02242ba28b6e149aa4c40e03f4fb6..3de64ba69eecb16da5c3668798f81a2788be66e7 100644 (file)
@@ -73,6 +73,8 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
 
     private final String OBJECT_NAME_VALUE = "an object name";
     private final String UPDATED_MEASURED_PART_VALUE = "updated measured part value";
+    private final String UTF8_TITLE = "Audiorecording album cover signed by Lech "
+            + "Wa" + '\u0142' + '\u0119' + "sa";
 
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
@@ -302,7 +304,35 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
         }
         testSubmitRequest(newId);
     }
-    
+
+    /**
+     * Creates a CollectionObject resource, one of whose fields contains
+     * non-Latin 1 Unicode UTF-8 characters.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
+ /*
+    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+        dependsOnMethods = {"create", "testSubmitRequest"}, groups={"utf8-create"})
+    public void createWithUTF8Title(String testName) throws Exception {
+       String testDataDir = System.getProperty("test-data.fileName");
+       String newId =
+            createFromXmlFile(testName, testDataDir + "/cspace-2779-utf-8-create.xml", false);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Created record with UTF-8 chars in payload.");
+            logger.debug("Attempting to retrieve just-created record ...");
+        }
+        CollectionobjectsCommon collectionObject = readCollectionObjectCommonPart(newId);
+        String title = collectionObject.getTitle();
+        if (logger.isDebugEnabled()) {
+            logger.debug("Sent title: " + UTF8_TITLE);
+            logger.debug("Received title: " + title);
+        }
+        Assert.assertTrue(title.equals(UTF8_TITLE));
+    }
+ */
+
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.ServiceTest#createList()
      */
diff --git a/services/collectionobject/client/src/test/resources/test-data/cspace-2779-utf-8-create.xml b/services/collectionobject/client/src/test/resources/test-data/cspace-2779-utf-8-create.xml
new file mode 100644 (file)
index 0000000..0f7ede4
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Document   : cspace-2242-first-value-instance-blank.xml
+    Created on : 
+    Author     : 
+    Description: Test data for http://issues.collectionspace.org/browse/CSPACE-2242
+-->
+
+<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>
+    <comments>Katowice Spodek Live '94 by the band Perfect</comments>
+    <title>Audiorecording album cover signed by Lech Wałęsa</title>
+</ns2:collectionobjects_common>