Author: sergeyb
Date: Tue Jun 26 13:33:08 2012
New Revision: 1354009

URL: http://svn.apache.org/viewvc?rev=1354009&view=rev
Log:
[CXF-4144] Fixing the test

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=1354009&r1=1354008&r2=1354009&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
 Tue Jun 26 13:33:08 2012
@@ -942,8 +942,9 @@ public class WadlGenerator implements Re
                 QName collectionName = null;
                 if (name != null) {
                     QName tempQName = 
JAXRSUtils.convertStringToQName(name.value());
-                    collectionName = new QName(qname.getPrefix(), 
qname.getNamespaceURI(), 
-                                               tempQName.getLocalPart());
+                    collectionName = new QName(qname.getNamespaceURI(), 
+                                               tempQName.getLocalPart(),
+                                               qname.getPrefix());
                     writeQName(sb, collectionName);
                 }
             }

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=1354009&r1=1354008&r2=1354009&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
 Tue Jun 26 13:33:08 2012
@@ -214,7 +214,11 @@ public class WadlGeneratorTest extends A
         checkDocs(doc.getDocumentElement(), "My Application", "", "");
         checkGrammars(doc.getDocumentElement(), "thebook", "books", 
"thebook2", "thechapter");
         List<Element> els = getWadlResourcesInfo(doc, 
"http://localhost:8080/baz";, 1);
-        checkBookStoreInfo(els.get(0), "ns1:thebook", "ns1:thebook2", 
"ns1:thechapter");
+        checkBookStoreInfo(els.get(0), 
+                           "ns1:thebook", 
+                           "ns1:thebook2", 
+                           "ns1:thechapter",
+                           "ns1:books");
     }
     
     @Test
@@ -420,6 +424,14 @@ public class WadlGeneratorTest extends A
                                     String bookEl, 
                                     String book2El, 
                                     String chapterEl) {
+        checkBookStoreInfo(resource, bookEl, book2El, chapterEl, null);
+    }
+    
+    private void checkBookStoreInfo(Element resource, 
+                                    String bookEl, 
+                                    String book2El, 
+                                    String chapterEl,
+                                    String booksEl) {
         assertEquals("/bookstore/{id}", resource.getAttribute("path"));
         
         checkDocs(resource, "book store resource", "super resource", "en-us");
@@ -464,6 +476,9 @@ public class WadlGeneratorTest extends A
         
         // verify 2nd GET
         assertEquals("GET", methodEls.get(1).getAttribute("name"));
+        if (booksEl != null) {
+            verifyRepresentation(methodEls.get(1), "response", 
"application/xml", booksEl);
+        }
         
         // verify POST
         assertEquals("POST", methodEls.get(2).getAttribute("name"));


Reply via email to