cxf git commit: CXF-6132: Provide JAX-RS ServletContextInitializer. Adding more test cases.
Repository: cxf Updated Branches: refs/heads/3.0.x-fixes bb7d0d8ce -> 8e5bae551 CXF-6132: Provide JAX-RS ServletContextInitializer. Adding more test cases. Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/8e5bae55 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8e5bae55 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8e5bae55 Branch: refs/heads/3.0.x-fixes Commit: 8e5bae551334d9af2d28f11b336b24ceea6b5fe5 Parents: bb7d0d8 Author: reta Authored: Wed Feb 4 22:04:12 2015 -0500 Committer: Sergey Beryozkin Committed: Wed Feb 11 10:29:03 2015 + -- .../JaxrsServletContainerInitializer.java | 5 +- .../jetty/JettyEmptyApplicationTest.java| 64 ++ .../jetty/JettyEmptyPathApplicationTest.java| 71 .../applications/empty/BookApplication.java | 26 +++ .../applications/emptypath/BookApplication.java | 24 +++ .../src/test/resources/WEB-INF/web-subclass.xml | 10 +++ 6 files changed, 198 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/8e5bae55/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/JaxrsServletContainerInitializer.java -- diff --git a/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/JaxrsServletContainerInitializer.java b/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/JaxrsServletContainerInitializer.java index 89c6b39..c872926 100644 --- a/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/JaxrsServletContainerInitializer.java +++ b/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/JaxrsServletContainerInitializer.java @@ -82,7 +82,7 @@ public class JaxrsServletContainerInitializer implements ServletContainerInitial // If application is null or empty then try to create a new application from available // resource and provider classes if (app == null -|| app.getClasses().isEmpty() && app.getSingletons().isEmpty()) { +|| (app.getClasses().isEmpty() && app.getSingletons().isEmpty())) { // The best effort at detecting a CXFNonSpringJaxrsServlet // Custom servlets using non-standard mechanisms to create Application will not be detected if (isCxfServletAvailable(ctx)) { @@ -98,7 +98,8 @@ public class JaxrsServletContainerInitializer implements ServletContainerInitial // Servlet mapping is obtained from a servlet registration // with a JAX-RS Application class name servletMapping = getServletMapping(ctx, servletName); -} +} + app = new Application() { @Override public Set> getClasses() { http://git-wip-us.apache.org/repos/asf/cxf/blob/8e5bae55/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java -- diff --git a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java new file mode 100644 index 000..af8a5be --- /dev/null +++ b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java @@ -0,0 +1,64 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.jaxrs.servlet.jetty; + +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + +import org.apache.cxf.jaxrs.model.AbstractResourceInfo; +import org.apache.cxf.jaxrs.servlet.AbstractSciTest; +import org.eclipse.jetty.util.resource.Resource; +import org.junit.BeforeClass; +import org.junit.Ignore; + +public class JettyEmptyApplicationTest extends AbstractSciTest { +@Ignore +public static class EmbeddedJettyServer extends AbstractJettyServer { +public static
cxf git commit: CXF-6132: Provide JAX-RS ServletContextInitializer. Adding more test cases.
Repository: cxf Updated Branches: refs/heads/master 6bf377f6a -> 1d9e79ef3 CXF-6132: Provide JAX-RS ServletContextInitializer. Adding more test cases. Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1d9e79ef Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1d9e79ef Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1d9e79ef Branch: refs/heads/master Commit: 1d9e79ef36bf14e25d7cd2cccb0d804a048aef64 Parents: 6bf377f Author: reta Authored: Wed Feb 4 22:04:12 2015 -0500 Committer: reta Committed: Wed Feb 4 22:04:38 2015 -0500 -- .../JaxrsServletContainerInitializer.java | 5 +- .../jetty/JettyEmptyApplicationTest.java| 64 ++ .../jetty/JettyEmptyPathApplicationTest.java| 71 .../applications/empty/BookApplication.java | 26 +++ .../applications/emptypath/BookApplication.java | 24 +++ .../src/test/resources/WEB-INF/web-subclass.xml | 10 +++ 6 files changed, 198 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/1d9e79ef/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/JaxrsServletContainerInitializer.java -- diff --git a/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/JaxrsServletContainerInitializer.java b/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/JaxrsServletContainerInitializer.java index 89c6b39..c872926 100644 --- a/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/JaxrsServletContainerInitializer.java +++ b/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/JaxrsServletContainerInitializer.java @@ -82,7 +82,7 @@ public class JaxrsServletContainerInitializer implements ServletContainerInitial // If application is null or empty then try to create a new application from available // resource and provider classes if (app == null -|| app.getClasses().isEmpty() && app.getSingletons().isEmpty()) { +|| (app.getClasses().isEmpty() && app.getSingletons().isEmpty())) { // The best effort at detecting a CXFNonSpringJaxrsServlet // Custom servlets using non-standard mechanisms to create Application will not be detected if (isCxfServletAvailable(ctx)) { @@ -98,7 +98,8 @@ public class JaxrsServletContainerInitializer implements ServletContainerInitial // Servlet mapping is obtained from a servlet registration // with a JAX-RS Application class name servletMapping = getServletMapping(ctx, servletName); -} +} + app = new Application() { @Override public Set> getClasses() { http://git-wip-us.apache.org/repos/asf/cxf/blob/1d9e79ef/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java -- diff --git a/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java new file mode 100644 index 000..af8a5be --- /dev/null +++ b/systests/rs-http-sci/src/test/java/org/apache/cxf/jaxrs/servlet/jetty/JettyEmptyApplicationTest.java @@ -0,0 +1,64 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.jaxrs.servlet.jetty; + +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + +import org.apache.cxf.jaxrs.model.AbstractResourceInfo; +import org.apache.cxf.jaxrs.servlet.AbstractSciTest; +import org.eclipse.jetty.util.resource.Resource; +import org.junit.BeforeClass; +import org.junit.Ignore; + +public class JettyEmptyApplicationTest extends AbstractSciTest { +@Ignore +public static class EmbeddedJettyServer extends AbstractJettyServer { +public static final int PORT = allo