Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 769 invoked from network); 20 Oct 2007 19:21:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Oct 2007 19:21:36 -0000 Received: (qmail 91870 invoked by uid 500); 20 Oct 2007 19:21:24 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 91799 invoked by uid 500); 20 Oct 2007 19:21:24 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 91789 invoked by uid 99); 20 Oct 2007 19:21:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Oct 2007 12:21:24 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Oct 2007 19:21:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D73BA1A9832; Sat, 20 Oct 2007 12:20:45 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r586782 - in /incubator/cxf/branches/2.0.x-fixes: ./ systests/src/test/java/org/apache/cxf/systest/http_jetty/ testutils/src/main/java/org/apache/cxf/jaxb_element_test/ Date: Sat, 20 Oct 2007 19:20:44 -0000 To: cxf-commits@incubator.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071020192045.D73BA1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Sat Oct 20 12:20:43 2007 New Revision: 586782 URL: http://svn.apache.org/viewvc?rev=586782&view=rev Log: Merged revisions 586183 via svnmerge from https://svn.apache.org/repos/asf/incubator/cxf/trunk ........ r586183 | bimargulies | 2007-10-18 19:47:01 -0400 (Thu, 18 Oct 2007) | 2 lines Add test case that shows more problems with server lifecycle to the EngineLifecycleTest. ........ Modified: incubator/cxf/branches/2.0.x-fixes/ (props changed) incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http_jetty/jetty-engine.xml incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/jaxb_element_test/JaxbElementTestImpl.java Propchange: incubator/cxf/branches/2.0.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java?rev=586782&r1=586781&r2=586782&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java (original) +++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http_jetty/EngineLifecycleTest.java Sat Oct 20 12:20:43 2007 @@ -18,8 +18,6 @@ */ package org.apache.cxf.systest.http_jetty; - - import java.io.File; import java.io.FileInputStream; import java.io.InputStream; @@ -29,19 +27,25 @@ import java.util.Properties; +import org.apache.cxf.Bus; +import org.apache.cxf.endpoint.ServerImpl; +import org.apache.cxf.endpoint.ServerRegistry; import org.apache.cxf.helpers.IOUtils; import org.apache.cxf.io.CachedOutputStream; +import org.apache.cxf.transport.http_jetty.JettyHTTPDestination; +import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; +import org.mortbay.jetty.Handler; +import org.mortbay.jetty.webapp.WebAppContext; import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import org.springframework.context.support.GenericApplicationContext; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; - - /** * This class tests starting up and shutting down the embedded server when there * is extra jetty configuration. @@ -54,14 +58,16 @@ reader.loadBeanDefinitions(beanResource); } - public void setUpBus() throws Exception { + public void setUpBus(boolean includeService) throws Exception { applicationContext = new GenericApplicationContext(); readBeans(new ClassPathResource("META-INF/cxf/cxf.xml")); readBeans(new ClassPathResource("META-INF/cxf/cxf-extension-soap.xml")); readBeans(new ClassPathResource("META-INF/cxf/cxf-extension-http.xml")); readBeans(new ClassPathResource("META-INF/cxf/cxf-extension-http-jetty.xml")); readBeans(new ClassPathResource("jetty-engine.xml", getClass())); - + if (includeService) { + readBeans(new ClassPathResource("server-lifecycle-beans.xml", getClass())); + } // bring in some property values from a Properties file PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer(); @@ -112,9 +118,6 @@ html.close(); assertEquals("Can't get the right test html", html.toString(), response.toString()); - - - } public String getStaticResourceURL() throws Exception { @@ -130,9 +133,36 @@ applicationContext.close(); } + @Ignore + @Test + public void testUpDownWithServlets() throws Exception { + setUpBus(true); + + Bus bus = (Bus)applicationContext.getBean("cxf"); + ServerRegistry sr = bus.getExtension(ServerRegistry.class); + ServerImpl si = (ServerImpl) sr.getServers().get(0); + JettyHTTPDestination jhd = (JettyHTTPDestination) si.getDestination(); + JettyHTTPServerEngine e = (JettyHTTPServerEngine) jhd.getEngine(); + org.mortbay.jetty.Server jettyServer = e.getServer(); + + Handler[] contexts = jettyServer.getChildHandlersByClass(WebAppContext.class); + WebAppContext servletContext = null; + for (Handler h : contexts) { + WebAppContext wac = (WebAppContext) h; + if (wac.getContextPath().equals("/jsunit")) { + servletContext = wac; + break; + } + } + servletContext.addServlet("org.mortbay.jetty.servlet.DefaultServlet", "/bloop"); + getTestHtml(); + invokeService(); + shutdownService(); + } + @Test public void testServerUpDownUp() throws Exception { - setUpBus(); + setUpBus(false); launchService(); getTestHtml(); invokeService(); Modified: incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http_jetty/jetty-engine.xml URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http_jetty/jetty-engine.xml?rev=586782&r1=586781&r2=586782&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http_jetty/jetty-engine.xml (original) +++ incubator/cxf/branches/2.0.x-fixes/systests/src/test/java/org/apache/cxf/systest/http_jetty/jetty-engine.xml Sat Oct 20 12:20:43 2007 @@ -35,14 +35,30 @@ - - - - + + + + + + + + + + + + + + + + + + + + - + Modified: incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/jaxb_element_test/JaxbElementTestImpl.java URL: http://svn.apache.org/viewvc/incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/jaxb_element_test/JaxbElementTestImpl.java?rev=586782&r1=586781&r2=586782&view=diff ============================================================================== --- incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/jaxb_element_test/JaxbElementTestImpl.java (original) +++ incubator/cxf/branches/2.0.x-fixes/testutils/src/main/java/org/apache/cxf/jaxb_element_test/JaxbElementTestImpl.java Sat Oct 20 12:20:43 2007 @@ -29,8 +29,6 @@ public class JaxbElementTestImpl implements JaxbElementTest { public String newOperation(String in) { - // TODO Auto-generated method stub - if (in == null) { return "in=null"; } else {