Author: sergeyb
Date: Mon Jul 22 15:55:18 2013
New Revision: 1505723

URL: http://svn.apache.org/r1505723
Log:
Merged revisions 1505719 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

................
  r1505719 | sergeyb | 2013-07-22 16:33:17 +0100 (Mon, 22 Jul 2013) | 9 lines
  
  Merged revisions 1505717 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1505717 | sergeyb | 2013-07-22 16:25:52 +0100 (Mon, 22 Jul 2013) | 1 line
    
    [CXF-5144] Reusing the original ServletConfig reference
  ........
................

Added:
    
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/SpringServletConfigStore.java
      - copied unchanged from r1505719, 
cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/SpringServletConfigStore.java
Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
    
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java
    
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
    
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/branches/2.7.x-fixes:r1505719
  Merged /cxf/trunk:r1505717

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java?rev=1505723&r1=1505722&r2=1505723&view=diff
==============================================================================
--- 
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
 (original)
+++ 
cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/CXFServlet.java
 Mon Jul 22 15:55:18 2013
@@ -48,18 +48,18 @@ public class CXFServlet extends CXFNonSp
     }
 
     @Override
-    protected void loadBus(ServletConfig sc) {
+    protected void loadBus(ServletConfig servletConfig) {
         ApplicationContext wac = WebApplicationContextUtils.
-            getWebApplicationContext(sc.getServletContext());
+            getWebApplicationContext(servletConfig.getServletContext());
         
         if (wac instanceof AbstractApplicationContext) {
             addListener((AbstractApplicationContext)wac);
         }
         
-        String configLocation = sc.getInitParameter("config-location");
+        String configLocation = 
servletConfig.getInitParameter("config-location");
         if (configLocation == null) {
             try {
-                InputStream is = 
sc.getServletContext().getResourceAsStream("/WEB-INF/cxf-servlet.xml");
+                InputStream is = 
servletConfig.getServletContext().getResourceAsStream("/WEB-INF/cxf-servlet.xml");
                 if (is != null && is.available() > 0) {
                     is.close();
                     configLocation = "/WEB-INF/cxf-servlet.xml";
@@ -69,7 +69,7 @@ public class CXFServlet extends CXFNonSp
             }
         }
         if (configLocation != null) {
-            wac = createSpringContext(wac, sc, configLocation);
+            wac = createSpringContext(wac, servletConfig, configLocation);
         }
         if (wac != null) {
             setBus((Bus)wac.getBean("cxf", Bus.class));
@@ -102,12 +102,11 @@ public class CXFServlet extends CXFNonSp
      * @return
      */
     private ApplicationContext createSpringContext(ApplicationContext ctx,
-                                                   ServletConfig sc,
+                                                   ServletConfig servletConfig,
                                                    String location) {
         XmlWebApplicationContext ctx2 = new XmlWebApplicationContext();
         createdContext = ctx2;
-        ctx2.setServletConfig(sc);
-
+        ctx2.setServletConfig(servletConfig);
         Resource r = ctx2.getResource(location);
         try {
             InputStream in = r.getInputStream();

Modified: 
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java?rev=1505723&r1=1505722&r2=1505723&view=diff
==============================================================================
--- 
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java
 (original)
+++ 
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java
 Mon Jul 22 15:55:18 2013
@@ -83,7 +83,7 @@ public class JAXRSClientServerResourceCr
     @Test
     public void testMultipleRootsWadl() throws Exception {
         List<Element> resourceEls = getWadlResourcesInfo("http://localhost:"; + 
PORT + "/webapp/resources",
-                                                         "http://localhost:"; + 
PORT + "/webapp/resources", 2);
+                                                         "http://localhost:"; + 
PORT + "/webapp/resources", 3);
         String path1 = resourceEls.get(0).getAttribute("path");
         int bookStoreInd = path1.contains("/bookstore") ? 0 : 1;
         int petStoreInd = bookStoreInd == 0 ? 1 : 0;
@@ -149,6 +149,17 @@ public class JAXRSClientServerResourceCr
     }
     
     @Test
+    public void testServletConfigInitParam() throws Exception {
+        
+        String endpointAddress =
+            "http://localhost:"; + PORT + "/webapp/resources/servlet/config/a"; 
+        WebClient wc = WebClient.create(endpointAddress);
+        wc.accept("text/plain");
+
+        assertEquals("avalue", wc.get(String.class));
+    }
+    
+    @Test
     public void testGetBook123() throws Exception {
         
         String endpointAddress =

Modified: 
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml?rev=1505723&r1=1505722&r2=1505723&view=diff
==============================================================================
--- 
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
 (original)
+++ 
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
 Mon Jul 22 15:55:18 2013
@@ -32,6 +32,7 @@ http://cxf.apache.org/schemas/jaxrs.xsd";
         <jaxrs:serviceBeans>
             <ref bean="petstore"/>
             <ref bean="bookstore"/>
+            <ref bean="servletconfigstore"/>
         </jaxrs:serviceBeans>
         <jaxrs:providers>
             <bean class="org.apache.cxf.systest.jaxrs.BadgerFishProvider"/>
@@ -40,8 +41,9 @@ http://cxf.apache.org/schemas/jaxrs.xsd";
             <ref bean="plainTextProvider"/>
         </jaxrs:providers>
     </jaxrs:server>
-    <bean id="bookstore" scope="prototype" 
class="org.apache.cxf.systest.jaxrs.BookStore"/>
-    <bean id="petstore" scope="prototype" 
class="org.apache.cxf.systest.jaxrs.PetStore"/>
+    <bean id="bookstore" class="org.apache.cxf.systest.jaxrs.BookStore"/>
+    <bean id="petstore" class="org.apache.cxf.systest.jaxrs.PetStore"/>
+    <bean id="servletconfigstore" 
class="org.apache.cxf.systest.jaxrs.SpringServletConfigStore"/>
     <bean id="exceptionMapper" 
class="org.apache.cxf.systest.jaxrs.BookExceptionMapper">
         <property name="toHandle" value="true"/>
     </bean>   

Modified: 
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml?rev=1505723&r1=1505722&r2=1505723&view=diff
==============================================================================
--- 
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml
 (original)
+++ 
cxf/branches/2.6.x-fixes/systests/jaxrs/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml
 Mon Jul 22 15:55:18 2013
@@ -32,6 +32,10 @@
                        org.apache.cxf.transport.servlet.CXFServlet
                </servlet-class>
                <init-param>
+                     <param-name>a</param-name>
+                     <param-value>avalue</param-value>    
+               </init-param>
+               <init-param>
                      <param-name>config-location</param-name>
                      <param-value>/WEB-INF/beans.xml</param-value>    
                </init-param>


Reply via email to