geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r151627 - in geronimo/trunk/modules: axis/ j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ jetty-builder/src/java/org/apache/geronimo/jetty/deployment/ jetty-builder/src/test/org/apache/geronimo/jetty/app/ jetty-builder/src/test/org/apache/geronimo/jetty/deployment/ jetty/src/java/org/apache/geronimo/jetty/ jetty/src/test/org/apache/geronimo/jetty/ jetty/src/test/org/apache/geronimo/jetty/app/
Date Sun, 06 Feb 2005 22:24:43 GMT
Author: djencks
Date: Sun Feb  6 14:24:41 2005
New Revision: 151627

URL: http://svn.apache.org/viewcvs?view=rev&rev=151627
Log:
2nd draft of ejb ws deployment help in jetty (see dev list description)

Added:
    geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/
    geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java
      - copied, changed from r151534, geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java
Removed:
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBWebServiceDeployer.java
    geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java
Modified:
    geronimo/trunk/modules/axis/project.xml
    geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebServiceHandler.java
    geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java

Modified: geronimo/trunk/modules/axis/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/project.xml?view=diff&r1=151626&r2=151627
==============================================================================
--- geronimo/trunk/modules/axis/project.xml (original)
+++ geronimo/trunk/modules/axis/project.xml Sun Feb  6 14:24:41 2005
@@ -111,9 +111,6 @@
             <groupId>geronimo</groupId>
             <artifactId>geronimo-security</artifactId>
             <version>${pom.currentVersion}</version>
-            <properties>
-                <xmlbeans>true</xmlbeans>
-            </properties>
         </dependency>
         <dependency>
             <groupId>geronimo</groupId>
@@ -152,9 +149,11 @@
             <groupId>geronimo</groupId>
             <artifactId>geronimo-timer</artifactId>
             <version>${pom.currentVersion}</version>
-            <properties>
-                <runtime>true</runtime>
-            </properties>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-webservices</artifactId>
+            <version>${pom.currentVersion}</version>
         </dependency>
         <dependency>
             <groupId>geronimo-spec</groupId>

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&r1=151626&r2=151627
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Sun Feb  6 14:24:41 2005
@@ -43,8 +43,8 @@
 import javax.security.jacc.WebResourcePermission;
 import javax.security.jacc.WebRoleRefPermission;
 import javax.security.jacc.WebUserDataPermission;
-import javax.transaction.UserTransaction;
 import javax.servlet.Servlet;
+import javax.transaction.UserTransaction;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
@@ -58,7 +58,6 @@
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
-import org.apache.geronimo.j2ee.deployment.EJBWebServiceDeployer;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -67,7 +66,6 @@
 import org.apache.geronimo.jetty.JettyFilterMapping;
 import org.apache.geronimo.jetty.JettyServletHolder;
 import org.apache.geronimo.jetty.JettyWebAppContext;
-import org.apache.geronimo.jetty.JettyWebServiceHandler;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
@@ -115,7 +113,7 @@
 /**
  * @version $Rev$ $Date$
  */
-public class JettyModuleBuilder implements ModuleBuilder, EJBWebServiceDeployer {
+public class JettyModuleBuilder implements ModuleBuilder {
     private final URI defaultParentId;
     private final ObjectName jettyContainerObjectName;
     private final ObjectName defaultServlets;
@@ -1054,20 +1052,6 @@
         if (webApp.getLoginConfigArray().length > 1) throw new DeploymentException("Multiple
<login-config> elements found");
     }
 
-
-    public void addEJBWebService(ObjectName containerId, String contextPath, String name,
J2eeContext j2eeModuleContext, EARContext earContext) throws DeploymentException {
-        ObjectName webServiceHandlerName = null;
-        try {
-            webServiceHandlerName = NameFactory.getWebComponentName(null, null, null, null,
name, NameFactory.WEB_MODULE, j2eeModuleContext);
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Could not construct web service handler name",
e);
-        }
-        GBeanData webServiceGBeanData = new GBeanData(webServiceHandlerName, JettyWebServiceHandler.GBEAN_INFO);
-        webServiceGBeanData.setAttribute("contextPath", contextPath);
-        webServiceGBeanData.setReferencePattern("WebServiceInvoker", containerId);
-        webServiceGBeanData.setReferencePattern("JettyContainer", jettyContainerObjectName);
-        earContext.addGBean(webServiceGBeanData);
-    }
 
     public static final GBeanInfo GBEAN_INFO;
 

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?view=diff&r1=151626&r2=151627
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Sun Feb  6 14:24:41 2005
@@ -16,28 +16,28 @@
  */
 package org.apache.geronimo.jetty.deployment;
 
+import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
-import java.io.ByteArrayOutputStream;
 import java.io.ObjectOutputStream;
 import java.net.URI;
 import java.net.URL;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.Set;
-import java.util.Map;
 import java.util.List;
-import javax.management.ObjectName;
+import java.util.Map;
+import java.util.Set;
 import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
 import javax.naming.Reference;
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
-import org.apache.geronimo.deployment.util.UnpackedJarFile;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.util.UnpackedJarFile;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -51,20 +51,19 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty.JettyContainerImpl;
-import org.apache.geronimo.jetty.app.MockWebServiceInvoker;
 import org.apache.geronimo.jetty.connector.HTTPConnector;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
-import org.apache.geronimo.kernel.registry.BasicGBeanRegistry;
+import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.management.State;
+import org.apache.geronimo.kernel.registry.BasicGBeanRegistry;
 import org.apache.geronimo.security.SecurityServiceImpl;
-import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
 
 /**
  * @version $Rev$ $Date$
@@ -125,45 +124,6 @@
         kernel.startRecursiveGBean(configData.getName());
         kernel.stopGBean(configData.getName());
         kernel.unloadGBean(configData.getName());
-    }
-
-    public void testAddEJBWebService() throws Exception {
-        File outputPath = new File(basedir, "target/test-resources/deployables/ejbjar1");
-        recursiveDelete(outputPath);
-        outputPath.mkdirs();
-//        File path = new File(basedir, "src/test-resources/deployables/war4");
-//        UnpackedJarFile jarFile = new UnpackedJarFile(path);
-//        Module module = builder.createModule(null, jarFile);
-        URI id = new URI("ejbjar1");
-        EARContext earContext = createEARContext(outputPath, id);
-        ObjectName containerId = NameFactory.getEjbComponentName(null, null, null, null,
"foo", NameFactory.STATELESS_SESSION_BEAN, moduleContext);
-        builder.addEJBWebService(containerId, "path/to/webservice.ws", "foo", moduleContext,
earContext);
-        GBeanData ejbData = new GBeanData(containerId, MockWebServiceInvoker.GBEAN_INFO);
-        earContext.addGBean(ejbData);
-        earContext.close();
-        GBeanData configData = earContext.getConfigurationGBeanData();
-        configData.setAttribute("baseURL", outputPath.toURL());
-        kernel.loadGBean(configData, cl);
-
-        kernel.startRecursiveGBean(configData.getName());
-        if (((Integer) kernel.getAttribute(configData.getName(), "state")).intValue() !=
State.RUNNING_INDEX) {
-            fail("gbean not started: " + configData.getName());
-        }
-        Set names = kernel.listGBeans(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,WebModule=war4,*"));
-        System.out.println("Object names: " + names);
-        for (Iterator iterator = names.iterator(); iterator.hasNext();) {
-            ObjectName objectName = (ObjectName) iterator.next();
-            assertEquals(new Integer(State.RUNNING_INDEX), kernel.getAttribute(objectName,
"state"));
-        }
-
-        kernel.stopGBean(configData.getName());
-        kernel.unloadGBean(configData.getName());
-
-        kernel.loadGBean(configData, cl);
-        kernel.startRecursiveGBean(configData.getName());
-        kernel.stopGBean(configData.getName());
-        kernel.unloadGBean(configData.getName());
-
     }
 
     private EARContext createEARContext(File outputPath, URI id) throws MalformedObjectNameException,
DeploymentException {

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java?view=diff&r1=151626&r2=151627
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainer.java Sun
Feb  6 14:24:41 2005
@@ -21,6 +21,7 @@
 import org.mortbay.http.HttpListener;
 import org.mortbay.http.UserRealm;
 import org.mortbay.http.RequestLog;
+import org.apache.geronimo.webservices.WebServiceInvoker;
 
 /**
  * @version $Rev$ $Date$
@@ -37,6 +38,11 @@
     void addRealm(UserRealm realm);
 
     void removeRealm(UserRealm realm);
+
+    //TODO these need to be in a separate interface, they need to be called by an ejb container
that doesn't know it this is jetty or tomcat.
+    void addWebService(String contextPath, WebServiceInvoker webServiceInvoker) throws Exception;
+
+    void removeWebService(String contextPath);
 
     void resetStatistics();
 

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java?view=diff&r1=151626&r2=151627
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
Sun Feb  6 14:24:41 2005
@@ -17,6 +17,9 @@
 
 package org.apache.geronimo.jetty;
 
+import java.util.Map;
+import java.util.HashMap;
+
 import org.mortbay.http.HttpContext;
 import org.mortbay.http.HttpListener;
 import org.mortbay.http.RequestLog;
@@ -26,12 +29,14 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.webservices.WebServiceInvoker;
 
 /**
  * @version $Rev$ $Date$
  */
 public class JettyContainerImpl implements JettyContainer, GBeanLifecycle {
     private final Server server;
+    private final Map webServices = new HashMap();
 
     public JettyContainerImpl() {
         server = new JettyServer();
@@ -129,6 +134,18 @@
         server.removeRealm(realm.getName());
     }
 
+    public void addWebService(String contextPath, WebServiceInvoker webServiceInvoker) throws
Exception {
+        JettyWebServiceHandler webServiceHandler = new JettyWebServiceHandler(contextPath,
webServiceInvoker);
+        addContext(webServiceHandler);
+        webServiceHandler.start();
+        webServices.put(contextPath, webServiceHandler);
+    }
+
+    public void removeWebService(String contextPath) {
+        JettyWebServiceHandler webServiceHandler = (JettyWebServiceHandler) webServices.get(contextPath);
+        removeContext(webServiceHandler);
+    }
+
     public void setRequestLog(RequestLog log) {
         server.setRequestLog(log);
     }
@@ -186,6 +203,8 @@
         infoFactory.addOperation("removeContext", new Class[]{HttpContext.class});
         infoFactory.addOperation("addRealm", new Class[]{UserRealm.class});
         infoFactory.addOperation("removeRealm", new Class[]{UserRealm.class});
+        infoFactory.addOperation("addWebService", new Class[]{String.class, WebServiceInvoker.class});
+        infoFactory.addOperation("removeWebService", new Class[]{String.class});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebServiceHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebServiceHandler.java?view=diff&r1=151626&r2=151627
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebServiceHandler.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebServiceHandler.java
Sun Feb  6 14:24:41 2005
@@ -19,11 +19,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 
-import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.webservices.WebServiceInvoker;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.mortbay.http.HttpContext;
 import org.mortbay.http.HttpException;
 import org.mortbay.http.HttpHandler;
@@ -33,18 +29,16 @@
 /**
  * @version $Rev:  $ $Date:  $
  */
-public class JettyWebServiceHandler extends HttpContext implements HttpHandler, GBeanLifecycle
{
+public class JettyWebServiceHandler extends HttpContext implements HttpHandler {
 
     private final String contextPath;
     private final WebServiceInvoker webServiceInvoker;
-    private final JettyContainer jettyContainer;
 
     private HttpContext httpContext;
 
-    public JettyWebServiceHandler(String contextPath, WebServiceInvoker webServiceInvoker,
JettyContainer jettyContainer) {
+    public JettyWebServiceHandler(String contextPath, WebServiceInvoker webServiceInvoker)
{
         this.contextPath = contextPath;
         this.webServiceInvoker = webServiceInvoker;
-        this.jettyContainer = jettyContainer;
     }
 
     public String getName() {
@@ -60,7 +54,7 @@
         this.httpContext = httpContext;
     }
 
-    public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse
response) throws HttpException, IOException {
+    public void handle(HttpRequest request, HttpResponse response) throws HttpException,
IOException {
         response.setContentType("text/xml");
 
         if (request.getParameter("wsdl") != null) {
@@ -76,6 +70,7 @@
         } else {
             try {
                 webServiceInvoker.invoke(request.getInputStream(), response.getOutputStream());
+                request.setHandled(true);
             } catch (IOException e) {
                 throw e;
             } catch (Exception e) {
@@ -87,34 +82,6 @@
 
     public String getContextPath() {
         return contextPath;
-    }
-
-    public void doStart() throws Exception {
-        jettyContainer.addContext(this);
-    }
-
-    public void doStop() throws Exception {
-        jettyContainer.removeContext(this);
-    }
-
-    public void doFail() {
-        jettyContainer.removeContext(this);
-    }
-
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(JettyWebServiceHandler.class,
NameFactory.WEB_MODULE);
-        infoBuilder.addAttribute("contextPath", String.class, true);
-        infoBuilder.addReference("WebServiceInvoker", WebServiceInvoker.class);
-        infoBuilder.addReference("JettyContainer", JettyContainer.class);
-
-        infoBuilder.setConstructor(new String[] {"contextPath", "WebServiceInvoker", "JettyContainer"});
-        GBEAN_INFO = infoBuilder.getBeanInfo();
-    }
-
-    public GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
     }
 
 }

Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java?view=diff&r1=151626&r2=151627
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java (original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/ContainerTest.java Sun
Feb  6 14:24:41 2005
@@ -21,20 +21,26 @@
 import java.net.URL;
 import java.util.HashSet;
 import java.util.Set;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.jetty.connector.HTTPConnector;
+import org.apache.geronimo.jetty.app.MockWebServiceInvoker;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.management.State;
+import org.apache.geronimo.kernel.registry.BasicGBeanRegistry;
+import org.apache.geronimo.webservices.WebServiceInvoker;
 
 /**
  * @version $Rev$ $Date$
  */
 public class ContainerTest extends TestCase {
+    private ClassLoader cl = this.getClass().getClassLoader();
     private Kernel kernel;
-    private GBeanMBean container;
+    private GBeanData container;
     private ObjectName containerName;
     private Set containerPatterns;
     private ObjectName connectorName;
@@ -44,10 +50,10 @@
     }
 
     public void testHTTPConnector() throws Exception {
-        GBeanMBean connector = new GBeanMBean(HTTPConnector.GBEAN_INFO);
+        GBeanData connector = new GBeanData(connectorName, HTTPConnector.GBEAN_INFO);
         connector.setAttribute("port", new Integer(5678));
         connector.setReferencePatterns("JettyContainer", containerPatterns);
-        start(connectorName, connector);
+        start(connector);
 
         assertEquals(new Integer(State.RUNNING_INDEX), kernel.getAttribute(connectorName,
"state"));
 
@@ -63,9 +69,42 @@
         stop(connectorName);
     }
 
-    private void start(ObjectName name, GBeanMBean instance) throws Exception {
-        kernel.loadGBean(name, instance);
-        kernel.startGBean(name);
+    public void testWebServiceHandler() throws Exception {
+        GBeanData connector = new GBeanData(connectorName, HTTPConnector.GBEAN_INFO);
+        connector.setAttribute("port", new Integer(5678));
+        connector.setReferencePatterns("JettyContainer", containerPatterns);
+        start(connector);
+
+        assertEquals(new Integer(State.RUNNING_INDEX), kernel.getAttribute(connectorName,
"state"));
+
+        String contextPath = "/foo/webservice.ws";
+        MockWebServiceInvoker webServiceInvoker = new MockWebServiceInvoker();
+        kernel.invoke(containerName, "addWebService", new Object[] {contextPath, webServiceInvoker},
new String[] {String.class.getName(), WebServiceInvoker.class.getName()});
+
+        HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:5678"
+ contextPath).openConnection();
+        try {
+            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+            assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
+            assertEquals("Hello World", reader.readLine());
+        } finally {
+            connection.disconnect();
+        }
+        kernel.invoke(containerName, "removeWebService", new Object[] {contextPath}, new
String[] {String.class.getName()});
+        connection = (HttpURLConnection) new URL("http://localhost:5678" + contextPath).openConnection();
+        try {
+            connection.getInputStream();
+            fail();
+        } catch (Exception e) {
+            // see if we removed the ws.
+            assertEquals(HttpURLConnection.HTTP_NOT_FOUND, connection.getResponseCode());
+            connection.disconnect();
+        }
+        stop(connectorName);
+    }
+
+    private void start(GBeanData instance) throws Exception {
+        kernel.loadGBean(instance, cl);
+        kernel.startGBean(instance.getName());
     }
 
     private void stop(ObjectName name) throws Exception {
@@ -78,10 +117,10 @@
         containerPatterns = new HashSet();
         containerPatterns.add(containerName);
         connectorName = new ObjectName("geronimo.jetty:role=Connector");
-        kernel = new Kernel("test.kernel", "test");
+        kernel = new Kernel("test.kernel", new BasicGBeanRegistry());
         kernel.boot();
-        container = new GBeanMBean(JettyContainerImpl.GBEAN_INFO);
-        start(containerName, container);
+        container = new GBeanData(containerName, JettyContainerImpl.GBEAN_INFO);
+        start(container);
     }
 
     protected void tearDown() throws Exception {

Copied: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java
(from r151534, geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java?view=diff&rev=151627&p1=geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java&r1=151534&p2=geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java&r2=151627
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java
(original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/app/MockWebServiceInvoker.java
Sun Feb  6 14:24:41 2005
@@ -30,17 +30,11 @@
  */
 public class MockWebServiceInvoker implements WebServiceInvoker {
     public void invoke(InputStream in, OutputStream out) throws Exception {
-
+        out.write("Hello World".getBytes());
     }
 
     public void getWsdl(URI wsdlURi, OutputStream out) throws Exception {
 
     }
 
-    public static final GBeanInfo GBEAN_INFO;
-    static {
-        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(MockWebServiceInvoker.class,
NameFactory.STATELESS_SESSION_BEAN);
-        infoBuilder.addInterface(WebServiceInvoker.class);
-        GBEAN_INFO = infoBuilder.getBeanInfo();
-    }
 }



Mime
View raw message