incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1553104 - in /sling/trunk/samples/mail-archive/server/src: main/java/org/apache/sling/mailarchiveserver/impl/ test/java/org/apache/sling/mailarchiveserver/impl/
Date Mon, 23 Dec 2013 12:37:38 GMT
Author: bdelacretaz
Date: Mon Dec 23 12:37:37 2013
New Revision: 1553104

URL: http://svn.apache.org/r1553104
Log:
SLING-3297 - use unicode literals in strings

Modified:
    sling/trunk/samples/mail-archive/server/src/main/java/org/apache/sling/mailarchiveserver/impl/MessageStoreImpl.java
    sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/MessageStoreImplStaticMethodsTest.java
    sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/ThreadKeyGeneratorImplSubjectEqualityTest.java
    sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/ThreadKeyGeneratorImplTest.java

Modified: sling/trunk/samples/mail-archive/server/src/main/java/org/apache/sling/mailarchiveserver/impl/MessageStoreImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/mail-archive/server/src/main/java/org/apache/sling/mailarchiveserver/impl/MessageStoreImpl.java?rev=1553104&r1=1553103&r2=1553104&view=diff
==============================================================================
--- sling/trunk/samples/mail-archive/server/src/main/java/org/apache/sling/mailarchiveserver/impl/MessageStoreImpl.java
(original)
+++ sling/trunk/samples/mail-archive/server/src/main/java/org/apache/sling/mailarchiveserver/impl/MessageStoreImpl.java
Mon Dec 23 12:37:37 2013
@@ -82,8 +82,11 @@ public class MessageStoreImpl implements
     private BundleContext bundleContext = null;
 
     static final String FIELD_SEPARATOR = " : ";
-    private static final String[] RE_PREFIXES = { "re:", "aw:", "fw:", "re ", "aw ", "fw
", "答复"};
-    // for testing
+    
+    // TODO should be configurable, and should probably be in ThreadKeyGeneratorImpl
+    private static final String[] RE_PREFIXES = { "re:", "aw:", "fw:", "re ", "aw ", "fw
", "\u7B54\u590D"};
+    
+    // TODO for testing??
     String archivePath = MailArchiveServerConstants.ARCHIVE_PATH;
     String resourceTypeKey = MailArchiveServerConstants.RT_KEY;
 

Modified: sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/MessageStoreImplStaticMethodsTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/MessageStoreImplStaticMethodsTest.java?rev=1553104&r1=1553103&r2=1553104&view=diff
==============================================================================
--- sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/MessageStoreImplStaticMethodsTest.java
(original)
+++ sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/MessageStoreImplStaticMethodsTest.java
Mon Dec 23 12:37:37 2013
@@ -6,19 +6,13 @@ import static org.apache.sling.mailarchi
 import static org.apache.sling.mailarchiveserver.impl.MessageStoreImpl.removeRe;
 import static org.junit.Assert.assertEquals;
 
-import java.util.Date;
-import java.util.Map;
-
-import org.apache.james.mime4j.dom.Message;
-import org.apache.james.mime4j.message.MessageImpl;
-import org.apache.sling.mailarchiveserver.util.MailArchiveServerConstants;
 import org.junit.Test;
 
 public class MessageStoreImplStaticMethodsTest {
 	
 	@Test
 	public void testMakeJcrFriendly() {
-		assertEquals("Remove each char", "", makeJcrFriendly("��!@#$%^&*()+={}[]<>,/?\\;:'\""));
+		assertEquals("Remove each char", "", makeJcrFriendly("\"\uFFFD\uFFFD!@#$%^&*()+={}[]<>,/?\\\\;:'\\\""));
 		assertEquals("Substitute each char with _ char, trimming", "a", makeJcrFriendly(".a_"));

 		assertEquals("Substitute each char with _ char", "b_e", makeJcrFriendly("b_ .-e"));
 	}

Modified: sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/ThreadKeyGeneratorImplSubjectEqualityTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/ThreadKeyGeneratorImplSubjectEqualityTest.java?rev=1553104&r1=1553103&r2=1553104&view=diff
==============================================================================
--- sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/ThreadKeyGeneratorImplSubjectEqualityTest.java
(original)
+++ sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/ThreadKeyGeneratorImplSubjectEqualityTest.java
Mon Dec 23 12:37:37 2013
@@ -25,11 +25,10 @@ public class ThreadKeyGeneratorImplSubje
     public static List<Object[]> data() {
         final List<Object[]> result = new ArrayList<Object[]>();
 
-        result.add(new Object[] {"Chef cookbooks for Installing CQ & packages", "Re:
Chef cookbooks for Installing CQ & packages"} ); 
+        result.add(new Object[] {"Chef cookbooks for Installing FAQ & packages", "Re:
Chef cookbooks for Installing FAQ & packages"} ); 
         result.add(new Object[] {"Dropbox to throw random files in and be accessible through
http/ ftp?", "Re: Dropbox to throw random files in and be accessible through http/ ftp?"}
); 
         result.add(new Object[] {"Dropbox to throw random files in and be accessible through
http/ ftp?", "RE: Dropbox to throw random files in and be accessible through http/ ftp?"}
); 
-        result.add(new Object[] {"CRX integration guidelines for ES3", "答复: CRX
integration guidelines for ES3"} ); 
-        //        result.add(new Object[] {, } ); 
+        result.add(new Object[] {"FAQ integration guidelines for ES3", " \u7B54\u590D: FAQ
integration guidelines for ES3"} ); 
 
         return result;
     }

Modified: sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/ThreadKeyGeneratorImplTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/ThreadKeyGeneratorImplTest.java?rev=1553104&r1=1553103&r2=1553104&view=diff
==============================================================================
--- sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/ThreadKeyGeneratorImplTest.java
(original)
+++ sling/trunk/samples/mail-archive/server/src/test/java/org/apache/sling/mailarchiveserver/impl/ThreadKeyGeneratorImplTest.java
Mon Dec 23 12:37:37 2013
@@ -36,7 +36,7 @@ public class ThreadKeyGeneratorImplTest 
 		result.add(new Object[] {null, UNADDRESSABLE_SUBJECT_KEY} ); 
 		result.add(new Object[] {"*", UNADDRESSABLE_SUBJECT_KEY} ); 
 		result.add(new Object[] {"1.5.0", "0/00/1_5_0"} ); 
-		result.add(new Object[] {"把握正确方向,做个效率为先的领导助手",
UNADDRESSABLE_SUBJECT_KEY} ); 
+		result.add(new Object[] {"\"\u628A\u63E1\u6B63\u786E\u65B9\u5411,\u505A\u4E2A\u6548\u7387\u4E3A\u5148\u7684\u9886\u5BFC\u52A9\u624B\"",
UNADDRESSABLE_SUBJECT_KEY} ); 
 		result.add(new Object[] {"remove   consecutive - . - whitespaces", "c/cs/remove_consecutive_whitespaces"}
); 
 
 		return result;



Mime
View raw message