cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1350756 - in /cxf/branches/2.5.x-fixes: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/form/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/form/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
Date Fri, 15 Jun 2012 19:50:46 GMT
Author: dkulp
Date: Fri Jun 15 19:50:45 2012
New Revision: 1350756

URL: http://svn.apache.org/viewvc?rev=1350756&view=rev
Log:
Merged revisions 1350308 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

........
  r1350308 | sergeyb | 2012-06-14 12:00:58 -0400 (Thu, 14 Jun 2012) | 13 lines

  Merged revisions 1350215,1350303 via svnmerge from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1350215 | ningjiang | 2012-06-14 13:45:51 +0100 (Thu, 14 Jun 2012) | 1 line

    Fix a comment typo of JAXRSSoapBookTest
  ........
    r1350303 | sergeyb | 2012-06-14 16:50:09 +0100 (Thu, 14 Jun 2012) | 1 line

    Minor update to Form to override toString
  ........

........

Added:
    cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/form/
    cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/form/FormTest.java
      - copied, changed from r1350588, cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/form/Form.java
Modified:
    cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/form/Form.java
    cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/form/Form.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/form/Form.java?rev=1350756&r1=1350755&r2=1350756&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/form/Form.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/form/Form.java
Fri Jun 15 19:50:45 2012
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.jaxrs.ext.form;
 
+import java.io.ByteArrayOutputStream;
+
 import javax.ws.rs.core.MultivaluedMap;
 
 import org.apache.cxf.jaxrs.impl.MetadataMap;
@@ -50,4 +52,14 @@ public class Form {
         return map;
     }
     
+    public String toString() {
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        try {
+            FormUtils.writeMapToOutputStream(map, bos, "UTF-8", false);
+            return bos.toString("UTF-8");
+        } catch (Exception ex) {
+            // will not happen
+        }
+        return "";
+    }
 }

Copied: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/form/FormTest.java
(from r1350588, cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/form/Form.java)
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/form/FormTest.java?p2=cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/form/FormTest.java&p1=cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/form/Form.java&r1=1350588&r2=1350756&rev=1350756&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/form/Form.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ext/form/FormTest.java
Fri Jun 15 19:50:45 2012
@@ -16,38 +16,17 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
 package org.apache.cxf.jaxrs.ext.form;
 
-import javax.ws.rs.core.MultivaluedMap;
+import org.junit.Assert;
+import org.junit.Test;
 
-import org.apache.cxf.jaxrs.impl.MetadataMap;
-import org.apache.cxf.jaxrs.utils.FormUtils;
+public class FormTest extends Assert {
 
-/**
- * Simple MultivaluedMap wrapper 
- *
- */
-public class Form {
-    private MultivaluedMap<String, String> map = 
-        new MetadataMap<String, String>();
-    
-    public Form() {
-        
-    }
-    
-    public Form(MultivaluedMap<String, String> map) {
-        this.map = map;
+    @Test
+    public void testToString() {
+        Form form = new Form().set("a", "b").set("c", "d");
+        assertEquals("a=b&c=d", form.toString());
     }
-    
-    public Form set(String name, Object value) {
-        
-        FormUtils.addPropertyToForm(map, name, value);
-        return this;
-    }
-    
-    public MultivaluedMap<String, String> getData() {
-        return map;
-    }
-    
+
 }

Modified: cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java?rev=1350756&r1=1350755&r2=1350756&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
Fri Jun 15 19:50:45 2012
@@ -871,7 +871,7 @@ public class JAXRSSoapBookTest extends A
         } catch (Exception e) {
             assertTrue("Out Interceptor not invoked", testFeature.handleMessageOnOutInterceptorCalled());
             if ("322".equals(param)) {
-                //In interecptors not called when checked exception thrown from server
+                //In interceptors not called when checked exception thrown from server
                 assertTrue("In Interceptor not invoked", testFeature.handleMessageOnInInterceptorCalled());
             } else {
                 assertTrue("In Interceptor not invoked", !testFeature.handleMessageOnInInterceptorCalled());



Mime
View raw message