commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1147212 - in /commons/proper/lang/trunk: ./ src/site/changes/ src/test/java/org/apache/commons/lang3/ src/test/resources/
Date Fri, 15 Jul 2011 16:12:51 GMT
Author: ggregory
Date: Fri Jul 15 16:12:50 2011
New Revision: 1147212

URL: http://svn.apache.org/viewvc?rev=1147212&view=rev
Log:
Test for [LANG-720] StringEscapeUtils.escapeXml(input) outputs wrong results when an input
contains characters in Supplementary Planes. [LANG-708] StringEscapeUtils.escapeEcmaScript
from lang3 cuts off long unicode string.

Added:
    commons/proper/lang/trunk/src/test/resources/
    commons/proper/lang/trunk/src/test/resources/lang-708-input.txt
Modified:
    commons/proper/lang/trunk/build.properties.sample
    commons/proper/lang/trunk/build.xml
    commons/proper/lang/trunk/default.properties
    commons/proper/lang/trunk/pom.xml
    commons/proper/lang/trunk/src/site/changes/changes.xml
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java

Modified: commons/proper/lang/trunk/build.properties.sample
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/build.properties.sample?rev=1147212&r1=1147211&r2=1147212&view=diff
==============================================================================
--- commons/proper/lang/trunk/build.properties.sample (original)
+++ commons/proper/lang/trunk/build.properties.sample Fri Jul 15 16:12:50 2011
@@ -24,3 +24,4 @@
 repository=${user.home}/.m2/repository
 junit.home=${repository}/junit/junit/4.7/
 easymock.home=${repository}/org/easymock/easymock/2.5.2/
+commons-io.home=${repository}/commons-io/commons-io/2.0.1/

Modified: commons/proper/lang/trunk/build.xml
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/build.xml?rev=1147212&r1=1147211&r2=1147212&view=diff
==============================================================================
--- commons/proper/lang/trunk/build.xml (original)
+++ commons/proper/lang/trunk/build.xml Fri Jul 15 16:12:50 2011
@@ -42,6 +42,7 @@
         <pathelement location="${build.home}/tests"/>
         <pathelement location="${junit.jar}"/>
     	<pathelement location="${easymock.jar}"/>
+    	<pathelement location="${commons-io.jar}"/>
     </path>
 
     <!-- ========== Executable Targets ======================================== -->

Modified: commons/proper/lang/trunk/default.properties
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/default.properties?rev=1147212&r1=1147211&r2=1147212&view=diff
==============================================================================
--- commons/proper/lang/trunk/default.properties (original)
+++ commons/proper/lang/trunk/default.properties Fri Jul 15 16:12:50 2011
@@ -23,6 +23,9 @@ junit.jar = ${junit.home}/junit-4.7.jar
 # The location of the Easymock jar
 easymock.jar = ${easymock.home}/easymock-2.5.2.jar
 
+# The location of the Commons-IO jar
+commons-io.jar = ${commons-io.home}/commons-io-2.0.1.jar
+
 # Whether or not to fork tests
 junit.fork = true
 

Modified: commons/proper/lang/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/pom.xml?rev=1147212&r1=1147211&r2=1147212&view=diff
==============================================================================
--- commons/proper/lang/trunk/pom.xml (original)
+++ commons/proper/lang/trunk/pom.xml Fri Jul 15 16:12:50 2011
@@ -425,6 +425,13 @@
     </dependency>
 
     <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>2.0.1</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <groupId>org.easymock</groupId>
       <artifactId>easymock</artifactId>
       <version>2.5.2</version>

Modified: commons/proper/lang/trunk/src/site/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/site/changes/changes.xml?rev=1147212&r1=1147211&r2=1147212&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/site/changes/changes.xml (original)
+++ commons/proper/lang/trunk/src/site/changes/changes.xml Fri Jul 15 16:12:50 2011
@@ -22,6 +22,7 @@
   <body>
 
   <release version="3.0" date="Unreleased" description="Backwards incompatible update
of Commons Lang to Java 5">  
+    <action type="fix" issue="LANG-720">StringEscapeUtils.escapeXml(input) outputs
wrong results when an input contains characters in Supplementary Planes.</action>
     <action type="update" issue="LANG-718">build.xml Java 1.5+ updates.</action>
     <action type="fix" issue="LANG-716">swapCase and *capitalize speedups.</action>
     <action type="fix" issue="LANG-715">CharSetUtils.squeeze() speedup.</action>
@@ -29,6 +30,7 @@
     <action type="update" issue="LANG-713">Increase test coverage of FieldUtils read
methods and tweak javadoc</action>
     <action type="fix" issue="LANG-711">Add includeantruntime=false to javac targets
to quell warnings in ant 1.8.1 and better (and modest performance gain).</action>
     <action type="fix" issue="LANG-710">StringIndexOutOfBoundsException when calling
unescapeHtml4("&amp;#03")</action>
+    <action type="fix" issue="LANG-708">StringEscapeUtils.escapeEcmaScript from lang3
cuts off long unicode string</action>
     <action type="fix" issue="LANG-703">StringUtils.join throws NPE when toString returns
null for one of objects in collection</action>
     <action type="add" issue="LANG-697">Add FormattableUtils class</action>
     <action type="add">Add ClassUtils.getSimpleName() methods</action>

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java?rev=1147212&r1=1147211&r2=1147212&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/StringEscapeUtilsTest.java
Fri Jul 15 16:12:50 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.commons.lang3;
 
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.StringWriter;
 import java.lang.reflect.Constructor;
@@ -23,6 +24,8 @@ import java.lang.reflect.Modifier;
 
 import junit.framework.TestCase;
 
+import org.apache.commons.io.IOUtils;
+
 /**
  * Unit tests for {@link StringEscapeUtils}.
  *
@@ -390,7 +393,11 @@ public class StringEscapeUtilsTest exten
         }
     }
 
-    // https://issues.apache.org/jira/browse/LANG-480
+    /**
+     * Tests // https://issues.apache.org/jira/browse/LANG-480
+     * 
+     * @throws java.io.UnsupportedEncodingException
+     */
     public void testEscapeHtmlHighUnicode() throws java.io.UnsupportedEncodingException {
         // this is the utf8 representation of the character:
         // COUNTING ROD UNIT DIGIT THREE
@@ -411,7 +418,9 @@ public class StringEscapeUtilsTest exten
 //        assertEquals( "High unicode should have been unescaped", original, unescapedFromEntity);
     }
 
-    // https://issues.apache.org/jira/browse/LANG-339
+    /**
+     * Tests https://issues.apache.org/jira/browse/LANG-339
+     */
     public void testEscapeHiragana() {
         // Some random Japanese unicode characters
         String original = "\u304B\u304C\u3068";
@@ -424,7 +433,24 @@ public class StringEscapeUtilsTest exten
         assertEquals( "Hiragana character unicode behaviour has changed - expected no unescaping",
escaped, unescaped);
     }
 
-    // https://issues.apache.org/jira/browse/LANG-720
+    /**
+     * Tests https://issues.apache.org/jira/browse/LANG-708
+     * 
+     * @throws IOException
+     *             if an I/O error occurs
+     */
+    public void testLang708() throws IOException {
+        String input = IOUtils.toString(new FileInputStream("src/test/resources/lang-708-input.txt"),
"UTF-8");
+        String escaped = StringEscapeUtils.escapeEcmaScript(input);
+        // just the end:
+        assertTrue(escaped, escaped.endsWith("}]"));
+        // a little more:
+        assertTrue(escaped, escaped.endsWith("\"valueCode\\\":\\\"\\\"}]"));
+    }
+
+    /**
+     * Tests https://issues.apache.org/jira/browse/LANG-720
+     */
     public void testLang720() {
         String input = new StringBuilder("\ud842\udfb7").append("A").toString();
         String escaped = StringEscapeUtils.escapeXml(input);

Added: commons/proper/lang/trunk/src/test/resources/lang-708-input.txt
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/resources/lang-708-input.txt?rev=1147212&view=auto
==============================================================================
--- commons/proper/lang/trunk/src/test/resources/lang-708-input.txt (added)
+++ commons/proper/lang/trunk/src/test/resources/lang-708-input.txt Fri Jul 15 16:12:50 2011
@@ -0,0 +1 @@
+[{"geonameFeatureClass":"L","values":{"eu":"Mundua","ro":"Pamânt","it":"Globo","ca":"el
món","tr":"Yeryüzü","no":"Jorden","hu":"Föld","lv":"Zeme","de":"Welt","el":"Υδρόγειος","fi":"Maa","la":"Terra","fr":"Monde","eo":"Mondo","en":"World","ru":"Земля","es":"el
planeta","nl":"Aarde"},"geonameFeatureCode":"AREA","_id":32,"name":"","auto":true,"type":"GEO","geonameId":6295630,"valueCode":""},{"geonameFeatureClass":"L","values":{"ro":"Europa","zh":"欧洲","ca":"Europa","vi":"Châu
Âu","tr":"Avrupa","no":"Europa","hu":"Európa","lv":"Eiropa","hi":"यूरोप","lt":"Europa","bs":"Evropa","ga":"an
Eoraip","th":"ยุโรป","id":"Eropa","de":"Europa","fi":"Eurooppa","fr":"Europe","sv":"Europa","bg":"Европа","da":"Europa","eu":"Europa","is":"Evrópa","it":"Europa","cy":"Ewrop","ar":"أوروبا","se":"Eurohpá","he":"אירופה
 ","cs":"Evropa","el":"Ευρώπη","nb":"Europa","pl":"Europa","la":"Europa","pt":"Europa","eo":"Eŭropo","en":"Europe","ru":"Европа","es":"Europa","ja":"ヨーロッパ","nl":"Europa"},"geonameFeatureCode":"CONT","_id":33,"name":"","auto":true,"type":"GEO","geonameId":6255148,"valueCode":""},{"geonameFeatureClass":"A","values":{"no":"Spania","nn":"Spania","fy":"Spanje","gd":"An
Spàinn","ga":"An Spáinn","oc":"Espanha","arc":"ܐܣܦܢܝܐ","fi":"Espanja","fr":"Espagne","fo":"Spania","udm":"Испания","os":"Испани","he":"ספרד","gn":"Epaña","gl":"España","gv":"Yn
Spaainey","pl":"Hiszpania","gu":"સ્પેઇન","lo":"ສະເປນ","ln":"Espania","vi":"Tây
Ban Nha","dz":"Spain","pms":"Spagna","lv":"Spānija","lt":"Ispanija","vo":"Spanyän","de":"Spanien","mg":"Espaina","fur":"Spagne","mk":"Шпаниј
 а","ml":"സ്പെയ്ന്\u200D","ceb":"Espanya","mi":"Pāniora","uk":"Іспанія","eu":"Espainia","mr":"स्पेन","ug":"ئىسپانىيە","mt":"Spanja","ms":"Sepanyol","ur":"سپین","fa":"اسپانیا","ty":"Paniora","new":"स्पेन","na":"Pain","el":"Ισπανία","nb":"Spania","ne":"स्पेन","vls":"Spanje","eo":"Hispanio","en":"Kingdom
of Spain","et":"Hispaania","es":"la Madre Patria","nl":"Spanje","vec":"Spagna","to":"Sepeni","ca":"Espanya","tl":"Espanya","tr":"İspanya","tg":"Испониё","haw":"Sepania","bs":"Španija","br":"Spagn","th":"ประเทศสเปน","bn":"স্পেন","bo":"སི་པན།","ta":"ஸ்பெயின்","sv":"Spanien","bg":"Исп
 °Ð½Ð¸Ñ","ka":"ესპანეთი","st":"Spain","sw":"Hispania","be":"Іспанія","kw":"Spayn","sl":"Å panija","sk":"Å panielsko","da":"Spanien","ang":"Spēonland","nds":"Spanien","ks":"Spēna","so":"Isbeyn","ku":"Spanya","sr":"Шпанија","sq":"Spanja","ko":"에스파냐","sc":"Ispagna","cy":"Sbaen","se":"Espánjja","sh":"Å panija","cv":"Испани","km":"អេស្ប៉ាញ","cs":"Å panělsko","li":"Spanje","co":"Spagna","default":"Spain","jbo":"sangu'e","la":"Hesperia","ru":"Испания","lb":"Spuenien","sco":"Spain","tet":"España","scn":"Spagna","hr":"Å panjolska","zh":"西班牙","ro":"Spania","rm":"Spagna","ht":"Espay","hu":"Spanyolország","ast":"España","hi":"स्पेन","hsb":"Å paniska","nah":"Caxtillān","war":"Espanya","lad":"Espanya","id":"Spanyol","ia":"Espani
 a","nrm":"Espangne","hy":"Իսպանիա","qu":"Ispaña","ilo":"Espania","az":"İspaniya","is":"Spánn","it":"Spagna","tpi":"Spen","ar":"أسبانيا","io":"Hispania","pam":"Espanya","frp":"Èspagne","am":"እስፓንያ","an":"España","csb":"Szpańskô","pt":"Espanha","ja":"スペイン","ps":"اسپانيا","yi":"שפאניע","af":"Spanje"},"geonameFeatureCode":"PCLI","_id":260,"name":"","auto":true,"type":"GEO","geonameId":2510769,"valueCode":""},{"geonameFeatureClass":"A","values":{"ca":"Andalusia","tr":"Endülüs","krc":"Андалусия","no":"Andalucía","fy":"Andalûsje","bs":"Andaluzija","br":"Andalouzia","ext":"Andaluzia","ga":"An
Andalúis","th":"แคว้นอันดาลูซีอา","bn":"আন্দালুসিয়া","oc":"Andalosi
 a","ka":"ანდალუსია","sv":"Andalusien","fr":"Andalousie","bg":"Андалусия","glk":"آندالوسیا","be":"Андалусія","kw":"Andalousi","sk":"Andalúzia","os":"Андалуси","da":"Andalusien","sr":"Андалузија","ku":"Endulus","ko":"안달루시아
지방","he":"אנדלוסיה","sh":"Andaluzija","arz":"اندلوسيا","cs":"Andalusie","default":"Andalusia","stq":"Andalusien","la":"Vandalitia","pl":"Andaluzja","ru":"Андалусия","lb":"Andalusien","tet":"Andaluzia","got":"𐍅𐌰𐌽𐌳𐌰𐌻𐌹𐍄𐌾𐌰","hr":"Andaluzija","zh":"安達魯西亞","ro":"Andaluzia","hu":"Andalúzia","pms":"Andalusìa","lv":"Andalūzija","lt":"Andalūzija","nah":"Andalucia","lad":"Anda
 luziya","de":"Andalusien","als":"Andalusien","qu":"Andalusiya","hy":"Անդալուզիա","eu":"Andaluzia","is":"Andalúsía","uk":"Андалусія","az":"Andalusiya","mr":"आंदालुसिया","ug":"Andalusiye","fa":"اندلس","ar":"أندلوسيا","rmy":"Andalusiya","io":"Andaluzia","el":"Ανδαλουσία","frp":"Andalosie","pt":"Andaluzia","eo":"Andaluzio","en":"Andalusia","et":"Andaluusia","es":"Andalucía","ja":"アンダルシア州","nl":"Andalusië","af":"Andalusië","vec":"Andalusìa"},"geonameFeatureCode":"ADM1","_id":261,"name":"","auto":true,"type":"GEO","geonameId":2593109,"valueCode":""},{"geonameFeatureClass":"A","values":{"de":"Granada","default":"Province
of Granada","fr":"Grenade","en":"Province of Granada","es":"Provincia de Granada","ja":"グラナダ"},"geonameFeatureCode":"A
 DM2","_id":262,"name":"","auto":true,"type":"GEO","geonameId":2517115,"valueCode":""},{"geonameFeatureClass":"A","values":{"default":"Monachil"},"geonameFeatureCode":"ADM3","_id":263,"name":"","auto":true,"type":"GEO","geonameId":6357744,"valueCode":""},{"geonameFeatureClass":"P","values":{"default":"Sierra
Nevada"},"geonameFeatureCode":"PPL","_id":264,"name":"","auto":true,"type":"GEO","geonameId":6544329,"valueCode":""}]
\ No newline at end of file



Mime
View raw message