You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2020/03/18 13:59:08 UTC

[cxf] branch master updated (c8b2075 -> 4644035)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git.


    from c8b2075  Updating woodstox to 5.3.0
     new 6a984d1  Adding a test for the service listing + private endpoints
     new 4644035  CXF-8246 - The bus may be null on instantiating ServiceListGeneratorServlet in OSGi

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../servlet/servicelist/ServiceListGeneratorServlet.java  |  3 +++
 .../cxf/systest/jaxrs/JAXRSServicesListingTest.java       | 15 +++++++++++++++
 .../src/test/resources/service_listing/WEB-INF/beans.xml  |  8 ++++++++
 3 files changed, 26 insertions(+)


[cxf] 01/02: Adding a test for the service listing + private endpoints

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 6a984d1184f2288bf190269b11537b7b1a687dad
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Wed Mar 18 12:12:10 2020 +0000

    Adding a test for the service listing + private endpoints
---
 .../cxf/systest/jaxrs/JAXRSServicesListingTest.java       | 15 +++++++++++++++
 .../src/test/resources/service_listing/WEB-INF/beans.xml  |  8 ++++++++
 2 files changed, 23 insertions(+)

diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSServicesListingTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSServicesListingTest.java
index 88af617..43f167f 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSServicesListingTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSServicesListingTest.java
@@ -98,4 +98,19 @@ public class JAXRSServicesListingTest extends AbstractBusClientServerTestBase {
             assertFalse(result.contains("<script>"));
         }
     }
+
+    @Test
+    public void testServiceListingPrivate() throws Exception {
+
+        String endpointAddress =
+            "http://localhost:" + PORT + "/service_listing/services";
+        String expectedResult =
+            "http://localhost:" + PORT + "/service_listing/services/resourcesprivate";
+
+        URL url = new URL(endpointAddress);
+        try (InputStream input = url.openStream()) {
+            String result = IOUtils.readStringFromStream(input);
+            assertFalse(result.contains(expectedResult));
+        }
+    }
 }
diff --git a/systests/jaxrs/src/test/resources/service_listing/WEB-INF/beans.xml b/systests/jaxrs/src/test/resources/service_listing/WEB-INF/beans.xml
index 425b8c7..eebe008 100644
--- a/systests/jaxrs/src/test/resources/service_listing/WEB-INF/beans.xml
+++ b/systests/jaxrs/src/test/resources/service_listing/WEB-INF/beans.xml
@@ -27,5 +27,13 @@
             <ref bean="servletconfigstore"/>
         </jaxrs:serviceBeans>
     </jaxrs:server>
+    <jaxrs:server id="bookserviceprivate" address="/resourcesprivate">
+        <jaxrs:serviceBeans>
+            <ref bean="servletconfigstore"/>
+        </jaxrs:serviceBeans>
+        <jaxrs:properties>
+            <entry key="org.apache.cxf.endpoint.private" value="true"/>
+        </jaxrs:properties>
+    </jaxrs:server>
     <bean id="servletconfigstore" class="org.apache.cxf.systest.jaxrs.SpringServletConfigStore"/>
 </beans>
\ No newline at end of file


[cxf] 02/02: CXF-8246 - The bus may be null on instantiating ServiceListGeneratorServlet in OSGi

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 4644035db93ebe59a813a95925363f7c716bc390
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Wed Mar 18 13:58:37 2020 +0000

    CXF-8246 - The bus may be null on instantiating ServiceListGeneratorServlet in OSGi
---
 .../cxf/transport/servlet/servicelist/ServiceListGeneratorServlet.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/ServiceListGeneratorServlet.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/ServiceListGeneratorServlet.java
index 56a4421..fd0c94e 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/ServiceListGeneratorServlet.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/ServiceListGeneratorServlet.java
@@ -92,6 +92,9 @@ public class ServiceListGeneratorServlet extends HttpServlet {
             return;
         }
         List<String> privateEndpoints;
+        if (bus == null) {
+            bus = BusFactory.getDefaultBus(false);
+        }
         if (bus != null) {
             privateEndpoints = (List<String>)bus.getProperty("org.apache.cxf.private.endpoints");
         } else {