cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Reverting the change to JSONProviderTest
Date Tue, 23 Jun 2015 15:12:44 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 11ccc5639 -> c5cd6ed14


Reverting the change to JSONProviderTest


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c5cd6ed1
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c5cd6ed1
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c5cd6ed1

Branch: refs/heads/3.0.x-fixes
Commit: c5cd6ed147fa86c409b16e84b8f0e6aa3bd86c46
Parents: 11ccc56
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Jun 23 16:11:41 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Jun 23 16:12:28 2015 +0100

----------------------------------------------------------------------
 .../jaxrs/provider/json/JSONProviderTest.java   | 34 +++++++++-----------
 1 file changed, 15 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/c5cd6ed1/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
index 1b59bc8..b1217e5 100644
--- a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
+++ b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java
@@ -211,27 +211,23 @@ public class JSONProviderTest extends Assert {
         assertEquals(expected, bos.toString());
     }
     
-    @Test
     public void testWriteCollectionAsPureArray() throws Exception {
         JSONProvider<ReportDefinition> provider 
             = new JSONProvider<ReportDefinition>();
-        //provider.setSerializeAsArray(true);
-        provider.setArrayKeys(Arrays.asList("parameterList"));
+        provider.setSerializeAsArray(true);
         provider.setDropRootElement(true);
         provider.setOutDropElements(Arrays.asList("parameterList"));
         provider.setDropElementsInXmlStream(false);
         ReportDefinition r = new ReportDefinition();
-        //r.setReportName("report");
+        r.setReportName("report");
         r.addParameterDefinition(new ParameterDefinition("param"));
-        r.addParameterDefinition(new ParameterDefinition("param2"));
         
         Method m = ReportService.class.getMethod("findReport", new Class<?>[]{});
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         provider.writeTo(r, m.getReturnType(), m.getGenericReturnType(),
                          new Annotation[0], MediaType.APPLICATION_JSON_TYPE, 
                          new MetadataMap<String, Object>(), bos);
-        System.out.println(bos.toString());
-        //assertTrue(bos.toString().startsWith("[{\"parameterList\":"));
+        assertTrue(bos.toString().startsWith("[{\"parameterList\":"));
     }
     
     @Test
@@ -242,7 +238,7 @@ public class JSONProviderTest extends Assert {
         provider.setOutDropElements(Collections.singletonList("reportDefinition"));
         provider.setDropElementsInXmlStream(false);
         ReportDefinition r = new ReportDefinition();
-        //r.setReportName("report");
+        r.setReportName("report");
         r.addParameterDefinition(new ParameterDefinition("param"));
         
         Method m = ReportService.class.getMethod("findReport", new Class<?>[]{});
@@ -264,7 +260,7 @@ public class JSONProviderTest extends Assert {
         provider.setDropRootElement(true);
         provider.setDropElementsInXmlStream(false);
         ReportDefinition r = new ReportDefinition();
-        //r.setReportName("report");
+        r.setReportName("report");
         ParameterDefinition paramDef = new ParameterDefinition("param");
         r.addParameterDefinition(paramDef);
         
@@ -1816,7 +1812,7 @@ public class JSONProviderTest extends Assert {
 
     @XmlRootElement
     public static class ReportDefinition {
-        //private String reportName;
+        private String reportName;
        
         private List<ParameterDefinition> parameterList;
        
@@ -1825,16 +1821,16 @@ public class JSONProviderTest extends Assert {
         }
        
         public ReportDefinition(String reportName) {
-        //    this.reportName = reportName;
+            this.reportName = reportName;
+        }
+       
+        public String getReportName() {
+            return reportName;
+        }
+
+        public void setReportName(String reportName) {
+            this.reportName = reportName;
         }
-//       
-//        public String getReportName() {
-//            return reportName;
-//        }
-//
-//        public void setReportName(String reportName) {
-//            this.reportName = reportName;
-//        }
        
         public List<ParameterDefinition> getParameterList() {
             return parameterList;


Mime
View raw message