cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1200934 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java
Date Fri, 11 Nov 2011 16:30:43 GMT
Author: sergeyb
Date: Fri Nov 11 16:30:42 2011
New Revision: 1200934

URL: http://svn.apache.org/viewvc?rev=1200934&view=rev
Log:
[CXF-3770] Checking enums better

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java?rev=1200934&r1=1200933&r2=1200934&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
Fri Nov 11 16:30:42 2011
@@ -575,7 +575,7 @@ public class WadlGenerator implements Re
                 name = parentName + "." + name;
             }
             Class<?> paramCls = entry.getValue();
-            boolean isPrimitive = InjectionUtils.isPrimitive(paramCls);
+            boolean isPrimitive = InjectionUtils.isPrimitive(paramCls) || paramCls.isEnum();
             if (isPrimitive || InjectionUtils.isSupportedCollectionOrArray(paramCls)) {
                 doWriteParam(sb, entry.getKey(), paramCls, paramCls, name, new Annotation[]{},
isJson);
             } else {

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java?rev=1200934&r1=1200933&r2=1200934&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java
Fri Nov 11 16:30:42 2011
@@ -413,11 +413,12 @@ public class WadlGeneratorTest extends A
         List<Element> requestEls = getElements(methodEls.get(0), "request", 1);
         
         // 4 parameters are expected
-        verifyParameters(requestEls.get(0), 4, 
+        verifyParameters(requestEls.get(0), 5, 
                          new Param("a", "query", "xs:int"),
                          new Param("c.a", "query", "xs:int"),
                          new Param("c.b", "query", "xs:int"),
-                         new Param("c.d.a", "query", "xs:int"));
+                         new Param("c.d.a", "query", "xs:int"),
+                         new Param("e", "query", "xs:string", Collections.singleton("A")));
         
         assertEquals(0, DOMUtils.getChildrenWithName(requestEls.get(0), 
                          WadlGenerator.WADL_NS, "representation").size());



Mime
View raw message