geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis AbstractTestCase.java AdminClientDeploymentTest.java DynamicEJBDeploymentTest.java EWSTest.java JettyServiceWrapper.java WebServiceDeploymentTest.java WebServiceTest.java AxisGBeanTest.java EchoHeadersTest.java TestServer.java
Date Thu, 22 Jul 2004 14:57:49 GMT
dims        2004/07/22 07:57:49

  Modified:    modules/axis project.properties project.xml
               modules/axis/src/java/org/apache/geronimo/axis
                        AxisGbean.java WebServiceContainer.java
               modules/axis/src/test/org/apache/geronimo/axis
                        AxisGBeanTest.java EchoHeadersTest.java
                        TestServer.java
  Added:       modules/axis maven.xml
               modules/axis/src/java/org/apache/geronimo/axis
                        AxisGeronimoConstants.java AxisGeronimoUtils.java
                        DependancyEJBManager.java
                        GeronimoWsDeployContext.java
                        WebServiceDeployer.java
                        WebServiceDeployerGbean.java
               modules/axis/src/test/org/apache/geronimo/axis
                        AbstractTestCase.java
                        AdminClientDeploymentTest.java
                        DynamicEJBDeploymentTest.java EWSTest.java
                        JettyServiceWrapper.java
                        WebServiceDeploymentTest.java WebServiceTest.java
  Log:
  Cleaned up version of patch submitted by Srinath (http://nagoya.apache.org/jira/browse/GERONIMO-269)
  
  Revision  Changes    Path
  1.2       +3 -2      incubator-geronimo/modules/axis/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/axis/project.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.properties	13 Jul 2004 17:21:55 -0000	1.1
  +++ project.properties	22 Jul 2004 14:57:48 -0000	1.2
  @@ -6,4 +6,5 @@
   
   maven.repo.remote=http://dist.codehaus.org, http://www.ibiblio.org/maven, http://ws.apache.org/~dims/maven
   
  -maven.junit.jvmargs=-Djava.security.auth.login.config=src/test-resources/data/login.config
  \ No newline at end of file
  +maven.junit.jvmargs=-Djava.security.auth.login.config=src/test-resources/data/login.config
  +maven.compile.optimize=false
  \ No newline at end of file
  
  
  
  1.3       +107 -7    incubator-geronimo/modules/axis/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/axis/project.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.xml	18 Jul 2004 21:50:39 -0000	1.2
  +++ project.xml	22 Jul 2004 14:57:48 -0000	1.3
  @@ -6,16 +6,16 @@
       Licensed 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.
   -->
  -
  +  
   
   <!-- $Revision$ $Date$ -->
   
  @@ -61,7 +61,15 @@
               <artifactId>geronimo-kernel</artifactId>
               <version>${pom.currentVersion}</version>
           </dependency>
  -	  <dependency>
  +        <dependency>
  +            <groupId>geronimo</groupId>
  +            <artifactId>geronimo-core</artifactId>
  +            <version>1.0-M1</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
  +        <dependency>
               <groupId>geronimo</groupId>
               <artifactId>geronimo-jetty</artifactId>
               <version>${pom.currentVersion}</version>
  @@ -153,6 +161,11 @@
                   <xmlbeans>true</xmlbeans>
               </properties>
           </dependency>
  +        <dependency>
  +            <groupId>geronimo-spec</groupId>
  +            <artifactId>geronimo-spec-ejb</artifactId>
  +            <version>2.1-rc2</version>
  +        </dependency>
   
           <dependency>
               <groupId>jetty</groupId>
  @@ -171,6 +184,15 @@
               <artifactId>mx4j</artifactId>
               <version>2.0.1</version>
           </dependency>
  +        
  +         <dependency>
  +            <groupId>dom4j</groupId>
  +            <artifactId>dom4j</artifactId>
  +            <version>1.4</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
   
           <!-- these are just needed to run the unit tests -->
           <dependency>
  @@ -254,7 +276,7 @@
               <version>1.0-SNAPSHOT</version>
               <url>http://tranql.codehaus.org</url>
           </dependency>
  -	<dependency>
  +    <dependency>
               <groupId>log4j</groupId>
               <artifactId>log4j</artifactId>
               <version>1.2.8</version>
  @@ -263,6 +285,62 @@
   
           <!-- Module Dependencies -->
           <dependency>
  +            <groupId>ews</groupId>
  +            <artifactId>ews</artifactId>
  +            <version>SNAPSHOT</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
  +        <dependency>
  +            <groupId>jaxb-ri</groupId>
  +            <artifactId>jaxb-api</artifactId>
  +            <version>SNAPSHOT</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
  +        <dependency>
  +            <groupId>jaxb-ri</groupId>
  +            <artifactId>jaxb-impl</artifactId>
  +            <version>SNAPSHOT</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
  +        <dependency>
  +            <groupId>jaxb-ri</groupId>
  +            <artifactId>jaxb-libs</artifactId>
  +            <version>SNAPSHOT</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
  +        <dependency>
  +            <groupId>jaxb-ri</groupId>
  +            <artifactId>namespace</artifactId>
  +            <version>SNAPSHOT</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
  +        <dependency>
  +            <groupId>jaxb-ri</groupId>
  +            <artifactId>relaxngDatatype</artifactId>
  +            <version>SNAPSHOT</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
  +        <dependency>
  +            <groupId>jaxb-ri</groupId>
  +            <artifactId>xsdlib</artifactId>
  +            <version>SNAPSHOT</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
  +        <dependency>
               <groupId>axis</groupId>
               <artifactId>axis</artifactId>
               <version>SNAPSHOT</version>
  @@ -310,7 +388,22 @@
                   <module>true</module>
               </properties>
           </dependency>
  -
  +        <dependency>
  +            <groupId>ant</groupId>
  +            <artifactId>ant</artifactId>
  +            <version>1.5.3-1</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
  +        <dependency>
  +            <groupId>openejb</groupId>
  +            <artifactId>openejb-core-2.0</artifactId>
  +            <version>SNAPSHOT</version>
  +            <properties>
  +                <module>true</module>
  +            </properties>
  +        </dependency>
       </dependencies>
   
   
  @@ -331,6 +424,13 @@
               </includes>
               <excludes>
                   <exclude>**/Abstract*.java</exclude>
  +                <exclude>**/AdminClientDeploymentTest.java</exclude>
  +                <exclude>**/DynamicEJBDeploymentTest.java</exclude>
  +                <exclude>**/EWSTest.java</exclude>
  +                <exclude>**/WebServiceDeploymentTest.java</exclude>
  +                <exclude>**/WebServiceTest.java</exclude>
  +                <exclude>**/AxisGBeanTest.java</exclude>
  +                <exclude>**/EchoHeadersTest.java</exclude>
               </excludes>
               <resources>
                   <resource>
  
  
  
  1.1                  incubator-geronimo/modules/axis/maven.xml
  
  Index: maven.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project default="jar"
      xmlns:j="jelly:core"
      xmlns:maven="jelly:maven"
      xmlns:deploy="deploy"
      xmlns:ant="jelly:ant">
      <goal name="setclasspath">
          <path id="test.classpath">
              <path refid="maven.dependency.classpath"/>
              <pathelement location="${tools.jar}"/>
          </path>
      </goal>
  
      <preGoal name="test:test">
  	    <ant:java classname="org.apache.geronimo.ews.ws4j2ee.utils.PropertyStore" fork="no" >
  		   	<ant:arg value="${maven.repo.local}"/>
    	     	<ant:classpath refid="maven.dependency.classpath"/>
           </ant:java>
          <j:jelly xmlns="jelly:ant">
          <!--
  		<ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/echo"/>
  		<taskdef name="ews" classname="org.apache.geronimo.ews.ws4j2ee.utils.EWSTask">
              <classpath refid="maven.dependency.classpath"/>
          </taskdef>
          -->
          </j:jelly>
      </preGoal> 
  </project>
  
  
  
  1.2       +73 -13    incubator-geronimo/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java
  
  Index: AxisGbean.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AxisGbean.java	13 Jul 2004 17:21:55 -0000	1.1
  +++ AxisGbean.java	22 Jul 2004 14:57:48 -0000	1.2
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2001-2004 The Apache Software Foundation.
  - * 
  + *
    * Licensed 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.
  @@ -25,43 +25,79 @@
   
   import javax.management.ObjectName;
   
  +/**
  + * Class AxisGbean
  + */
   public class AxisGbean implements GBeanLifecycle {
  +
  +    /**
  +     * Field name
  +     */
       private final String name;
  +
  +    /**
  +     * Field kernel
  +     */
       private final Kernel kernel;
  +
  +    /**
  +     * Field GBEAN_INFO
  +     */
       private static final GBeanInfo GBEAN_INFO;
  +
  +    /**
  +     * Field objectName
  +     */
       private final ObjectName objectName;
   
  +    /**
  +     * Field wscontiner
  +     */
       private WebServiceContainer wscontiner;
   
       static {
           GBeanInfoFactory infoFactory = new GBeanInfoFactory("AxisGbean",
                   AxisGbean.class);
  -        //attributes
  +
  +        // attributes
           infoFactory.addAttribute("Name", String.class, true);
           infoFactory.addAttribute("kernel", Kernel.class, false);
           infoFactory.addAttribute("objectName", String.class, false);
  -        //operations
  +
  +        // operations
           infoFactory.addOperation("echo", new Class[]{String.class});
  -        infoFactory.setConstructor(new String[]{"kernel", "Name", "objectName"});
  +        infoFactory.setConstructor(new String[]{"kernel", "Name",
  +                                                "objectName"});
  +
           GBEAN_INFO = infoFactory.getBeanInfo();
       }
   
  +    /**
  +     * Constructor AxisGbean
  +     *
  +     * @param kernel
  +     * @param name
  +     * @param objectName
  +     */
       public AxisGbean(Kernel kernel, String name, String objectName) {
           this.name = name;
           this.kernel = kernel;
           this.objectName = JMXUtil.getObjectName(objectName);
  -        wscontiner = new WebServiceContainer(kernel, this.objectName);
  +        wscontiner = new WebServiceContainer(kernel);
       }
   
  -    /* (non-Javadoc)
  -     * @see org.apache.geronimo.gbean.GBeanLifecycle#doFail()
  +    /**
  +     * Method doFail
        */
       public void doFail() {
           System.out.println("Axis GBean has failed");
       }
   
  -    /* (non-Javadoc)
  -     * @see org.apache.geronimo.gbean.GBeanLifecycle#doStart()
  +    /**
  +     * Method doStart
  +     *
  +     * @throws WaitingException
  +     * @throws Exception
        */
       public void doStart() throws WaitingException, Exception {
           System.out.println("Axis GBean has started");
  @@ -70,26 +106,50 @@
           wscontiner.doStart();
       }
   
  -    /* (non-Javadoc)
  -     * @see org.apache.geronimo.gbean.GBeanLifecycle#doStop()
  +    /**
  +     * Method doStop
  +     *
  +     * @throws WaitingException
  +     * @throws Exception
        */
       public void doStop() throws WaitingException, Exception {
           System.out.println("Axis GBean has stoped");
           wscontiner.doStop();
       }
   
  +    /**
  +     * Method echo
  +     *
  +     * @param msg
  +     * @return
  +     */
       public String echo(String msg) {
           return msg;
       }
   
  +    /**
  +     * Method getGBeanInfo
  +     *
  +     * @return
  +     */
       public static GBeanInfo getGBeanInfo() {
           return GBEAN_INFO;
       }
   
  +    /**
  +     * Method getKernel
  +     *
  +     * @return
  +     */
       public Kernel getKernel() {
           return kernel;
       }
   
  +    /**
  +     * Method getName
  +     *
  +     * @return
  +     */
       public String getName() {
           return name;
       }
  
  
  
  1.4       +161 -60   incubator-geronimo/modules/axis/src/java/org/apache/geronimo/axis/WebServiceContainer.java
  
  Index: WebServiceContainer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/axis/src/java/org/apache/geronimo/axis/WebServiceContainer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WebServiceContainer.java	18 Jul 2004 22:02:01 -0000	1.3
  +++ WebServiceContainer.java	22 Jul 2004 14:57:48 -0000	1.4
  @@ -13,125 +13,226 @@
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
  -
   package org.apache.geronimo.axis;
   
  -import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
   import org.apache.geronimo.gbean.jmx.GBeanMBean;
  -import org.apache.geronimo.jetty.JettyContainerImpl;
   import org.apache.geronimo.jetty.JettyWebAppContext;
  -import org.apache.geronimo.jetty.connector.HTTPConnector;
   import org.apache.geronimo.kernel.Kernel;
  -import org.apache.geronimo.transaction.GeronimoTransactionManager;
   import org.apache.geronimo.transaction.UserTransactionImpl;
  -import org.apache.geronimo.transaction.context.TransactionContextManager;
   
   import javax.management.MBeanServer;
   import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
  +import java.io.File;
  +import java.io.FileInputStream;
  +import java.net.MalformedURLException;
   import java.net.URI;
   import java.net.URL;
  +import java.net.URLClassLoader;
   import java.util.Collections;
  -import java.util.HashSet;
  +import java.util.Enumeration;
  +import java.util.Hashtable;
  +import java.util.Properties;
   import java.util.Set;
  +import java.util.Vector;
   
  +/**
  + * Class WebServiceContainer
  + */
   public class WebServiceContainer {
  -    private final ObjectName axisGBeanName;
  +
  +    /**
  +     * Field kernel
  +     */
       private final Kernel kernel;
  +
  +    /**
  +     * Field containerName
  +     */
       private ObjectName containerName;
  +
  +    /**
  +     * Field mbServer
  +     */
       private MBeanServer mbServer;
  +
  +    /**
  +     * Field containerPatterns
  +     */
       private Set containerPatterns;
  +
  +    /**
  +     * Field tmName
  +     */
       private ObjectName tmName;
  -    private ObjectName tcmName;
  +
  +    /**
  +     * Field tcaName
  +     */
       private ObjectName tcaName;
  +
  +    /**
  +     * Field appName
  +     */
       private ObjectName appName;
  -    private ObjectName connectorName;
  -    private String webappsUrl;
  -    private final boolean startJetty = true;
  -    private GBeanMBean tcm;
   
  -    public WebServiceContainer(Kernel kernel, ObjectName axisGBeanName) {
  +    /**
  +     * Field ejbManager
  +     */
  +    private DependancyEJBManager ejbManager;
  +
  +    /**
  +     * Constructor WebServiceContainer
  +     *
  +     * @param kernel
  +     */
  +    public WebServiceContainer(Kernel kernel) {
           try {
  -            this.axisGBeanName = axisGBeanName;
  -            containerName = new ObjectName("geronimo.jetty:role=Container");
               this.kernel = kernel;
               mbServer = kernel.getMBeanServer();
  +
  +            // get refernace to the Jetty web continer artifacts
  +            // TODO check they are same names for all the time
  +            containerName =
  +                    new ObjectName(AxisGeronimoConstants.WEB_CONTANER_NAME);
               containerPatterns = Collections.singleton(containerName);
  -            connectorName = new ObjectName("geronimo.jetty:role=Connector");
  -            appName = new ObjectName("geronimo.jetty:app=test");
  -            tmName = new ObjectName("geronimo.test:role=TransactionManager");
  -            tcmName = new ObjectName("geronimo.test:role=TransactionContextManager");
  -            tcaName =
  -                    new ObjectName(
  -                            "geronimo.test:role=ConnectionTrackingCoordinator");
  +            appName =
  +                    new ObjectName(AxisGeronimoConstants.APPLICATION_NAME);
  +            tmName =
  +                    new ObjectName(AxisGeronimoConstants.TRANSACTION_MANAGER_NAME);
  +            tcaName = new ObjectName(AxisGeronimoConstants.CONNTECTION_TRACKING_COORDINATOR);
           } catch (MalformedObjectNameException e) {
               e.printStackTrace();
  +
               throw new RuntimeException(e);
           }
       }
   
  +    /**
  +     * Method init
  +     */
       public void init() {
       }
   
  +    /**
  +     * Method doStart
  +     *
  +     * @throws Exception
  +     */
       public void doStart() throws Exception {
  -        if (startJetty)
  -            startJetty();
  -        URL url = Thread.currentThread().getContextClassLoader().getResource(
  -                "deployables/axis/");
  -        GBeanMBean app = new GBeanMBean(JettyWebAppContext.GBEAN_INFO);
  -        app.setAttribute("uri", URI.create(url.toString()));
  +        ejbManager = new DependancyEJBManager(kernel);
  +
  +        File axisPopertiesfile =
  +                new File(new File(AxisGeronimoConstants.AXIS_CONFIG_STORE),
  +                        "axis.properties");
  +        Properties axisProperties = new Properties();
  +
  +        if (axisPopertiesfile.exists()) {
  +            axisProperties.load(new FileInputStream(axisPopertiesfile));
  +        } else {
  +            axisPopertiesfile.getParentFile().mkdirs();
  +            axisPopertiesfile.createNewFile();
  +        }
  +
  +        // TODO deployed webservices should be stored in the local config store
  +        // This is a hack till it is found out how to do it
  +        ClassLoader myCl =
  +                new URLClassLoader(loadDeployedWebservices(axisProperties));
  +
  +        // Start the EJB's that depend on the webservices
  +        ejbManager.startDependancies(axisProperties);
  +
  +        GBeanMBean app = new GBeanMBean(JettyWebAppContext.GBEAN_INFO, myCl);
  +        URL url =
  +                Thread.currentThread().getContextClassLoader().getResource("deployables/axis/");
  +
  +        app.setAttribute("URI", URI.create(url.toString()));
           app.setAttribute("contextPath", "/axis");
           app.setAttribute("componentContext", null);
  +
           UserTransactionImpl userTransaction = new UserTransactionImpl();
  +
           app.setAttribute("userTransaction", userTransaction);
           app.setReferencePatterns("Configuration", Collections.EMPTY_SET);
           app.setReferencePatterns("JettyContainer", containerPatterns);
  -        app.setReferencePatterns("TransactionContextManager",
  -                Collections.singleton(tcmName));
  +        app.setReferencePatterns("TransactionManager",
  +                Collections.singleton(tmName));
           app.setReferencePatterns("TrackedConnectionAssociator",
                   Collections.singleton(tcaName));
  +
  +        // TODO add a dependancy to such that to this service to started the
  +        // jetty must have been started
           start(appName, app);
       }
   
  +    /**
  +     * Method doStop
  +     *
  +     * @throws Exception
  +     */
       public void doStop() throws Exception {
  -        stop(tcaName);
  -        stop(tcmName);
  -        stop(connectorName);
  -        stop(containerName);
  -    }
  -
  -    private void startJetty() throws Exception {
  -        GBeanMBean connector;
  -        GBeanMBean tm;
  -        GBeanMBean ctc;
  -        GBeanMBean container;
  -        container = new GBeanMBean(JettyContainerImpl.GBEAN_INFO);
  -        connector = new GBeanMBean(HTTPConnector.GBEAN_INFO);
  -        connector.setAttribute("port", new Integer(5678));
  -        connector.setReferencePatterns("JettyContainer", containerPatterns);
  -        start(containerName, container);
  -        start(connectorName, connector);
  -        tm = new GBeanMBean(GeronimoTransactionManager.GBEAN_INFO);
  -        Set patterns = new HashSet();
  -        patterns.add(
  -                ObjectName.getInstance(
  -                        "geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
  -        tm.setReferencePatterns("ResourceManagers", patterns);
  -        start(tmName, tm);
  -        tcm = new GBeanMBean(TransactionContextManager.GBEAN_INFO);
  -        tcm.setReferencePattern("TransactionManager", tmName);
  -        start(tcmName, tcm);
  -        ctc = new GBeanMBean(ConnectionTrackingCoordinator.GBEAN_INFO);
  -        start(tcaName, ctc);
       }
   
  +    /**
  +     * Method start
  +     *
  +     * @param name
  +     * @param instance
  +     * @throws Exception
  +     */
       private void start(ObjectName name, Object instance) throws Exception {
           mbServer.registerMBean(instance, name);
           mbServer.invoke(name, "start", null, null);
       }
   
  +    /**
  +     * Method stop
  +     *
  +     * @param name
  +     * @throws Exception
  +     */
       private void stop(ObjectName name) throws Exception {
           mbServer.invoke(name, "stop", null, null);
           mbServer.unregisterMBean(name);
  +    }
  +
  +    /**
  +     * Method loadDeployedWebservices
  +     *
  +     * @param properties
  +     * @return
  +     * @throws MalformedURLException
  +     */
  +    public URL[] loadDeployedWebservices(Hashtable properties)
  +            throws MalformedURLException {
  +        if (properties == null) {
  +            return new URL[0];
  +        }
  +
  +        Vector urls = new Vector();
  +        Enumeration enu = properties.keys();
  +        File configStroe =
  +                new File(AxisGeronimoConstants.AXIS_CONFIG_STORE);
  +
  +        while (enu.hasMoreElements()) {
  +            File libfile = new File(configStroe, enu.nextElement().toString());
  +            if (libfile.exists()) {
  +                File[] jars = libfile.listFiles();
  +                if (jars != null) {
  +                    for (int i = 0; i < jars.length; i++) {
  +                        if (jars[i].getAbsolutePath().endsWith(".jar")) {
  +                            urls.add(jars[i].toURL());
  +                        }
  +                    }
  +                }
  +            }
  +        }
  +
  +        URL[] urlList = new URL[urls.size()];
  +        for (int i = 0; i < urls.size(); i++) {
  +            urlList[i] = (URL) urls.get(i);
  +            System.out.println(urlList[i]);
  +        }
  +        return urlList;
       }
   }
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoConstants.java
  
  Index: AxisGeronimoConstants.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   *
   * Licensed 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.geronimo.axis;
  
  /**
   * Class AxisGeronimoConstants
   */
  public class AxisGeronimoConstants {
  
      /**
       * Field J2EE_DOMAIN_NAME
       */
      public static final String J2EE_DOMAIN_NAME = "openejb.server";
  
      /**
       * Field J2EE_SERVER_NAME
       */
      public static final String J2EE_SERVER_NAME = "TestOpenEJBServer";
  
      /**
       * Field WEB_CONTANER_NAME
       */
      public static final String WEB_CONTANER_NAME =
              "geronimo.jetty:role=Container";
  
      /**
       * Field WEB_CONNECTOR_NAME
       */
      public static final String WEB_CONNECTOR_NAME =
              "geronimo.jetty:role=Connector";
  
      /**
       * Field APPLICATION_NAME
       */
      public static final String APPLICATION_NAME = "geronimo.jetty:app=test";
  
      /**
       * Field TRANSACTION_MANAGER_NAME
       */
      public static final String TRANSACTION_MANAGER_NAME =
              "geronimo.test:role=TransactionManager";
  
      /**
       * Field CONNTECTION_TRACKING_COORDINATOR
       */
      public static final String CONNTECTION_TRACKING_COORDINATOR =
              "geronimo.test:role=ConnectionTrackingCoordinator";
  
      /**
       * Field AXIS_CONFIG_STORE
       */
      public static final String AXIS_CONFIG_STORE = "target/config-store";
  
      /**
       * Field TEMP_OUTPUT
       */
      public static final String TEMP_OUTPUT = "target/temp";
  
      /**
       * Field AXIS_SERVICE_PORT
       */
      public static final int AXIS_SERVICE_PORT = 5678;
  }
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java
  
  Index: AxisGeronimoUtils.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   *
   * Licensed 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.geronimo.axis;
  
  import org.apache.geronimo.deployment.DeploymentException;
  import org.apache.geronimo.gbean.jmx.GBeanMBean;
  import org.apache.geronimo.kernel.Kernel;
  
  import javax.management.ObjectName;
  import java.io.File;
  
  /**
   * Class AxisGeronimoUtils
   */
  public class AxisGeronimoUtils {
      /**
       * Method startGBean
       *
       * @param objectName
       * @param gbean
       * @param kernel
       * @throws DeploymentException
       */
      public static void startGBean(ObjectName objectName, GBeanMBean gbean, Kernel kernel)
              throws DeploymentException {
          try {
              kernel.loadGBean(objectName, gbean);
              kernel.startGBean(objectName);
          } catch (Exception e) {
              throw new DeploymentException(e);
          }
      }
  
      /**
       * Method stopGBean
       *
       * @param objectName
       * @param kernel
       * @throws DeploymentException
       */
      public static void stopGBean(ObjectName objectName, Kernel kernel)
              throws DeploymentException {
          try {
              kernel.unloadGBean(objectName);
              kernel.stopGBean(objectName);
          } catch (Exception e) {
              throw new DeploymentException(e);
          }
      }
  
      /**
       * Method delete
       *
       * @param file
       */
      public static void delete(File file) {
          if (file.isFile()) {
              file.delete();
          } else {
              File[] files = file.listFiles();
  
              if (files != null) {
                  for (int i = 0; i < files.length; i++) {
                      delete(files[i]);
                  }
              }
              file.delete();
          }
      }
  }
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/java/org/apache/geronimo/axis/DependancyEJBManager.java
  
  Index: DependancyEJBManager.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   *
   * Licensed 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.geronimo.axis;
  
  import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
  import org.apache.geronimo.deployment.DeploymentException;
  import org.apache.geronimo.gbean.GBeanInfo;
  import org.apache.geronimo.gbean.jmx.GBeanMBean;
  import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
  import org.apache.geronimo.kernel.Kernel;
  import org.apache.geronimo.kernel.config.Configuration;
  import org.apache.geronimo.kernel.jmx.JMXUtil;
  import org.apache.geronimo.system.serverinfo.ServerInfo;
  import org.apache.geronimo.transaction.GeronimoTransactionManager;
  import org.openejb.ContainerIndex;
  
  import javax.management.MalformedObjectNameException;
  import javax.management.ObjectName;
  import java.io.BufferedInputStream;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.InputStream;
  import java.io.ObjectInputStream;
  import java.util.Collections;
  import java.util.Enumeration;
  import java.util.HashSet;
  import java.util.Hashtable;
  import java.util.Set;
  import java.util.Vector;
  
  /**
   * Class DependancyEJBManager
   */
  public class DependancyEJBManager {
  
      /**
       * Field j2eeServerObjectName
       */
      private ObjectName j2eeServerObjectName;
  
      /**
       * Field j2eeDomainName
       */
      private static final String j2eeDomainName =
              AxisGeronimoConstants.J2EE_DOMAIN_NAME;
  
      /**
       * Field j2eeServerName
       */
      private static final String j2eeServerName =
              AxisGeronimoConstants.J2EE_SERVER_NAME;
  
      /**
       * Field transactionManagerObjectName
       */
      private static final ObjectName transactionManagerObjectName =
              JMXUtil.getObjectName(j2eeDomainName + ":type=TransactionManager");
  
      /**
       * Field connectionTrackerObjectName
       */
      private static final ObjectName connectionTrackerObjectName =
              JMXUtil.getObjectName(j2eeDomainName + ":type=ConnectionTracker");
  
      /**
       * Field containerIndexObjectName
       */
      private ObjectName containerIndexObjectName;
  
      /**
       * Field serverInfoObjectName
       */
      private ObjectName serverInfoObjectName;
  
      /**
       * Field configStore
       */
      private File configStore;
  
      /**
       * Field dependedEJBs
       */
      private Vector dependedEJBs;
  
      /**
       * Field kernel
       */
      private final Kernel kernel;
  
      /**
       * Constructor DependancyEJBManager
       *
       * @param kernel
       */
      public DependancyEJBManager(Kernel kernel) {
          this.kernel = kernel;
          configStore = new File(AxisGeronimoConstants.AXIS_CONFIG_STORE);
          dependedEJBs = new Vector();
      }
  
      /**
       * Method startDependancies
       *
       * @param properites
       * @throws MalformedObjectNameException
       * @throws DeploymentException
       */
      public void startDependancies(Hashtable properites)
              throws MalformedObjectNameException, DeploymentException {
          startJ2EEServer();
          startContainerIndex();
  
          Enumeration enu = properites.keys();
  
          while (enu.hasMoreElements()) {
              String dir = (String) enu.nextElement();
              String serviceName = (String) properites.get(dir);
  
              startDependancy(dir, serviceName);
          }
      }
  
      /**
       * Method stopDependancies
       *
       * @throws DeploymentException
       */
      public void stopDependancies() throws DeploymentException {
          // stop strated ejbs
          for (int i = 0; i < dependedEJBs.size(); i++) {
              AxisGeronimoUtils.stopGBean((ObjectName) dependedEJBs.get(i),
                      kernel);
          }
  
          // stop the continer Index
          stopContainerIndex();
  
          // stop the j2ee server
          stopJ2EEServer();
      }
  
      /**
       * Method startDependancy
       *
       * @param outDir
       * @param service
       * @throws DeploymentException
       */
      private void startDependancy(String outDir, String service)
              throws DeploymentException {
          try {
              File unpackedDir = new File(configStore, outDir);
  
              // load the configuration
              GBeanMBean config = loadConfig(unpackedDir);
              ObjectName objectName = ObjectName.getInstance("test:configuration="
                      + service);
  
              dependedEJBs.add(objectName);
              kernel.loadGBean(objectName, config);
              config.setAttribute("baseURL", unpackedDir.toURL());
  
              // start the configuration
              kernel.startRecursiveGBean(objectName);
          } catch (Exception e) {
              throw new DeploymentException(e);
          }
      }
  
      /**
       * Method startContainerIndex
       *
       * @throws DeploymentException
       * @throws MalformedObjectNameException
       */
      private void startContainerIndex()
              throws DeploymentException, MalformedObjectNameException {
          GBeanMBean containerIndexGBean =
                  new GBeanMBean(ContainerIndex.GBEAN_INFO);
  
          containerIndexObjectName = ObjectName.getInstance(j2eeDomainName
                  + ":type=ContainerIndex");
  
          Set ejbContainerNames = new HashSet();
  
          ejbContainerNames.add(ObjectName.getInstance(j2eeDomainName
                  + ":j2eeType=StatelessSessionBean,*"));
          ejbContainerNames.add(ObjectName.getInstance(j2eeDomainName
                  + ":j2eeType=StatefulSessionBean,*"));
          ejbContainerNames.add(ObjectName.getInstance(j2eeDomainName
                  + ":j2eeType=EntityBean,*"));
          containerIndexGBean.setReferencePatterns("EJBContainers",
                  ejbContainerNames);
          AxisGeronimoUtils.startGBean(containerIndexObjectName,
                  containerIndexGBean, kernel);
      }
  
      /**
       * Method stopCantainerIndex
       *
       * @throws DeploymentException
       */
      private void stopContainerIndex() throws DeploymentException {
          AxisGeronimoUtils.stopGBean(containerIndexObjectName, kernel);
      }
  
      /**
       * Method startJ2EEServer
       *
       * @throws DeploymentException
       */
      private void startJ2EEServer() throws DeploymentException {
          try {
              String str =
                      System.getProperty(javax.naming.Context.URL_PKG_PREFIXES);
  
              if (str == null) {
                  str = ":org.apache.geronimo.naming";
              } else {
                  str = str + ":org.apache.geronimo.naming";
              }
  
              System.setProperty(javax.naming.Context.URL_PKG_PREFIXES, str);
  
              GBeanMBean serverInfoGBean = new GBeanMBean(ServerInfo.GBEAN_INFO);
  
              serverInfoGBean.setAttribute("baseDirectory", ".");
  
              this.serverInfoObjectName = ObjectName.getInstance(j2eeDomainName
                      + ":type=ServerInfo");
  
              AxisGeronimoUtils.startGBean(serverInfoObjectName, serverInfoGBean,
                      kernel);
  
              GBeanMBean j2eeServerGBean =
                      new GBeanMBean(J2EEServerImpl.GBEAN_INFO);
  
              j2eeServerGBean.setReferencePatterns("ServerInfo", Collections.singleton(serverInfoObjectName));
  
              this.j2eeServerObjectName = ObjectName.getInstance(j2eeDomainName
                      + ":j2eeType=J2EEServer,name=" + j2eeServerName);
  
              AxisGeronimoUtils.startGBean(j2eeServerObjectName, j2eeServerGBean,
                      kernel);
  
              GBeanMBean tmGBean =
                      new GBeanMBean(GeronimoTransactionManager.GBEAN_INFO);
              Set patterns = new HashSet();
  
              patterns.add(ObjectName.getInstance("geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
              patterns.add(ObjectName.getInstance("geronimo.server:j2eeType=ActivationSpec,*"));
              tmGBean.setReferencePatterns("resourceManagers", patterns);
              AxisGeronimoUtils.startGBean(transactionManagerObjectName, tmGBean,
                      kernel);
  
              GBeanMBean connectionTrackerGBean =
                      new GBeanMBean(ConnectionTrackingCoordinator.GBEAN_INFO);
              ObjectName connectionTrackerObjectName =
                      ObjectName.getInstance(j2eeDomainName
                      + ":type=ConnectionTracker");
  
              AxisGeronimoUtils.startGBean(connectionTrackerObjectName,
                      connectionTrackerGBean, kernel);
  
              // //load mock resource adapter for mdb
              // DeploymentHelper.setUpResourceAdapter(kernel);
          } catch (Exception e) {
              throw new DeploymentException(e);
          }
      }
  
      /**
       * Method stopJ2EEServer
       *
       * @throws DeploymentException
       */
      private void stopJ2EEServer() throws DeploymentException {
          AxisGeronimoUtils.stopGBean(serverInfoObjectName, kernel);
          AxisGeronimoUtils.stopGBean(j2eeServerObjectName, kernel);
          AxisGeronimoUtils.stopGBean(transactionManagerObjectName, kernel);
          AxisGeronimoUtils.stopGBean(connectionTrackerObjectName, kernel);
      }
  
      /**
       * Method loadConfig
       *
       * @param unpackedCar
       * @return
       * @throws Exception
       */
      private GBeanMBean loadConfig(File unpackedCar) throws Exception {
          InputStream in = new FileInputStream(new File(unpackedCar,
                  "META-INF/config.ser"));
  
          try {
              ObjectInputStream ois =
                      new ObjectInputStream(new BufferedInputStream(in));
              GBeanInfo gbeanInfo = Configuration.GBEAN_INFO;
              GBeanMBean config = new GBeanMBean(gbeanInfo);
  
              Configuration.loadGMBeanState(config, ois);
              return config;
          } finally {
              in.close();
          }
      }
  }
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/java/org/apache/geronimo/axis/GeronimoWsDeployContext.java
  
  Index: GeronimoWsDeployContext.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   *
   * Licensed 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.geronimo.axis;
  
  import org.apache.axis.wsdl.fromJava.Emitter;
  import org.apache.geronimo.ews.ws4j2ee.toWs.GenerationConstants;
  import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2eeDeployContext;
  import org.apache.geronimo.ews.ws4j2ee.utils.packager.load.PackageModule;
  import org.apache.geronimo.ews.ws4j2ee.utils.packager.load.PackageModuleFactory;
  
  /**
   * Class GeronimoWsDeployContext
   */
  public class GeronimoWsDeployContext implements Ws4J2eeDeployContext {
  
      /**
       * Field module
       */
      private PackageModule module;
  
      /**
       * Field moduleLocation
       */
      private String moduleLocation;
  
      /**
       * Field outputLocation
       */
      private String outputLocation;
  
      /**
       * Constructor GeronimoWsDeployContext
       *
       * @param moduleLocation
       * @param outputLocation
       */
      public GeronimoWsDeployContext(String moduleLocation,
                                     String outputLocation) {
          module =
                  PackageModuleFactory.createPackageModule(moduleLocation, true);
          this.moduleLocation = moduleLocation;
          this.outputLocation = outputLocation;
      }
  
      /**
       * Method getMode
       *
       * @return
       */
      public int getMode() {
          return Emitter.MODE_ALL;
      }
  
      /**
       * Method getWsdlImplFilename
       *
       * @return
       */
      public String getWsdlImplFilename() {
          return null;
      }
  
      /**
       * Method getModule
       *
       * @return
       */
      public PackageModule getModule() {
          return module;
      }
  
      /**
       * Method getModuleLocation
       *
       * @return
       */
      public String getModuleLocation() {
          return moduleLocation;
      }
  
      /**
       * Method getContanier
       *
       * @return
       */
      public String getContanier() {
          return GenerationConstants.GERONIMO_CONTAINER;
      }
  
      /**
       * Method getImplStyle
       *
       * @return
       */
      public String getImplStyle() {
          return GenerationConstants.USE_INTERNALS;
      }
  
      /**
       * Method getOutPutLocation
       *
       * @return
       */
      public String getOutPutLocation() {
          return outputLocation;
      }
  }
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/java/org/apache/geronimo/axis/WebServiceDeployer.java
  
  Index: WebServiceDeployer.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   *
   * Licensed 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.geronimo.axis;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.apache.geronimo.deployment.DeploymentException;
  import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2ee;
  import org.apache.geronimo.ews.ws4j2ee.utils.packager.load.PackageModule;
  import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
  import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
  import org.apache.geronimo.kernel.Kernel;
  import org.apache.geronimo.kernel.jmx.JMXUtil;
  import org.apache.geronimo.system.configuration.LocalConfigStore;
  import org.apache.xmlbeans.XmlObject;
  import org.openejb.deployment.OpenEJBModuleBuilder;
  
  import javax.management.ObjectName;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.FileOutputStream;
  import java.io.IOException;
  import java.net.URL;
  import java.net.URLClassLoader;
  import java.util.Properties;
  
  /**
   * Class WebServiceDeployer
   */
  public class WebServiceDeployer {
  
      /**
       * Field log
       */
      protected final Log log = LogFactory.getLog(getClass());
  
      /**
       * Field j2eeDomainName
       */
      private static final String j2eeDomainName =
              AxisGeronimoConstants.J2EE_DOMAIN_NAME;
  
      /**
       * Field j2eeServerName
       */
      private static final String j2eeServerName =
              AxisGeronimoConstants.J2EE_SERVER_NAME;
  
      /**
       * Field transactionManagerObjectName
       */
      private static final ObjectName transactionManagerObjectName =
              JMXUtil.getObjectName(j2eeDomainName + ":type=TransactionManager");
  
      /**
       * Field connectionTrackerObjectName
       */
      private static final ObjectName connectionTrackerObjectName =
              JMXUtil.getObjectName(j2eeDomainName + ":type=ConnectionTracker");
  
      /**
       * Field j2eeModuleName
       */
      private String j2eeModuleName;
  
      /**
       * Field module
       */
      private String module;
  
      /**
       * Field kernel
       */
      private final Kernel kernel;
  
      /**
       * Field axisProperties
       */
      private Properties axisProperties;
  
      /**
       * Field outDir
       */
      private String outDir;
  
      /**
       * Field properites
       */
      private Properties properites;
  
      /**
       * Field configStore
       */
      private final File configStore;
  
      /**
       * Field tempOutDir
       */
      private String tempOutDir;
  
      /**
       * Field hasEJB
       */
      private boolean hasEJB = true;
  
      /**
       * Constructor WebServiceDeployer
       *
       * @param tempOutDir
       * @param kernel
       */
      public WebServiceDeployer(String tempOutDir, Kernel kernel) {
          this.tempOutDir = tempOutDir;
          this.kernel = kernel;
          axisProperties = new Properties();
          properites = new Properties();
  
          log.info("start deployer with the "
                  + AxisGeronimoConstants.AXIS_CONFIG_STORE
                  + " as the config store.");
  
          configStore = new File(AxisGeronimoConstants.AXIS_CONFIG_STORE);
      }
  
      /**
       * Method deploy
       *
       * @param module
       * @param j2eeApplicationName
       * @param j2eeModuleName
       * @throws Exception
       */
      public void deploy(String module, String j2eeApplicationName, String j2eeModuleName)
              throws Exception {
          this.j2eeModuleName = j2eeModuleName;
          this.module = module;
  
          log.info("start deploymwnt with the " + this.module + ".");
  
          GeronimoWsDeployContext deployContext =
                  new GeronimoWsDeployContext(module, tempOutDir + "/server");
          Ws4J2ee ws4j2ee = new Ws4J2ee(deployContext,
                  null);
  
          ws4j2ee.generate();
          log.info("ews code generation done.");
  
          PackageModule packageModule = deployContext.getModule();
  
          if (packageModule.getEjbJarfile() != null) {
              this.hasEJB = true;
  
              System.out.println("the web service is based on a ejb.");
              log.info("the web service is based on a ejb.");
          } else if (packageModule.getWebddfile() != null) {
              this.hasEJB = false;
  
              System.out.println("the web service is based on a java class.");
              log.info("the web service is based on a java class.");
          } else {
              throw new DeploymentException("the module must have web.xml or ejb-jar.xml file");
          }
  
          File file = findTheImpl();
  
          deployTheWebService(file);
      }
  
      /**
       * Method loadPropertyFiles
       *
       * @throws FileNotFoundException
       * @throws IOException
       */
      public void loadPropertyFiles() throws FileNotFoundException, IOException {
          File popertiesfile = new File(configStore, "index.properties");
          int index = 1;
  
          if (popertiesfile.exists()) {
              properites.load(new FileInputStream(popertiesfile));
  
              while (properites.containsValue(String.valueOf(index))) {
                  index++;
              }
          } else {
              popertiesfile.getParentFile().mkdirs();
              popertiesfile.createNewFile();
          }
  
          outDir = String.valueOf(index);
  
          File axisPopertiesfile = new File(configStore, "axis.properties");
  
          if (axisPopertiesfile.exists()) {
              axisProperties.load(new FileInputStream(axisPopertiesfile));
          } else {
              axisPopertiesfile.createNewFile();
          }
      }
  
      /**
       * Method storeProperties
       *
       * @throws FileNotFoundException
       * @throws IOException
       */
      public void storeProperties() throws FileNotFoundException, IOException {
          File popertiesfile = new File(configStore, "index.properties");
  
          properites.store(new FileOutputStream(popertiesfile),
                  "ws configuration");
  
          File axispopertiesfile = new File(configStore, "axis.properties");
  
          axisProperties.store(new FileOutputStream(axispopertiesfile),
                  "ws configuration");
      }
  
      /**
       * Method deployTheWebService
       *
       * @param earFile
       * @throws DeploymentException
       */
      public void deployTheWebService(File earFile) throws DeploymentException {
          File unpackedDir = null;
  
          try {
              loadPropertyFiles();
              properites.setProperty(j2eeModuleName, outDir);
              axisProperties.setProperty(outDir, j2eeModuleName);
  
              unpackedDir = new File(configStore, outDir);
  
              unpackedDir.mkdirs();
  
              if (hasEJB) {
                  deployEJB(earFile, unpackedDir);
              } else {
                  File out = new File(unpackedDir, earFile.getName());
  
                  copyTheFile(earFile, out);
              }
          } catch (Exception e) {
  
              // if something goes wrong make sure nothing leaves in a middle
              // state
              if (unpackedDir != null) {
                  AxisGeronimoUtils.delete(unpackedDir);
              }
  
              throw new DeploymentException(e);
          }
      }
  
      /**
       * Method deployEJB
       *
       * @param earFile
       * @param unpackedDir
       * @throws DeploymentException
       */
      private void deployEJB(File earFile, File unpackedDir)
              throws DeploymentException {
          try {
              ModuleBuilder moduleBuilder = new OpenEJBModuleBuilder(kernel);
              ClassLoader oldCl =
                      Thread.currentThread().getContextClassLoader();
              ClassLoader cl =
                      new URLClassLoader(new URL[]{earFile.toURL()}, oldCl);
  
              Thread.currentThread().setContextClassLoader(cl);
  
              File carFile = File.createTempFile("OpenEJBTest", ".car");
  
              try {
                  EARConfigBuilder earConfigBuilder = new EARConfigBuilder(new ObjectName(j2eeDomainName + ":j2eeType=J2EEServer,name="
                          + j2eeServerName), transactionManagerObjectName,
                          connectionTrackerObjectName, null, null,
                          null, moduleBuilder, null, null, null);
                  XmlObject plan =
                          earConfigBuilder.getDeploymentPlan(earFile.toURL());
  
                  earConfigBuilder.buildConfiguration(carFile, null, earFile,
                          plan);
                  LocalConfigStore.unpack(unpackedDir,
                          new FileInputStream(carFile));
  
                  // store the property IFF all goes well
                  storeProperties();
              } finally {
                  carFile.delete();
              }
          } catch (Exception e) {
              throw new DeploymentException(e);
          }
      }
  
      /**
       * Method findTheImpl
       *
       * @return
       */
      private File findTheImpl() {
          File outDir = new File(tempOutDir + "/server");
  
          if (outDir.isDirectory()) {
              File[] files = outDir.listFiles();
  
              if (files != null) {
                  for (int i = 0; i < files.length; i++) {
                      if (files[i].getAbsolutePath().endsWith(".jar")) {
                          return files[i];
                      }
                  }
              }
          }
  
          throw new RuntimeException("implementation jar not found");
      }
  
      /**
       * Method copyTheFile
       *
       * @param inFile
       * @param outFile
       * @throws IOException
       */
      private void copyTheFile(File inFile, File outFile) throws IOException {
          FileOutputStream out = new FileOutputStream(outFile);
          FileInputStream in = new FileInputStream(inFile);
  
          try {
              byte[] buf = new byte[1024];
              int val = in.read(buf);
  
              while (val > 0) {
                  out.write(buf, 0, val);
  
                  val = in.read(buf);
              }
          } finally {
              in.close();
              out.close();
          }
      }
  }
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/java/org/apache/geronimo/axis/WebServiceDeployerGbean.java
  
  Index: WebServiceDeployerGbean.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   *
   * Licensed 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.geronimo.axis;
  
  import org.apache.geronimo.gbean.GBeanInfo;
  import org.apache.geronimo.gbean.GBeanInfoFactory;
  import org.apache.geronimo.gbean.GBeanLifecycle;
  import org.apache.geronimo.gbean.WaitingException;
  import org.apache.geronimo.kernel.Kernel;
  
  /**
   * Class WebServiceDeployerGbean
   */
  public class WebServiceDeployerGbean implements GBeanLifecycle {
  
      /**
       * Field name
       */
      private final String name;
  
      /**
       * Field kernel
       */
      private final Kernel kernel;
  
      /**
       * Field GBEAN_INFO
       */
      private static final GBeanInfo GBEAN_INFO;
  
      /**
       * Field wsdeployer
       */
      private WebServiceDeployer wsdeployer;
  
      static {
          GBeanInfoFactory infoFactory =
                  new GBeanInfoFactory("WebServiceDeployerGbean",
                          WebServiceDeployerGbean.class);
  
          // attributes
          infoFactory.addAttribute("Name", String.class, true);
          infoFactory.addAttribute("kernel", Kernel.class, false);
          infoFactory.addAttribute("objectName", String.class, false);
  
          // operations
          infoFactory.addOperation("deploy", new Class[]{String.class,
                                                         String.class,
                                                         String.class});
          infoFactory.setConstructor(new String[]{"kernel", "Name",
                                                  "objectName"});
  
          GBEAN_INFO = infoFactory.getBeanInfo();
      }
  
      /**
       * Constructor WebServiceDeployerGbean
       *
       * @param kernel
       * @param name
       */
      public WebServiceDeployerGbean(Kernel kernel, String name) {
          this.name = name;
          this.kernel = kernel;
      }
  
      /*
       * (non-Javadoc)
       * @see org.apache.geronimo.gbean.GBeanLifecycle#doFail()
       */
  
      /**
       * Method doFail
       */
      public void doFail() {
          System.out.println("WebServiceDeployerGbean has failed");
      }
  
      /*
       * (non-Javadoc)
       * @see org.apache.geronimo.gbean.GBeanLifecycle#doStart()
       */
  
      /**
       * Method doStart
       *
       * @throws WaitingException
       * @throws Exception
       */
      public void doStart() throws WaitingException, Exception {
  
          System.out.println("WebServiceDeployerGbean has started");
  
          wsdeployer = new WebServiceDeployer(AxisGeronimoConstants.TEMP_OUTPUT,
                  kernel);
      }
  
      /*
       * (non-Javadoc)
       * @see org.apache.geronimo.gbean.GBeanLifecycle#doStop()
       */
  
      /**
       * Method doStop
       *
       * @throws WaitingException
       * @throws Exception
       */
      public void doStop() throws WaitingException, Exception {
          System.out.println("WebServiceDeployerGbean has stoped");
      }
  
      /**
       * Method deploy
       *
       * @param module
       * @param j2eeApplicationName
       * @param j2eeModuleName
       * @throws Exception
       */
      public void deploy(String module, String j2eeApplicationName, String j2eeModuleName)
              throws Exception {
          wsdeployer.deploy(module, j2eeApplicationName, j2eeModuleName);
      }
  
      /**
       * Method getGBeanInfo
       *
       * @return
       */
      public static GBeanInfo getGBeanInfo() {
          return GBEAN_INFO;
      }
  
      /**
       * Method getKernel
       *
       * @return
       */
      public Kernel getKernel() {
          return kernel;
      }
  
      /**
       * Method getName
       *
       * @return
       */
      public String getName() {
          return name;
      }
  }
  
  
  
  1.2       +13 -5     incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java
  
  Index: AxisGBeanTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AxisGBeanTest.java	13 Jul 2004 17:21:55 -0000	1.1
  +++ AxisGBeanTest.java	22 Jul 2004 14:57:49 -0000	1.2
  @@ -15,7 +15,6 @@
    */
   package org.apache.geronimo.axis;
   
  -import junit.framework.TestCase;
   import org.apache.geronimo.gbean.jmx.GBeanMBean;
   import org.apache.geronimo.kernel.Kernel;
   
  @@ -26,13 +25,20 @@
   import java.net.URL;
   import java.net.URLClassLoader;
   
  -public class AxisGBeanTest extends TestCase {
  +public class AxisGBeanTest extends AbstractTestCase {
       private ObjectName name;
  -    private ObjectName name2;
       private Kernel kernel;
  +    private JettyServiceWrapper jettyService;
  +
  +    /**
  +     * @param testName
  +     */
  +    public AxisGBeanTest(String testName) {
  +        super(testName);
  +    }
   
       public void testLoad() throws Exception {
  -        String textFileurl = "http://localhost:5678/axis/index.html";
  +        String textFileurl = "http://localhost:"+AxisGeronimoConstants.AXIS_SERVICE_PORT+"/axis/index.html";
           ClassLoader cl = getClass().getClassLoader();
           ClassLoader myCl = new URLClassLoader(new URL[0], cl);
           GBeanMBean gbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl);
  @@ -60,12 +66,14 @@
   
       protected void setUp() throws Exception {
           name = new ObjectName("test:name=AxisGBean");
  -        name2 = new ObjectName("test:name=AxisGBean2");
           kernel = new Kernel("test.kernel", "test");
           kernel.boot();
  +		jettyService = new JettyServiceWrapper(kernel);
  +		jettyService.doStart();
       }
   
       protected void tearDown() throws Exception {
  +		jettyService.doStop();
           kernel.shutdown();
       }
   }
  
  
  
  1.2       +19 -15    incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/EchoHeadersTest.java
  
  Index: EchoHeadersTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/EchoHeadersTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EchoHeadersTest.java	13 Jul 2004 18:52:49 -0000	1.1
  +++ EchoHeadersTest.java	22 Jul 2004 14:57:49 -0000	1.2
  @@ -15,21 +15,13 @@
    */
   package org.apache.geronimo.axis;
   
  -import junit.framework.TestCase;
  -import org.apache.geronimo.gbean.jmx.GBeanMBean;
  -import org.apache.geronimo.kernel.Kernel;
  -
  -import javax.management.ObjectName;
  -import java.io.BufferedReader;
  -import java.io.InputStreamReader;
  -import java.io.File;
  -import java.net.HttpURLConnection;
  -import java.net.URL;
  -import java.net.URLClassLoader;
   import org.apache.axis.AxisEngine;
   import org.apache.axis.client.Call;
   import org.apache.axis.client.Service;
  +import org.apache.geronimo.gbean.jmx.GBeanMBean;
  +import org.apache.geronimo.kernel.Kernel;
   
  +import javax.management.ObjectName;
   import javax.xml.messaging.URLEndpoint;
   import javax.xml.soap.MessageFactory;
   import javax.xml.soap.Name;
  @@ -40,20 +32,31 @@
   import javax.xml.soap.SOAPElement;
   import javax.xml.soap.SOAPEnvelope;
   import javax.xml.soap.SOAPMessage;
  +import java.net.URL;
  +import java.net.URLClassLoader;
   
   
  -public class EchoHeadersTest extends TestCase {
  +public class EchoHeadersTest extends AbstractTestCase {
       private ObjectName name;
  -    private ObjectName name2;
       private Kernel kernel;
       private Call call = null;
  +    private JettyServiceWrapper jettyService;
  +
  +    /**
  +     * @param testName
  +     */
  +    public EchoHeadersTest(String testName) {
  +        super(testName);
  +    }
   
       protected void setUp() throws Exception {
           name = new ObjectName("test:name=AxisGBean");
  -        name2 = new ObjectName("test:name=AxisGBean2");
           kernel = new Kernel("test.kernel", "test");
           kernel.boot();
   
  +		jettyService = new JettyServiceWrapper(kernel);
  +		jettyService.doStart();
  +
           ClassLoader cl = getClass().getClassLoader();
           ClassLoader myCl = new URLClassLoader(new URL[]{}, cl);
           GBeanMBean gbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl);
  @@ -146,8 +149,9 @@
       }
       
       protected void tearDown() throws Exception {
  -        kernel.stopGBean(name);
  +		kernel.stopGBean(name);
           kernel.unloadGBean(name);
  +		jettyService.doStop();
           kernel.shutdown();
       }
   }
  
  
  
  1.2       +6 -4      incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/TestServer.java
  
  Index: TestServer.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/TestServer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestServer.java	13 Jul 2004 17:21:55 -0000	1.1
  +++ TestServer.java	22 Jul 2004 14:57:49 -0000	1.2
  @@ -27,12 +27,16 @@
   public class TestServer {
       private Kernel kernel;
       private ObjectName name;
  +	private JettyServiceWrapper jettyService;
   
       public TestServer() throws Exception {
           name = new ObjectName("test:name=AxisGBean");
           kernel = new Kernel("test.kernel", "test");
           kernel.boot();
   
  +		jettyService = new JettyServiceWrapper(kernel);
  +		jettyService.doStart();
  +
           ClassLoader cl = getClass().getClassLoader();
           ClassLoader myCl = new URLClassLoader(new URL[0], cl);
           GBeanMBean gbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl);
  @@ -43,11 +47,9 @@
           System.out.println("Shutting down the kernel");
           kernel.stopGBean(name);
           kernel.unloadGBean(name);
  +        
  +		jettyService.doStop();
           kernel.shutdown();
  -    }
  -
  -    public static void main(String[] args) throws Exception {
  -        TestServer test = new TestServer();
       }
   
       /* (non-Javadoc)
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/AbstractTestCase.java
  
  Index: AbstractTestCase.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed 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.geronimo.axis;
  
  import junit.framework.TestCase;
  
  import java.io.File;
  
  /**
   * Abstract base class for test cases.
   */
  public abstract class AbstractTestCase
  	extends TestCase 
  {
  	protected String testDir = "src/test/";
  	protected String sampleDir = "src/samples/";
  	protected String outDir = "target/generated/samples/";
  	protected String tempDir = "target/generated/temp";
  	/** 
  	 * Basedir for all file I/O. Important when running tests from
  	 * the reactor.
  	 */
  	public String basedir = System.getProperty("basedir");
      
  	/**
  	 * Constructor.
  	 */
  	public AbstractTestCase(String testName)
  	{
  		super(testName);
  		if(basedir == null){
  			basedir = new File(".").getAbsolutePath();
  			if(!(basedir.endsWith("axis")
  				||basedir.endsWith("axis\\")
  				||basedir.endsWith("axis/"))){
  				basedir = new File("./modules/axis").getAbsolutePath();
  			}
  		}
  		testDir = new File(basedir,testDir).getAbsolutePath();
  		sampleDir = new File(basedir,sampleDir).getAbsolutePath();
  		outDir = new File(basedir,outDir).getAbsolutePath();
  		tempDir = new File(basedir,tempDir).getAbsolutePath();
  	}
      
  	/**
  	 * Get test input file.
  	 *
  	 * @param path Path to test input file.
  	 */
  	public String getTestFile(String path)
  	{
  		return new File(basedir,path).getAbsolutePath();
  	}
  }
  
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/AdminClientDeploymentTest.java
  
  Index: AdminClientDeploymentTest.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed 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.geronimo.axis;
  
  import org.apache.axis.AxisEngine;
  import org.apache.axis.MessageContext;
  import org.apache.axis.deployment.wsdd.WSDDDeployment;
  import org.apache.axis.deployment.wsdd.WSDDDocument;
  import org.apache.axis.encoding.SerializationContextImpl;
  import org.apache.axis.server.AxisServer;
  import org.apache.axis.utils.Admin;
  import org.apache.axis.utils.XMLUtils;
  import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2ee;
  import org.apache.geronimo.gbean.jmx.GBeanMBean;
  import org.apache.geronimo.kernel.Kernel;
  import org.w3c.dom.Document;
  
  import javax.management.ObjectName;
  import java.io.File;
  import java.io.InputStream;
  import java.io.PrintWriter;
  import java.net.URL;
  import java.net.URLClassLoader;
  
  public class AdminClientDeploymentTest extends AbstractTestCase {
      private ObjectName name;
      private Kernel kernel;
      private JettyServiceWrapper jettyService;
  
      /**
       * @param testName
       */
      public AdminClientDeploymentTest(String testName) {
          super(testName);
      }
  
  	public void testDeployWithAdminClient() throws Exception{
  		File jarFile =  new File(outDir + "/echo-ewsimpl.jar");
  		if(!jarFile.exists()){
  			GeronimoWsDeployContext deployContext =
  				 new GeronimoWsDeployContext(
  					 getTestFile("target/samples/echo.jar"),
  					 outDir);
  			Ws4J2ee ws4j2ee = new Ws4J2ee(deployContext, null);
  					ws4j2ee.generate();
  		}
  		
  		URLClassLoader cl = new  URLClassLoader(new URL[]{jarFile.toURL()});
  		InputStream deplydd = cl.getResourceAsStream("deploy.wsdd");
  		assertNotNull(deplydd);  
  
  
  //		AdminClient adminClient = new AdminClient();
  //		URL requestUrl = new URL("http://localhost:"
  //			 +AxisGeronimConstants.AXIS_SERVICE_PORT
  //			 +"/axis/services/AdminService");
  //		Call call = adminClient.getCall();
  //		call.setTargetEndpointAddress(requestUrl);
  //		String result = adminClient.process(null,deplydd);
  //		System.out.println(result);
  
  		Admin admin = new Admin();
  		InputStream wsddconf = getClass().getClassLoader().getResourceAsStream("org/apache/axis/server/server-config.wsdd");
  		assertNotNull(wsddconf);
  		WSDDDocument wsddDoc = new WSDDDocument(XMLUtils.newDocument(wsddconf));
  		WSDDDeployment deployment = wsddDoc.getDeployment();
  		AxisEngine engine = new AxisServer(deployment);
  		engine.setShouldSaveConfig(true);
  		engine.init();
  		MessageContext msgContext = new MessageContext(engine);
  
  		Document doc = XMLUtils.newDocument(deplydd);
  		Document result = admin.process(msgContext, doc.getDocumentElement());
  		System.out.println(XMLUtils.DocumentToString(result));
  		PrintWriter w = new PrintWriter(System.out);
  		deployment.writeToContext(new SerializationContextImpl(w));
  		w.close();
     	}
  
  
      protected void setUp() throws Exception {
  		new File(outDir).mkdirs();
          name = new ObjectName("test:name=AxisGBean");
          kernel = new Kernel("test.kernel", "test");
          kernel.boot();
  		jettyService = new JettyServiceWrapper(kernel);
  		jettyService.doStart();
  		ClassLoader cl = getClass().getClassLoader();
  		ClassLoader myCl = new URLClassLoader(new URL[0], cl);
  		GBeanMBean gbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl);
  		gbean.setAttribute("Name", "Test");
  		kernel.loadGBean(name, gbean);
  		kernel.startGBean(name);
      }
  
      protected void tearDown() throws Exception {
  		kernel.stopGBean(name);
  		kernel.unloadGBean(name);
  		jettyService.doStop();
          kernel.shutdown();
      }
  }
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/DynamicEJBDeploymentTest.java
  
  Index: DynamicEJBDeploymentTest.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed 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.geronimo.axis;
  
  import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
  import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2ee;
  import org.apache.geronimo.gbean.jmx.GBeanMBean;
  import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
  import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
  import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
  import org.apache.geronimo.kernel.Kernel;
  import org.apache.geronimo.kernel.jmx.JMXUtil;
  import org.apache.geronimo.kernel.management.State;
  import org.apache.geronimo.system.configuration.LocalConfigStore;
  import org.apache.geronimo.system.serverinfo.ServerInfo;
  import org.apache.geronimo.transaction.GeronimoTransactionManager;
  import org.apache.xmlbeans.XmlObject;
  import org.openejb.deployment.OpenEJBModuleBuilder;
  
  import javax.management.ObjectName;
  import java.io.File;
  import java.io.FileInputStream;
  import java.net.URL;
  import java.net.URLClassLoader;
  import java.util.Collections;
  import java.util.HashSet;
  import java.util.Set;
  
  public class DynamicEJBDeploymentTest extends AbstractTestCase{
  	private static final String j2eeDomainName = "openejb.server";
  	private static final String j2eeServerName = "TestOpenEJBServer";
  	private static final ObjectName transactionManagerObjectName = JMXUtil.getObjectName(j2eeDomainName + ":type=TransactionManager");
  	private static final ObjectName connectionTrackerObjectName = JMXUtil.getObjectName(j2eeDomainName + ":type=ConnectionTracker");
  	private Kernel kernel;
  
      /**
       * @param testName
       */
      public DynamicEJBDeploymentTest(String testName) {
          super(testName);
      }
  
  	protected void setUp() throws Exception {
  		super.setUp();
  		String str = System.getProperty(javax.naming.Context.URL_PKG_PREFIXES);
  		if (str == null) {
  			str = ":org.apache.geronimo.naming";
  		} else {
  			str = str + ":org.apache.geronimo.naming";
  		}
  		System.setProperty(javax.naming.Context.URL_PKG_PREFIXES, str);
  		kernel = new Kernel("blah");
  		kernel.boot();
  
  		GBeanMBean serverInfoGBean = new GBeanMBean(ServerInfo.GBEAN_INFO);
  		serverInfoGBean.setAttribute("baseDirectory", ".");
  		ObjectName serverInfoObjectName = ObjectName.getInstance(j2eeDomainName + ":type=ServerInfo");
  		kernel.loadGBean(serverInfoObjectName, serverInfoGBean);
  		kernel.startGBean(serverInfoObjectName);
  		assertRunning(kernel, serverInfoObjectName);
  
  		GBeanMBean j2eeServerGBean = new GBeanMBean(J2EEServerImpl.GBEAN_INFO);
  		j2eeServerGBean.setReferencePatterns("ServerInfo", Collections.singleton(serverInfoObjectName));
  		ObjectName j2eeServerObjectName = ObjectName.getInstance(j2eeDomainName + ":j2eeType=J2EEServer,name=" + j2eeServerName);
  		kernel.loadGBean(j2eeServerObjectName, j2eeServerGBean);
  		kernel.startGBean(j2eeServerObjectName);
  		assertRunning(kernel, j2eeServerObjectName);
  
  		GBeanMBean tmGBean = new GBeanMBean(GeronimoTransactionManager.GBEAN_INFO);
  		Set patterns = new HashSet();
  		patterns.add(ObjectName.getInstance("geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
  		patterns.add(ObjectName.getInstance("geronimo.server:j2eeType=ActivationSpec,*"));
  		tmGBean.setReferencePatterns("resourceManagers", patterns);
  		kernel.loadGBean(transactionManagerObjectName, tmGBean);
  		kernel.startGBean(transactionManagerObjectName);
  		assertRunning(kernel, transactionManagerObjectName);
  
  		GBeanMBean connectionTrackerGBean = new GBeanMBean(ConnectionTrackingCoordinator.GBEAN_INFO);
  		ObjectName connectionTrackerObjectName = ObjectName.getInstance(j2eeDomainName + ":type=ConnectionTracker");
  		kernel.loadGBean(connectionTrackerObjectName, connectionTrackerGBean);
  		kernel.startGBean(connectionTrackerObjectName);
  		assertRunning(kernel, connectionTrackerObjectName);
  
  		//load mock resource adapter for mdb
  //		DeploymentHelper.setUpResourceAdapter(kernel);
  
  	}
  	public void testEJBJarDeploy() throws Exception {
  		ModuleBuilder moduleBuilder = new OpenEJBModuleBuilder(kernel);
  	
  		File earFile =  new File(outDir + "/echo-ewsimpl.jar");
  		if(!earFile.exists()){
  			GeronimoWsDeployContext deployContext =
  				 new GeronimoWsDeployContext(
  					 getTestFile("target/samples/echo.jar"),
  					 outDir);
  			Ws4J2ee ws4j2ee = new Ws4J2ee(deployContext, null);
  					ws4j2ee.generate();
  		}
  	
  	
  		ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
  		ClassLoader cl = new URLClassLoader(new URL[]{earFile.toURL()}, oldCl);
  	
  		Thread.currentThread().setContextClassLoader(cl);
  	
  		File carFile = File.createTempFile("OpenEJBTest", ".car");
  		try {
  
              EARConfigBuilder earConfigBuilder =
                      new EARConfigBuilder(new ObjectName(j2eeDomainName + ":j2eeType=J2EEServer,name=" + j2eeServerName),
                              transactionManagerObjectName,
                              connectionTrackerObjectName,
                              null,
                              null,
                              null,
                              moduleBuilder,
                              null,
                              null,
                              null);
  
  			XmlObject plan = earConfigBuilder.getDeploymentPlan(earFile.toURL());
  			earConfigBuilder.buildConfiguration(carFile, null, earFile, plan);
  			File unpackedDir = new File(tempDir, "OpenEJBTest-ear-Unpacked");
  			LocalConfigStore.unpack(unpackedDir, new FileInputStream(carFile));
  		} finally {
  			carFile.delete();
  		}
  	}
  
  
  	protected void tearDown() throws Exception {
  		kernel.stopGBean(connectionTrackerObjectName);
  		kernel.stopGBean(transactionManagerObjectName);
  		kernel.shutdown();
  	}
  	private void assertRunning(Kernel kernel, ObjectName objectName) throws Exception {
  		int state = ((Integer) kernel.getAttribute(objectName, "state")).intValue();
  		assertEquals(State.RUNNING_INDEX, state);
  	}
  
  
  }
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/EWSTest.java
  
  Index: EWSTest.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed 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.geronimo.axis;
  
  import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2ee;
  
  import java.io.File;
  
  public class EWSTest extends AbstractTestCase {
      /**
       * @param testName
       */
      public EWSTest(String testName) {
          super(testName);
      }
  
      public void testEcho() throws Exception {
          System.out.println(new File(".").getAbsolutePath());
          GeronimoWsDeployContext deployContext =
              new GeronimoWsDeployContext(
                  getTestFile("target/samples/echo.jar"),
                  outDir);
          Ws4J2ee ws4j2ee = new Ws4J2ee(deployContext, null);
          ws4j2ee.generate();
      }
  
      protected void setUp() throws Exception {
          new File(outDir).mkdirs();
      }
  
      protected void tearDown() throws Exception {
      }
  
  }
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/JettyServiceWrapper.java
  
  Index: JettyServiceWrapper.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed 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.geronimo.axis;
  
  import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
  import org.apache.geronimo.gbean.jmx.GBeanMBean;
  import org.apache.geronimo.jetty.JettyContainerImpl;
  import org.apache.geronimo.jetty.connector.HTTPConnector;
  import org.apache.geronimo.kernel.Kernel;
  import org.apache.geronimo.transaction.GeronimoTransactionManager;
  
  import javax.management.MBeanServer;
  import javax.management.MalformedObjectNameException;
  import javax.management.ObjectName;
  import java.util.Collections;
  import java.util.HashSet;
  import java.util.Set;
  
  /**
   * @author hemapani@opensource.lk
   */
  public class JettyServiceWrapper {
  	private ObjectName containerName;
  	private Set containerPatterns;
  	private ObjectName tmName;
  	private ObjectName tcaName;
  	private ObjectName connectorName;
  	
  	private final MBeanServer mbServer;
  	
  	public JettyServiceWrapper(Kernel kernel)throws MalformedObjectNameException{
              this.mbServer = kernel.getMBeanServer();
              
              containerName = new ObjectName(AxisGeronimoConstants.WEB_CONTANER_NAME);
              containerPatterns = Collections.singleton(containerName);
              connectorName = new ObjectName(AxisGeronimoConstants.WEB_CONNECTOR_NAME);
              tmName = new ObjectName(AxisGeronimoConstants.TRANSACTION_MANAGER_NAME);
              tcaName = 
              	new ObjectName(AxisGeronimoConstants.CONNTECTION_TRACKING_COORDINATOR);
  	}
  
  	public void doStart() throws Exception {
  		GBeanMBean connector;
  		GBeanMBean tm;
  		GBeanMBean ctc;
  		GBeanMBean container;
  		container = new GBeanMBean(JettyContainerImpl.GBEAN_INFO);
  		connector = new GBeanMBean(HTTPConnector.GBEAN_INFO);
  		connector.setAttribute("port", new Integer(AxisGeronimoConstants.AXIS_SERVICE_PORT));
  		connector.setReferencePatterns("JettyContainer", containerPatterns);
  		start(containerName, container);
  		start(connectorName, connector);
  		tm = new GBeanMBean(GeronimoTransactionManager.GBEAN_INFO);
  		Set patterns = new HashSet();
  		patterns.add(
  				ObjectName.getInstance(
  						"geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
  		tm.setReferencePatterns("resourceManagers", patterns);
  		start(tmName, tm);
  		ctc = new GBeanMBean(ConnectionTrackingCoordinator.GBEAN_INFO);
  		start(tcaName, ctc);
  	}
  	
  	public void doStop() throws Exception{
  		stop(tcaName);
  		stop(tmName);
  		stop(connectorName);
  		stop(containerName);
  	}
  	
  	
  	private void start(ObjectName name, Object instance) throws Exception {
  		 mbServer.registerMBean(instance, name);
  		 mbServer.invoke(name, "start", null, null);
  	 }
  
  	 private void stop(ObjectName name) throws Exception {
  		 mbServer.invoke(name, "stop", null, null);
  		 mbServer.unregisterMBean(name);
  	 }
  
  }
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/WebServiceDeploymentTest.java
  
  Index: WebServiceDeploymentTest.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed 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.geronimo.axis;
  
  import org.apache.geronimo.kernel.Kernel;
  
  import java.io.File;
  
  /**
   * @author hemapani@opensource.lk
   */
  public class WebServiceDeploymentTest extends AbstractTestCase{
  	private Kernel kernel;
  	public WebServiceDeploymentTest(String name){
  		super(name);
  	}
  
  	protected void setUp() throws Exception {
  		kernel = new Kernel("test.kernel", "test");
  		kernel.boot();
  		File file = new File(tempDir);
  		file.getParentFile().mkdirs();
  	}
  
  	protected void tearDown() throws Exception {
  		kernel.shutdown();
  		File file = new File(tempDir);
  		AxisGeronimoUtils.delete(file);
  	}
      
     
      
      public void testDeployEJB() throws Exception{
  		WebServiceDeployer deployer 
  			= new WebServiceDeployer(tempDir,kernel);
  		deployer.deploy(getTestFile("target/samples/echo.jar"),
  				null,
  				"ws/apache/axis/test2");
      }
  }
  
  
  
  1.1                  incubator-geronimo/modules/axis/src/test/org/apache/geronimo/axis/WebServiceTest.java
  
  Index: WebServiceTest.java
  ===================================================================
  /*
   * Copyright 2001-2004 The Apache Software Foundation.
   * 
   * Licensed 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.geronimo.axis;
  
  import org.apache.geronimo.ews.ws4j2ee.wsutils.GeronimoUtils;
  import org.apache.geronimo.gbean.jmx.GBeanMBean;
  import org.apache.geronimo.kernel.Kernel;
  
  import javax.management.ObjectName;
  import java.io.File;
  import java.net.URL;
  import java.net.URLClassLoader;
  import java.util.Arrays;
  
  public class WebServiceTest extends AbstractTestCase {
      private ObjectName axisname;
      private ObjectName deployGbeanName;
      private Kernel kernel;
      private JettyServiceWrapper jettyService;
  
      /**
       * @param testName
       */
      public WebServiceTest(String testName) {
          super(testName);
      }
  
      public void testLoad() throws Exception {
          ClassLoader cl = getClass().getClassLoader();
  		ClassLoader myCl = null;
          
  		URL toolsURL = null;
          String tools = System.getProperty("java.home");
  			   
  		if (tools != null) {
  		   File f = new File(tools,"./../lib/tools.jar");
  		   System.out.println("tools.jar is "+f.getAbsolutePath());
  		   if (f.exists()) {
  			    toolsURL = f.toURL();
  			    myCl =  new URLClassLoader(new URL[]{toolsURL}, cl);
  		   }
  		}   
  		
          GBeanMBean deploygbean =
              new GBeanMBean(WebServiceDeployerGbean.getGBeanInfo(), myCl);
          kernel.loadGBean(deployGbeanName, deploygbean);
          kernel.startGBean(deployGbeanName);
          System.out.println(
              kernel.getMBeanServer().getAttribute(deployGbeanName, "state"));
          kernel.getMBeanServer().invoke(
              deployGbeanName,
              "deploy",
              new Object[] {
                  getTestFile("target/samples/echo.jar"),
                  null,
                  "ws/apache/axis/echo" },
              new String[] {
                  String.class.getName(),
                  String.class.getName(),
                  String.class.getName()});
          kernel.stopGBean(deployGbeanName);
          kernel.unloadGBean(deployGbeanName);
  
          //axis gbean        
          GBeanMBean axisgbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl);
          kernel.loadGBean(axisname, axisgbean);
          kernel.startGBean(axisname);
  
          //invoke the ejb just in the same way it is invoked by the webservice 
          String msg = "Hi Hello";
          String result =
              (String) GeronimoUtils.invokeEJB(
                  "echo",
                  "echoString",
                  new Class[] { String.class },
                  new Object[] { msg });
          System.out.println(result);
          assertEquals(msg, result);
  
          GeronimoUtils.invokeEJB("echo", "echoVoid", new Class[] {
          }, new Object[] {
          });
  
          int valInt = 2345;
          Integer intObj =
              (Integer) GeronimoUtils.invokeEJB(
                  "echo",
                  "echoInt",
                  null,
                  new Object[] { new Integer(valInt)});
          assertEquals(valInt, intObj.intValue());
  
          double valDouble = 2425.57;
          Double doubleObj =
              (Double) GeronimoUtils.invokeEJB(
                  "echo",
                  "echoDouble",
                  null,
                  new Object[] { new Double(valDouble)});
          assertEquals(valDouble, doubleObj.doubleValue(), 3);
  
          float valfloat = 2425.57f;
          Float floatObj =
              (Float) GeronimoUtils.invokeEJB(
                  "echo",
                  "echoFloat",
                  null,
                  new Object[] { new Float(valfloat)});
          assertEquals(valfloat, floatObj.doubleValue(), 3);
  
          boolean valBoolean = true;
          Boolean booleanObj =
              (Boolean) GeronimoUtils.invokeEJB(
                  "echo",
                  "echoBoolean",
                  null,
                  new Object[] { new Boolean(valBoolean)});
          assertEquals(valBoolean, booleanObj.booleanValue());
  
          long valLong = 2425573566l;
          Long longObj =
              (Long) GeronimoUtils.invokeEJB(
                  "echo",
                  "echoLong",
                  null,
                  new Object[] { new Long(valLong)});
          assertEquals(valLong, longObj.longValue());
  
          short valShort = 242;
          Short shortObj =
              (Short) GeronimoUtils.invokeEJB(
                  "echo",
                  "echoShort",
                  null,
                  new Object[] { new Short(valShort)});
          assertEquals(valShort, shortObj.shortValue());
  
          byte[] byteVal = "Hi Hello".getBytes();
          byte[] byteValreturn =
              (byte[]) GeronimoUtils.invokeEJB(
                  "echo",
                  "echoBytes",
                  new Class[] { byte[].class },
                  new Object[] { byteVal });
          assertTrue(Arrays.equals(byteVal,byteValreturn));
          kernel.stopGBean(axisname);
          kernel.unloadGBean(axisname);
  
      }
  
      protected void setUp() throws Exception {
  		File file = new File(AxisGeronimoConstants.AXIS_CONFIG_STORE);
          axisname = new ObjectName("test:name=AxisGBean");
          deployGbeanName = new ObjectName("test:name=WebServiceDeployerGbean");
          kernel = new Kernel("test.kernel", "test");
          kernel.boot();
          jettyService = new JettyServiceWrapper(kernel);
          jettyService.doStart();
          file.getParentFile().mkdirs();
      }
  
      protected void tearDown() throws Exception {
          jettyService.doStop();
          kernel.shutdown();
          File file = new File(AxisGeronimoConstants.AXIS_CONFIG_STORE);
          AxisGeronimoUtils.delete(file);
      }
  
  }
  
  
  

Mime
View raw message