cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1128911 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/
Date Sun, 29 May 2011 17:37:35 GMT
Author: sergeyb
Date: Sun May 29 17:37:35 2011
New Revision: 1128911

URL: http://svn.apache.org/viewvc?rev=1128911&view=rev
Log:
[CXF-3553] Adding a boolean ignoreRequests property to WADLGenerator

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
    cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml

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=1128911&r1=1128910&r2=1128911&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
Sun May 29 17:37:35 2011
@@ -98,7 +98,6 @@ import org.apache.cxf.jaxrs.utils.JAXRSU
 import org.apache.cxf.jaxrs.utils.ResourceUtils;
 import org.apache.cxf.jaxrs.utils.schemas.SchemaHandler;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.staxutils.DelegatingXMLStreamWriter;
 import org.apache.cxf.staxutils.StaxUtils;
@@ -122,7 +121,8 @@ public class WadlGenerator implements Re
     private boolean useSingleSlashResource;
     private boolean ignoreForwardSlash;
     private boolean addResourceAndMethodIds;
-
+    private boolean ignoreRequests;
+    
     private boolean useJaxbContextForQnames = true;
 
     private List<String> externalSchemasCache;
@@ -175,8 +175,8 @@ public class WadlGenerator implements Re
             return null;
         }
 
-        if (isPrivate(m)) {
-            return Response.status(401).build();
+        if (ignoreRequests) {
+            return Response.status(404).build();
         }
 
         HttpHeaders headers = new HttpHeadersImpl(m);
@@ -1322,10 +1322,6 @@ public class WadlGenerator implements Re
         return privateAddresses;
     }
 
-    private boolean isPrivate(Message m) {
-        return MessageUtils.isTrue(m.getContextualProperty("org.apache.cxf.endpoint.private"));
-    }
-
     public void setAddResourceAndMethodIds(boolean addResourceAndMethodIds) {
         this.addResourceAndMethodIds = addResourceAndMethodIds;
     }
@@ -1347,6 +1343,10 @@ public class WadlGenerator implements Re
         this.ignoreForwardSlash = ignoreForwardSlash;
     }
 
+    public void setIgnoreRequests(boolean ignoreRequests) {
+        this.ignoreRequests = ignoreRequests;
+    }
+
     private static class SchemaConverter extends DelegatingXMLStreamWriter {
         private static final String SCHEMA_LOCATION = "schemaLocation";
         private Map<String, String> locsMap;

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java?rev=1128911&r1=1128910&r2=1128911&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
Sun May 29 17:37:35 2011
@@ -749,7 +749,7 @@ public class JAXRSSoapBookTest extends A
         WebClient webClient = 
             WebClient.create("http://localhost:" + PORT + "/test/services/rest3?_wadl&type=xml");
         WebClient.getConfig(webClient).getHttpConduit().getClient().setReceiveTimeout(1000000);
-        assertEquals(401, webClient.get().getStatus());
+        assertEquals(404, webClient.get().getStatus());
     }
     
     @Test

Modified: cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml?rev=1128911&r1=1128910&r2=1128911&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml (original)
+++ cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml Sun May
29 17:37:35 2011
@@ -129,6 +129,9 @@ http://cxf.apache.org/schemas/jaxrs.xsd"
     
     <jaxrs:providers>
        <ref bean="jaxbProviderFI" />
+       <bean class="org.apache.cxf.jaxrs.model.wadl.WadlGenerator">
+           <property name="ignoreRequests" value="true"/>
+       </bean>
     </jaxrs:providers>
 
     <jaxrs:properties>



Mime
View raw message