]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3061: Enabled UTF-8 create/retrieve and keyword search tests in CollectionObje...
authorAron Roberts <aron@socrates.berkeley.edu>
Wed, 19 Jan 2011 03:44:01 +0000 (03:44 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Wed, 19 Jan 2011 03:44:01 +0000 (03:44 +0000)
services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectSearchTest.java
services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectServiceTest.java

index acd7b03ee8f1f40ead320d30c3a305ec00b704b9..261a967a01471d0eeba9af0230423ca57f8030dc 100644 (file)
@@ -65,15 +65,19 @@ public class CollectionObjectSearchTest extends BaseServiceTest {
     final static List<String> TWO_MORE_KEYWORDS =
             Arrays.asList(new String[]{"Karihaya" + IDENTIFIER, "Hlikku" + IDENTIFIER});
     final static String NOISE_WORD = "Mihalli + IDENTIFIER";
-    // Test Unicode UTF-8 term for keyword searching: the last name of Lech
-    // Wałęsa, which contains two non-USASCII range Unicode UTF-8 characters.
+    // Test Unicode UTF-8 term for keyword searching: a random sequence,
+    // unlikely to be encountered in actual collections data, of two USASCII
+    // characters followed by four non-USASCII range Unicode UTF-8 characters:
     //
-    // For details regarding the łę characters in the last name, see:
-    // http://en.wikipedia.org/wiki/L_with_stroke
-    // http://en.wikipedia.org/wiki/%C4%98
-    final String UTF8_KEYWORD = "Wa" + '\u0142' + '\u0119' + "sa";
-    // Non-existent term, consisting of two back-to-back sets of the first letters
-    // of each of the words in a short pangram for the English alphabet.
+    // Δ : Greek capital letter Delta (U+0394)
+    // Ж : Cyrillic capital letter Zhe with breve (U+04C1)
+    // Ŵ : Latin capital letter W with circumflex (U+0174)
+    // Ω : Greek capital letter Omega (U+03A9)
+
+    final String UTF8_KEYWORD = "to" + '\u0394' + '\u04C1' + '\u0174' +'\u03A9';
+    // Non-existent term unlikely to be encountered in actual collections
+    // data, consisting of two back-to-back sets of the first letters of
+    // each of the words in a short pangram for the English alphabet.
     final static String NON_EXISTENT_KEYWORD = "jlmbsoqjlmbsoq";
 
     final static String KEYWORD_SEPARATOR = " ";
@@ -313,9 +317,6 @@ public class CollectionObjectSearchTest extends BaseServiceTest {
 //    }
 
 
-    // FIXME: Test currently fails with a true UTF-8 String - need to investigate why.
-    // Will be commented out for now until we get this working ...
-/*
     @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
         groups = {"utf8"})
     public void searchWithUTF8Keyword(String testName) {
@@ -355,7 +356,6 @@ public class CollectionObjectSearchTest extends BaseServiceTest {
         long numMatched = getNumMatched(res, NUM_MATCHES_EXPECTED);
         Assert.assertEquals(numMatched, NUM_MATCHES_EXPECTED);
     }
-*/
     
     // Failure outcomes
 
index b886b06c424c81f469e71960a20184b1015cc578..d4be6c1658d9ea7886e399818630f929f76aec3e 100644 (file)
@@ -75,7 +75,7 @@ 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 "
+    private final String UTF8_DATA_SAMPLE = "Audiorecording album cover signed by Lech "
             + "Wa" + '\u0142' + '\u0119' + "sa";
 
     /* (non-Javadoc)
@@ -314,10 +314,9 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
      * @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 {
+    public void createWithUTF8Data(String testName) throws Exception {
        String testDataDir = System.getProperty("test-data.fileName");
        String newId =
             createFromXmlFile(testName, testDataDir + "/cspace-2779-utf-8-create.xml", false);
@@ -326,14 +325,13 @@ public class CollectionObjectServiceTest extends AbstractServiceTestImpl {
             logger.debug("Attempting to retrieve just-created record ...");
         }
         CollectionobjectsCommon collectionObject = readCollectionObjectCommonPart(newId);
-        String title = collectionObject.getTitle(); // will need to be changed for multi-valued title
+        String distinguishingFeatures = collectionObject.getDistinguishingFeatures();
         if (logger.isDebugEnabled()) {
-            logger.debug("Sent title: " + UTF8_TITLE);
-            logger.debug("Received title: " + title);
+            logger.debug("Sent distinguishingFeatures: " + UTF8_DATA_SAMPLE);
+            logger.debug("Received distinguishingFeatures: " + distinguishingFeatures);
         }
-        Assert.assertTrue(title.equals(UTF8_TITLE));
+        Assert.assertTrue(distinguishingFeatures.equals(UTF8_DATA_SAMPLE));
     }
- */
 
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.ServiceTest#createList()