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:01 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 43097ecf7 -> 3dc064a3a


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/3dc064a3
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3dc064a3
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3dc064a3

Branch: refs/heads/master
Commit: 3dc064a3a26818a721df7cb7eb53394225dc58d6
Parents: 43097ec
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:11:41 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/3dc064a3/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 444aee5..07b514b 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);
         
@@ -1820,7 +1816,7 @@ public class JSONProviderTest extends Assert {
 
     @XmlRootElement
     public static class ReportDefinition {
-        //private String reportName;
+        private String reportName;
        
         private List<ParameterDefinition> parameterList;
        
@@ -1829,16 +1825,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