cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1336260 - in /cxf/branches/2.5.x-fixes/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 Wed, 09 May 2012 16:07:16 GMT
Author: dkulp
Date: Wed May  9 16:07:16 2012
New Revision: 1336260

URL: http://svn.apache.org/viewvc?rev=1336260&view=rev
Log:
Merged revisions 1334191 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1334191 | dkulp | 2012-05-04 17:33:59 -0400 (Fri, 04 May 2012) | 2 lines

  Add some predictability into the WadlGenerator.

........

Modified:
    cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
    cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java?rev=1336260&r1=1336259&r2=1336260&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
Wed May  9 16:07:16 2012
@@ -37,6 +37,8 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.IdentityHashMap;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -220,7 +222,7 @@ public class WadlGenerator implements Re
             schemaWriter == null ? null : createElementQNameResolver(context);
 
         Map<Class<?>, QName> clsMap = new IdentityHashMap<Class<?>,
QName>();
-        Set<ClassResourceInfo> visitedResources = new HashSet<ClassResourceInfo>();
+        Set<ClassResourceInfo> visitedResources = new LinkedHashSet<ClassResourceInfo>();
         for (ClassResourceInfo cri : cris) {
             startResourceTag(sbResources, cri.getServiceClass(), cri.getURITemplate().getValue());
             Annotation[] anns = cri.getServiceClass().getAnnotations();
@@ -323,7 +325,7 @@ public class WadlGenerator implements Re
     }
 
     private Map<Parameter, Object> getClassParameters(ClassResourceInfo cri) {
-        Map<Parameter, Object> classParams = new HashMap<Parameter, Object>();
+        Map<Parameter, Object> classParams = new LinkedHashMap<Parameter, Object>();
         List<Method> paramMethods = cri.getParameterMethods();
         for (Method m : paramMethods) {
             classParams.put(ResourceUtils.getParameter(0, m.getAnnotations(),
@@ -514,7 +516,7 @@ public class WadlGenerator implements Re
     
     private void doHandleClassParams(StringBuilder sb, Map<Parameter, Object> params,
                                      boolean isJson, ParameterType... pType) {
-        Set<ParameterType> pTypes = new HashSet<ParameterType>(Arrays.asList(pType));
+        Set<ParameterType> pTypes = new LinkedHashSet<ParameterType>(Arrays.asList(pType));
         for (Map.Entry<Parameter, Object> entry : params.entrySet()) {
             Parameter pm = entry.getKey();
             Object obj = entry.getValue();

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java?rev=1336260&r1=1336259&r2=1336260&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java
Wed May  9 16:07:16 2012
@@ -307,7 +307,9 @@ public class WadlGeneratorTest extends A
         Response r = wg.handleRequest(m, null);
         assertEquals(WadlGenerator.WADL_TYPE.toString(),
                      r.getMetadata().getFirst(HttpHeaders.CONTENT_TYPE));
-        Document doc = DOMUtils.readXml(new StringReader(r.getEntity().toString()));
+        String wadl = r.getEntity().toString();
+        //System.out.println(wadl);
+        Document doc = DOMUtils.readXml(new StringReader(wadl));
         checkGrammars(doc.getDocumentElement(), "thebook", "thebook2", "thechapter");
         List<Element> els = getWadlResourcesInfo(doc, "http://localhost:8080/baz",
2);
         checkBookStoreInfo(els.get(0), "prefix1:thebook", "prefix1:thebook2", "prefix1:thechapter");



Mime
View raw message