You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by he...@apache.org on 2004/11/22 09:23:12 UTC

svn commit: r106167 - in geronimo/trunk/modules/axis/src: java/org/apache/geronimo/axis test/org/apache/geronimo/axis test/org/apache/geronimo/axis/preconditions test/org/apache/geronimo/axis/testUtils

Author: hemapani
Date: Mon Nov 22 00:23:11 2004
New Revision: 106167

Added:
   geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSPlan.java   (contents, props changed)
Removed:
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/J2EEManagerTest.java
Modified:
   geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java
   geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java
   geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java
   geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoProvider.java
   geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoWsDeployContext.java
   geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java
   geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java
   geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSDDJavaGeronimoProvider.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractTestCase.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/ComplexTypeWebServiceTest.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/EchoHeadersTest.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/PlansTest.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimpleEJBWebServiceTest.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimplePOJOWebServiceTest.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/AdminClientDeploymentTest.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/EWSTest.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManager.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManagerTest.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java
   geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java
Log:
1) clean the code form author tags, system.outs and if()action; type codes \n2)fix the WS configuration builder to suit the ConfigurationBuilder interface \n3) the EJB deployment is take out of the WS module, the user of the Axis deployment should deploy the ejb if there is one and provider the name of the ejb configuration

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java&r1=106166&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java	(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java	Mon Nov 22 00:23:11 2004
@@ -27,7 +27,7 @@
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 
 /**
- * Class AxisGbean
+ *  @version $Rev$ $Date$
  */
 public class AxisGbean implements GBeanLifecycle {
     private static Log log = LogFactory.getLog(AxisGbean.class);

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java&r1=106166&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java	(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGeronimoUtils.java	Mon Nov 22 00:23:11 2004
@@ -32,7 +32,9 @@
 import org.openejb.EJBContainer;
 
 import javax.ejb.EJBHome;
+import javax.management.AttributeNotFoundException;
 import javax.management.ObjectName;
+import javax.management.ReflectionException;
 
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
@@ -43,6 +45,7 @@
 import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
+import java.io.OutputStream;
 import java.lang.reflect.Method;
 import java.net.URI;
 import java.net.URL;
@@ -51,8 +54,6 @@
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.jar.JarOutputStream;
 import java.util.zip.ZipEntry;
@@ -60,7 +61,7 @@
 import java.util.zip.ZipFile;
 
 /**
- * Class AxisGeronimoUtils
+ * @version $Rev$ $Date$
  */
 public class AxisGeronimoUtils {
     public static final int AXIS_SERVICE_PORT = 5678;
@@ -119,11 +120,12 @@
             }
             throw new AxisFault("Dependancy ejb " + ejbName + " not found ");
         } catch (Throwable e) {
-            e.printStackTrace();
-            if (e instanceof Exception)
-                throw AxisFault.makeFault((Exception) e);
-            else
+            if (e instanceof Exception){
+                throw AxisFault.makeFault((Exception) e);                
+            }else{
                 throw AxisFault.makeFault(new Exception(e));
+            }
+
         }
     }
 
@@ -146,6 +148,12 @@
         }
     }
 
+    /**
+     * @param objectName
+     * @param gbean
+     * @param kernel
+     * @throws DeploymentException
+     */
     public static void startGBeanOnlyIfNotStarted(ObjectName objectName, GBeanMBean gbean, Kernel kernel)
             throws DeploymentException {
         try {
@@ -202,6 +210,11 @@
         }
     }
 
+    /**
+     * 
+     * @param file
+     * @return
+     */
     public static ArrayList getClassFileList(ZipFile file) {
         ArrayList list = new ArrayList();
         if (file != null) {
@@ -219,7 +232,12 @@
         }
         return list;
     }
-
+    /**
+     * 
+     * @param name
+     * @param kernel
+     * @return
+     */
     public static boolean checkAlreadyStarted(ObjectName name, Kernel kernel) {
         Set set = kernel.listGBeans(name);
         log.info(name + " = " + set);
@@ -231,6 +249,13 @@
         return true;
     }
 
+    /**
+     * 
+     * @param module
+     * @param classloader
+     * @throws ZipException
+     * @throws IOException
+     */
     public static void registerClassLoader(ZipFile module, ClassLoader classloader) throws ZipException, IOException {
         ArrayList classList = AxisGeronimoUtils.getClassFileList(module);
         for (int i = 0; i < classList.size(); i++) {
@@ -262,15 +287,28 @@
         } catch (DeploymentException e) {
             throw e;
         } catch (Exception e) {
-            e.printStackTrace();
             throw new DeploymentException(e);
         }
     }
 
+    /**
+     * 
+     * @param file
+     * @return
+     * @throws MalformedURLException
+     */
     public static URL getURL(String file) throws MalformedURLException {
         URL requestUrl = new URL("http", NetworkUtils.getLocalHostname(), AXIS_SERVICE_PORT, file);
         return requestUrl;
     }
+    
+    /**
+     * 
+     * @param config
+     * @param store
+     * @return
+     * @throws Exception
+     */
     public static URI saveConfiguration(GBeanMBean config, ConfigurationStore store)throws Exception{
         File sourceFile = null;
         try {
@@ -292,6 +330,35 @@
         }
     }
     
+    public static void createConfiguration(URI id,byte[] state,File unpackedDir) throws AttributeNotFoundException, ReflectionException, IOException{
+        GBeanMBean config = new GBeanMBean(Configuration.GBEAN_INFO);
+        config.setAttribute("ID", id);
+        config.setReferencePatterns("Parent", null);
+        config.setAttribute("classPath", Collections.EMPTY_LIST);
+        config.setAttribute("gBeanState", state);
+        config.setAttribute("dependencies", Collections.EMPTY_LIST);
+                    
+        try {
+            File confSer = new File(unpackedDir,"META-INF/config.ser");
+            confSer.getParentFile().mkdirs();
+            confSer.createNewFile();
+            OutputStream fos = new FileOutputStream(confSer);
+            ObjectOutputStream oos = new ObjectOutputStream(fos);
+            config.getGBeanData().writeExternal(oos);
+            oos.flush();
+            fos.close();
+        } finally {
+            
+        }
+    }
+    
+    
+    /**
+     * 
+     * @param unpackedCar
+     * @return
+     * @throws Exception
+     */
     public static GBeanMBean loadConfig(File unpackedCar) throws Exception {
         InputStream in = new FileInputStream(new File(unpackedCar, "META-INF/config.ser"));
         try {
@@ -303,5 +370,27 @@
             in.close();
         }
     }
+    
+    /**
+     * 
+     * @param state
+     * @param id
+     * @param store
+     * @return
+     * @throws Exception
+     */
+    
+    public static URI saveAsConfiguration(byte[] state,URI id, ConfigurationStore store) throws Exception{
+        //create a configuraton with Web Service GBean
+        
+        GBeanMBean config = new GBeanMBean(Configuration.GBEAN_INFO);
+        config.setAttribute("ID", id);
+        config.setReferencePatterns("Parent", null);
+        config.setAttribute("classPath", Collections.EMPTY_LIST);
+        config.setAttribute("gBeanState", state);
+        config.setAttribute("dependencies", Collections.EMPTY_LIST);
 
+        //store the Web Service Configuration
+        return AxisGeronimoUtils.saveConfiguration(config,store);
+    }
 }

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java&r1=106166&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java	(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java	Mon Nov 22 00:23:11 2004
@@ -27,11 +27,12 @@
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 
 import javax.management.ObjectName;
+
 import java.util.Collection;
 import java.util.Iterator;
 
 /**
- * Class AxisGbean
+ * @version $Rev: $ $Date: $
  */
 public class EJBWSGBean implements GBeanLifecycle {
     private static Log log = LogFactory.getLog(EJBWSGBean.class);
@@ -56,14 +57,15 @@
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("EJBWSGBean",
                 EJBWSGBean.class);
 
+
         // attributes
         infoFactory.addAttribute("Name", String.class, true);
         infoFactory.addAttribute("objectName", String.class, false);
-        infoFactory.addAttribute("classList", Collection.class, true);
         infoFactory.addReference("ejbConfig", Configuration.class);
-
+        infoFactory.addAttribute("classList", Collection.class, true);
         // operations
-        infoFactory.setConstructor(new String[]{"Name", "objectName"});
+        infoFactory.setConstructor(new String[]{"Name",
+                                                "objectName"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 
@@ -157,5 +159,4 @@
     public void setEjbConfig(Configuration configuration) {
         ejbConfig = configuration;
     }
-
 }

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoProvider.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoProvider.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoProvider.java&r1=106166&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoProvider.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoProvider.java	(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoProvider.java	Mon Nov 22 00:23:11 2004
@@ -27,6 +27,7 @@
 
 /**
  * register the MessageContext in the jax-rpc runtime of the JSR109
+ * @version $Rev: $ $Date: $
  */
 public class GeronimoProvider extends RPCProvider {
     public static final String OPTION_EJB_NAME = "beanName";
@@ -82,9 +83,6 @@
         }
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.axis.providers.java.RPCProvider#invokeMethod(org.apache.axis.MessageContext, java.lang.reflect.Method, java.lang.Object, java.lang.Object[])
-     */
     protected Object invokeMethod(MessageContext msgContext,
                                   Method method,
                                   Object obj,

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoWsDeployContext.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoWsDeployContext.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoWsDeployContext.java&r1=106166&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoWsDeployContext.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoWsDeployContext.java	(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/GeronimoWsDeployContext.java	Mon Nov 22 00:23:11 2004
@@ -22,7 +22,7 @@
 import org.apache.geronimo.ews.ws4j2ee.toWs.Ws4J2eeDeployContext;
 
 /**
- * Class GeronimoWsDeployContext
+ * @version $Rev$ $Date$
  */
 public class GeronimoWsDeployContext implements Ws4J2eeDeployContext {
 

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java&r1=106166&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java	(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java	Mon Nov 22 00:23:11 2004
@@ -23,15 +23,13 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.gbean.WaitingException;
-import org.apache.geronimo.kernel.Kernel;
-
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.Collection;
 import java.util.Iterator;
 
 /**
- * Class AxisGbean
+ * @version $Rev: $ $Date: $
  */
 public class POJOWSGBean implements GBeanLifecycle {
     private static Log log = LogFactory.getLog(POJOWSGBean.class);
@@ -46,17 +44,16 @@
 
         // attributes
         infoFactory.addAttribute("Name", String.class, true);
-        infoFactory.addAttribute("kernel", Kernel.class, false);
         infoFactory.addAttribute("objectName", String.class, false);
         infoFactory.addAttribute("moduleURL", URL.class, true);
         infoFactory.addAttribute("classList", Collection.class, true);
         // operations
-        infoFactory.setConstructor(new String[]{"kernel", "Name",
+        infoFactory.setConstructor(new String[]{"Name",
                                                 "objectName"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 
-    public POJOWSGBean(Kernel kernel, String name, String objectName) {
+    public POJOWSGBean(String name, String objectName) {
         this.name = name;
     }
 
@@ -125,5 +122,4 @@
     public void setClassList(Collection collection) {
         classList = collection;
     }
-
 }

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java&r1=106166&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java	(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java	Mon Nov 22 00:23:11 2004
@@ -20,46 +20,50 @@
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.net.URI;
 import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.jar.JarFile;
-import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
-import javax.management.ObjectName;
-
 import org.apache.geronimo.deployment.ConfigurationBuilder;
 import org.apache.geronimo.deployment.DeploymentException;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.WaitingException;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
-import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
 import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.ConfigurationStore;
 
 /**
- * This Class should build Configurations out of deployment Module. 
+ * This Class should build Configurations out of deployment Module.
+ * @version $Rev: $ $Date: $ 
  */
 public class WSConfigBuilder implements ConfigurationBuilder {
-    private boolean hasEJB = false;
-
-    private final EARConfigBuilder earConfigBuilder;
-    private final ConfigurationStore store;
-    private ObjectName configName = null;
+   // private final AxisGbean axisGBean;
     
+//    public WSConfigBuilder(AxisGbean axisGBean){
+//        //this.axisGBean = axisGBean;
+//    }
+    public WSConfigBuilder(){
+        //this.axisGBean = axisGBean;
+    }
+    
+    public static final GBeanInfo GBEAN_INFO;
 
-    public WSConfigBuilder(EARConfigBuilder earConfigBuilder,
-                           ConfigurationStore store) {
-        this.earConfigBuilder = earConfigBuilder;
-        this.store = store;
+    static {
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("WSConfigBuilder",WSConfigBuilder.class);
+        //referances
+        //infoFactory.addReference("AxisGBean", AxisGbean.class);
+        //interfaces
+        infoFactory.addInterface(ConfigurationBuilder.class);
+        //constructers
+        //infoFactory.setConstructor(new String[]{"AxisGBean"});
+        
+        GBEAN_INFO = infoFactory.getBeanInfo();
     }
 
+    
     public void doStart() throws WaitingException, Exception {
     }
 
@@ -67,104 +71,157 @@
         return null;
     }
 
-    public List buildConfiguration(Object plan, JarFile earFile, File outfile) throws IOException, DeploymentException {
-        //TODO this is not implemented as the current code need the location of the file 
-        //where this gives a Zip file. For the time been the method is override and used.  
-        return null;
-    }
-
-    public List buildConfiguration(Object plan, 
-            File earFile, 
-            File outfile) throws Exception {
-        ObjectName wsconf = new ObjectName("geronimo.test:name=" + earFile.getName());
-        ObjectName ejbconf = new ObjectName("geronimo.test:name=" + earFile.getName() + "EJB");
-
-        Enumeration entires = new JarFile(earFile).entries();
-        while (entires.hasMoreElements()) {
-            ZipEntry zipe = (ZipEntry) entires.nextElement();
-            String name = zipe.getName();
-            if (name.endsWith("/ejb-jar.xml")) {
-                hasEJB = true;
-                System.out.println("entry found " + name + " the web service is based on a ejb.");
-                //log.info("the web service is based on a ejb.");
-                break;
+    public List buildConfiguration(Object plan, JarFile unused, File unpackedDir) throws IOException, DeploymentException {
+        try {
+            WSPlan wsplan = null; 
+            if(plan instanceof WSPlan){
+                wsplan = (WSPlan)plan;
             }
-        }
-        GBeanMBean[] confBeans = null;
-        if (hasEJB) {
-            return installEJBWebService(earFile, outfile,wsconf,ejbconf);
             
-        } else {
-            return installPOJOWebService(earFile, outfile,wsconf);
-
+            if(wsplan.isEJBbased()){
+                GBeanMBean wsGbean = new GBeanMBean(EJBWSGBean.getGBeanInfo());
+                ArrayList classList = AxisGeronimoUtils.getClassFileList(new ZipFile(wsplan.getModule()));
+                wsGbean.setAttribute("classList", classList);
+                wsGbean.setReferencePattern("ejbConfig", wsplan.getEjbConfName());
+                Map gbeans = new HashMap();
+                gbeans.put(wsplan.getWsName(), wsGbean);
+//      
+//                //create a configuraton with Web Service GBean
+                byte[] state = Configuration.storeGBeans(gbeans);
+                AxisGeronimoUtils.createConfiguration(wsplan.getConfigURI(),state,unpackedDir);
+
+            }else{
+                File rawmodule = wsplan.getModule();
+                File installedModule = new File(unpackedDir, rawmodule.getName());
+                copyTheFile(rawmodule, installedModule);
+                
+                
+                GBeanMBean gbean = new GBeanMBean(POJOWSGBean.getGBeanInfo());
+                //TODO fill up the POJOWSGBean info
+                ArrayList classList = AxisGeronimoUtils.getClassFileList(new ZipFile(installedModule));
+                gbean.setAttribute("classList", classList);
+                gbean.setAttribute("moduleURL", installedModule.toURL());
+            
+                Map gbeans = new HashMap();
+                gbeans.put(wsplan.getWsName(), gbean);
+                byte[] state = Configuration.storeGBeans(gbeans);
+                AxisGeronimoUtils.createConfiguration(wsplan.getConfigURI(),state,unpackedDir);
+            }
+        } catch (IOException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new DeploymentException(e);
         }
-    }
-
 
-    /**
-     * @param module      Web Service module generated by EWS
-     * @param unpackedDir for WS
-     * @return the file to where Module is copied in to
-     */
-    private List installPOJOWebService(File module, File unpackedDir,ObjectName pojoWSGbeanName) throws Exception {
-        List installedConfig = new ArrayList();
-        File out = new File(unpackedDir, module.getName());
-        copyTheFile(module, out);
-
-        GBeanMBean gbean = new GBeanMBean(POJOWSGBean.getGBeanInfo());
-        //TODO fill up the POJOWSGBean info
-        ArrayList classList = AxisGeronimoUtils.getClassFileList(new ZipFile(module));
-        gbean.setAttribute("classList", classList);
-        gbean.setAttribute("moduleURL", module.toURL());
-        Map gbeans = new HashMap();
-        gbeans.put(pojoWSGbeanName, gbean);
-        
-        
-        byte[] state = Configuration.storeGBeans(gbeans);
-        GBeanMBean config = new GBeanMBean(Configuration.GBEAN_INFO);
-        config.setAttribute("ID", new URI("test"));
-        config.setReferencePatterns("Parent", null);
-        config.setAttribute("classPath", Collections.EMPTY_LIST);
-        config.setAttribute("gBeanState", state);
-        config.setAttribute("dependencies", Collections.EMPTY_LIST);
-        installedConfig.add(AxisGeronimoUtils.saveConfiguration(config,store));
-        return installedConfig;
-    }
-
-    private List installEJBWebService(File module, 
-                File unpackedDir,
-                ObjectName wSGbeanName,
-                ObjectName ejbConfGBeanName) throws Exception {
-        List installedConfig = new ArrayList();
-
-        JarFile jarFile = new JarFile(module);
-        Object plan = earConfigBuilder.getDeploymentPlan(null, jarFile);
-        earConfigBuilder.buildConfiguration(plan, jarFile, unpackedDir);
-        GBeanMBean ejbGBean = AxisGeronimoUtils.loadConfig(unpackedDir);
-        installedConfig.add(AxisGeronimoUtils.saveConfiguration(ejbGBean,store));
-        
-        GBeanMBean wsGbean = new GBeanMBean(EJBWSGBean.getGBeanInfo());
-        ArrayList classList = AxisGeronimoUtils.getClassFileList(new ZipFile(module));
-        wsGbean.setAttribute("classList", classList);
-        wsGbean.setReferencePattern("ejbConfig", ejbConfGBeanName);
-        Map gbeans = new HashMap();
-        gbeans.put(wSGbeanName, wsGbean);
-        gbeans.put(ejbConfGBeanName, ejbGBean);
         
-        byte[] state = Configuration.storeGBeans(gbeans);
-        GBeanMBean config = new GBeanMBean(Configuration.GBEAN_INFO);
-        config.setAttribute("ID", new URI("test"));
-        config.setReferencePatterns("Parent", null);
-        config.setAttribute("classPath", Collections.EMPTY_LIST);
-        config.setAttribute("gBeanState", state);
-        config.setAttribute("dependencies", Collections.EMPTY_LIST);
-
         
-        installedConfig.add(AxisGeronimoUtils.saveConfiguration(config,store));
-        return installedConfig;
+        //TODO this is not implemented as the current code need the location of the file 
+        //where this gives a Zip file. For the time been the method is override and used.  
+        return null;
     }
+    
+//    /**
+//     * the users suppose to use 
+//     * <code>
+//     * 		File outFile = store.newConfigDir();
+//     * 		buildConfiguration(objectName,module,outFile);
+//     * 		//returning list have nothing in it.
+//     * 		URI uri = store.install(outFile);
+//     * 		//the URI will put under a configuration and started later.
+//     * </code>
+//     * @param plan
+//     * @param earFile
+//     * @param outfile
+//     * @return
+//     * @throws Exception
+//     */
+//
+//    public List buildConfiguration(Object plan, 
+//            File earFile, 
+//            File outfile) throws Exception {
+//        ObjectName wsconf = new ObjectName("geronimo.test:name=" + earFile.getName());
+//        ObjectName ejbconf = new ObjectName("geronimo.test:name=" + earFile.getName() + "EJB");
+//
+//        Enumeration entires = new JarFile(earFile).entries();
+//        while (entires.hasMoreElements()) {
+//            ZipEntry zipe = (ZipEntry) entires.nextElement();
+//            String name = zipe.getName();
+//            if (name.endsWith("/ejb-jar.xml")) {
+//                hasEJB = true;
+//                System.out.println("entry found " + name + " the web service is based on a ejb.");
+//                //log.info("the web service is based on a ejb.");
+//                break;
+//            }
+//        }
+//        GBeanMBean[] confBeans = null;
+//        if (hasEJB) {
+//            return installEJBWebService(earFile, outfile,wsconf);
+//            
+//        } else {
+//            return installPOJOWebService(earFile, outfile,wsconf);
+//
+//        }
+//    }
+
+
+//    /**
+//     * @param module      Web Service module generated by EWS
+//     * @param unpackedDir for WS
+//     * @return the file to where Module is copied in to
+//     */
+//    private List installPOJOWebService(File module, File unpackedDir,ObjectName pojoWSGbeanName) throws Exception {
+//        List installedConfig = new ArrayList();
+//        File out = new File(unpackedDir, module.getName());
+//        copyTheFile(module, out);
+//
+//        GBeanMBean gbean = new GBeanMBean(POJOWSGBean.getGBeanInfo());
+//        //TODO fill up the POJOWSGBean info
+//        ArrayList classList = AxisGeronimoUtils.getClassFileList(new ZipFile(module));
+//        gbean.setAttribute("classList", classList);
+//        gbean.setAttribute("moduleURL", module.toURL());
+//        
+//        Map gbeans = new HashMap();
+//        gbeans.put(pojoWSGbeanName, gbean);
+//        byte[] state = Configuration.storeGBeans(gbeans);
+//        
+//        
+//        installedConfig.add(AxisGeronimoUtils.saveAsConfiguration(state,new URI("test1"),store));
+//        return installedConfig;
+//    }
+    
+    
+    
 
-
+//    private List installEJBWebService(File module, 
+//                File unpackedDir,
+//                ObjectName wSGbeanName) throws Exception {
+//        List installedConfig = new ArrayList();
+//
+//        JarFile jarFile = new JarFile(module);
+//        //Install the EJB
+//        Object plan = earConfigBuilder.getDeploymentPlan(null, jarFile);
+//        earConfigBuilder.buildConfiguration(plan, jarFile, unpackedDir);
+//        URI uri = store.install(unpackedDir);
+//        installedConfig.add(uri);
+//
+//        //load the EJB Configuration TODO, Do we need this?        
+//        GBeanMBean ejbGBean = AxisGeronimoUtils.loadConfig(unpackedDir);
+//
+////        //Create the Web Service GBean       
+//        GBeanMBean wsGbean = new GBeanMBean(EJBWSGBean.getGBeanInfo());
+//        ArrayList classList = AxisGeronimoUtils.getClassFileList(new ZipFile(module));
+//        wsGbean.setAttribute("classList", classList);
+////        wsGbean.setReferencePattern("ejbConfig", ejbGBean.getObjectNameObject());
+//        Map gbeans = new HashMap();
+//        gbeans.put(wSGbeanName, wsGbean);
+////      
+////        //create a configuraton with Web Service GBean
+//        byte[] state = Configuration.storeGBeans(gbeans);
+//        installedConfig.add(AxisGeronimoUtils.saveAsConfiguration(state,new URI("test2"),store));
+//        return installedConfig;
+//    }
+//
+//
     private void copyTheFile(File inFile, File outFile) throws IOException {
         if (!outFile.exists())
             outFile.getParentFile().mkdirs();
@@ -183,19 +240,6 @@
         }
     }
 
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(WSConfigBuilder.class);
-        infoFactory.addInterface(ConfigurationBuilder.class);
-        infoFactory.addReference("EARConfigBuilder", EARConfigBuilder.class);
-        infoFactory.addReference("Store", ConfigurationStore.class);
-        infoFactory.setConstructor(new String[]{
-            "EARConfigBuilder",
-            "Store"
-        });
-        GBEAN_INFO = infoFactory.getBeanInfo();
-    }
 
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;

Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSDDJavaGeronimoProvider.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSDDJavaGeronimoProvider.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSDDJavaGeronimoProvider.java&r1=106166&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSDDJavaGeronimoProvider.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSDDJavaGeronimoProvider.java	(original)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSDDJavaGeronimoProvider.java	Mon Nov 22 00:23:11 2004
@@ -33,8 +33,7 @@
  * META-INF/services/org.apache.axis.deployment.wsdd.Provider
  * By making this JAR part of the webapp, the new provider will be
  * automatically discovered.
- *
- * @author Srinath Perera(hemapani@opensource.lk)
+ * @version $Rev: $ $Date: $
  */
 public class WSDDJavaGeronimoProvider extends WSDDProvider {
     public static final String PROVIDER_EWS = "geronimo";
@@ -42,7 +41,6 @@
     public String getName() {
         return PROVIDER_EWS;
     }
-
     public Handler newProviderInstance(WSDDService service,
                                        EngineConfiguration registry)
             throws Exception {

Added: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSPlan.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSPlan.java?view=auto&rev=106167
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSPlan.java	Mon Nov 22 00:23:11 2004
@@ -0,0 +1,91 @@
+/*
+ * 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 java.io.File;
+import java.net.URI;
+
+import javax.management.ObjectName;
+
+/**
+  * @version $Rev: $ $Date: $ 
+  */
+public class WSPlan {
+    private final boolean isEJBbased;
+    private final ObjectName ejbConfName;
+    private final ObjectName wsName;
+    private final File module; 
+    private final URI configURI;
+    
+    private WSPlan(URI configURI,ObjectName wsName,ObjectName ejbConfName,File module){
+        this.wsName = wsName;
+        this.ejbConfName = ejbConfName;
+        this.module = module;
+        isEJBbased = true;
+        this.configURI = configURI;
+    }
+    
+    private WSPlan(URI configURI,ObjectName wsName,File module){
+        this.wsName = wsName;
+        this.ejbConfName = null;
+        this.module = module;
+        isEJBbased = false;
+        this.configURI = configURI;
+    }
+    public static WSPlan createPlan(URI configURI,ObjectName wsName,ObjectName ejbConfName,File module){
+        return new WSPlan(configURI,wsName,ejbConfName,module);
+    }
+    
+    public static WSPlan createPlan(URI configURI,ObjectName wsName,File module){
+        return new WSPlan(configURI,wsName,module);
+    }
+    /**
+     * @return
+     */
+    public ObjectName getEjbConfName() {
+        return ejbConfName;
+    }
+
+    /**
+     * @return
+     */
+    public boolean isEJBbased() {
+        return isEJBbased;
+    }
+
+    /**
+     * @return
+     */
+    public File getModule() {
+        return module;
+    }
+
+    /**
+     * @return
+     */
+    public ObjectName getWsName() {
+        return wsName;
+    }
+
+    /**
+     * @return
+     */
+    public URI getConfigURI() {
+        return configURI;
+    }
+
+}

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractTestCase.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractTestCase.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractTestCase.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractTestCase.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractTestCase.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractTestCase.java	Mon Nov 22 00:23:11 2004
@@ -22,6 +22,7 @@
 
 /**
  * Abstract base class for test cases.
+ * @version $Rev$ $Date$
  */
 public abstract class AbstractTestCase
         extends TestCase {

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java	Mon Nov 22 00:23:11 2004
@@ -21,20 +21,21 @@
 import java.net.URI;
 
 import javax.management.ObjectName;
-import javax.naming.Reference;
 
 import org.apache.geronimo.axis.testUtils.AxisGeronimoConstants;
 import org.apache.geronimo.axis.testUtils.TestingUtils;
-import org.apache.geronimo.deployment.DeploymentException;
-import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.WaitingException;
+import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
-import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
-import org.apache.geronimo.system.configuration.LocalConfigStore;
 import org.openejb.deployment.OpenEJBModuleBuilder;
 
+/**
+ * 
+ * @version $Rev: $ $Date: $
+ */
 public class AbstractWebServiceTest extends AbstractTestCase {
 
     private static final String j2eeDomainName = "openejb.server";
@@ -43,9 +44,10 @@
     private static final ObjectName connectionTrackerObjectName = JMXUtil.getObjectName(j2eeDomainName + ":type=ConnectionTracker");
 
     protected ObjectName axisname;
+    protected ObjectName wsConfgBuilderName;
     protected Kernel kernel;
-    protected LocalConfigStore store;
-    protected File outFile = new File(AxisGeronimoConstants.AXIS_CONFIG_STORE);
+    protected ConfigurationStore store;
+    protected File outFile = new File("target/temp");
 
     /**
      * @param testName
@@ -53,19 +55,30 @@
     public AbstractWebServiceTest(String testName) throws FileNotFoundException, WaitingException, IOException {
         super(testName);
 
-        store = new LocalConfigStore(outFile);
-        store.doStart();
+        store = AxisGeronimoConstants.STORE;
+
     }
 
     protected void setUp() throws Exception {
         axisname = new ObjectName("test:name=AxisGBean");
-        kernel = new Kernel("test.kernel", "test");
+        wsConfgBuilderName = new ObjectName("test:name=wsConfgBuilder");
+        kernel = new Kernel("test.kernel");
         kernel.boot();
-        AxisGeronimoUtils.delete(outFile);
-        outFile.getParentFile().mkdirs();
         //start the J2EE server which would be started by the server plan
         //in the real case 
         TestingUtils.startJ2EEContinerAndAxisServlet(kernel);
+        
+        //Start axis gbean        
+        GBeanMBean axisgbean = new GBeanMBean(AxisGbean.getGBeanInfo());
+        kernel.loadGBean(axisname, axisgbean);
+        kernel.startGBean(axisname);
+        
+        GBeanMBean wsConfgBuilderbean = new GBeanMBean(WSConfigBuilder.getGBeanInfo());
+        //wsConfgBuilderbean.setReferencePattern("AxisGBean",axisname);
+        kernel.loadGBean(wsConfgBuilderName, wsConfgBuilderbean);
+        kernel.startGBean(wsConfgBuilderName);
+        
+        
 
     }
 

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java	Mon Nov 22 00:23:11 2004
@@ -30,6 +30,7 @@
 /**
  * <p> This test case start the AxisGbean and test retiving the index.html of the
  * Axis Service</p>
+ * @version $Rev$ $Date$
  */
 public class AxisGBeanTest extends AbstractTestCase {
     private ObjectName name;

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/ComplexTypeWebServiceTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/ComplexTypeWebServiceTest.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/ComplexTypeWebServiceTest.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/ComplexTypeWebServiceTest.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/ComplexTypeWebServiceTest.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/ComplexTypeWebServiceTest.java	Mon Nov 22 00:23:11 2004
@@ -26,10 +26,15 @@
 
 import org.apache.axis.utils.ClassUtils;
 import org.apache.geronimo.axis.testUtils.AxisGeronimoConstants;
+import org.apache.geronimo.axis.testUtils.TestingUtils;
 import org.apache.geronimo.gbean.WaitingException;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
+import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
 import org.apache.geronimo.kernel.Kernel;
 
+/**
+ * 
+ * @version $Rev$ $Date$
+ */
 public class ComplexTypeWebServiceTest extends AbstractWebServiceTest {
     private ObjectName axisname;
     private Kernel kernel;
@@ -48,22 +53,10 @@
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         ClassLoader myCl = new URLClassLoader(new URL[]{}, cl);
   
-        //axis gbean        
-        GBeanMBean axisgbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl);
-        kernel.loadGBean(axisname, axisgbean);
-        kernel.startGBean(axisname);
         File jarfile = new File(getTestFile("target/generated/samples/echo-ewsimpl.jar"));
         
-        kernel.getMBeanServer().invoke(axisname,
-                "deployEWSModule",
-                new Object[]{
-                    jarfile.getAbsolutePath(),
-                    null,
-                    "ws/apache/axis/echo"},
-                new String[]{
-                    String.class.getName(),
-                    String.class.getName(),
-                    String.class.getName()});
+        EARConfigBuilder earConfigBuilder = getEARConfigBuilder();
+        TestingUtils.buildConfiguration(jarfile,store,earConfigBuilder,kernel,wsConfgBuilderName);        
 
         //check the real web service invocations 
         Class echoLoacaterClass = ClassUtils.forName("org.apache.ws.echosample.EchoServiceLocator");
@@ -88,8 +81,7 @@
 
     protected void setUp() throws Exception {
         File file = new File(AxisGeronimoConstants.AXIS_CONFIG_STORE);
-        axisname = new ObjectName("test:name=AxisGBean");
-        kernel = new Kernel("test.kernel", "test");
+        kernel = new Kernel("test.kernel");
         kernel.boot();
         AxisGeronimoUtils.delete(file);
         file.getParentFile().mkdirs();

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/EchoHeadersTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/EchoHeadersTest.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/EchoHeadersTest.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/EchoHeadersTest.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/EchoHeadersTest.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/EchoHeadersTest.java	Mon Nov 22 00:23:11 2004
@@ -37,6 +37,10 @@
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
 import org.apache.geronimo.kernel.Kernel;
 
+/**
+ * 
+ * @version $Rev$ $Date$
+ */
 public class EchoHeadersTest extends AbstractTestCase {
     private ObjectName name;
     private Kernel kernel;

Deleted: /geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/J2EEManagerTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/J2EEManagerTest.java?view=auto&rev=106166
==============================================================================

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/PlansTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/PlansTest.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/PlansTest.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/PlansTest.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/PlansTest.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/PlansTest.java	Mon Nov 22 00:23:11 2004
@@ -18,7 +18,10 @@
 import javax.management.ObjectName;
 
 import org.apache.geronimo.kernel.Kernel;
-
+/**
+ * 
+ * @version $Rev: $ $Date: $
+ */
 public class PlansTest extends AbstractTestCase {
     private ObjectName configBuilderName;
     private Kernel kernel;

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimpleEJBWebServiceTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimpleEJBWebServiceTest.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimpleEJBWebServiceTest.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimpleEJBWebServiceTest.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimpleEJBWebServiceTest.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimpleEJBWebServiceTest.java	Mon Nov 22 00:23:11 2004
@@ -30,10 +30,16 @@
 
 import javax.management.ObjectName;
 
+import org.apache.geronimo.axis.testUtils.TestingUtils;
 import org.apache.geronimo.gbean.WaitingException;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
+import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 
+/**
+ * 
+ * @version $Rev: $ $Date: $
+ */
 public class SimpleEJBWebServiceTest extends AbstractWebServiceTest {
 
     public SimpleEJBWebServiceTest(String testName) throws FileNotFoundException, WaitingException, IOException {
@@ -47,24 +53,8 @@
         File jarfile = new File(getTestFile("target/generated/samples/echo-jar/echo-ewsimpl.jar"));
         ObjectName configName = new ObjectName("geronimo.test:name=" + jarfile.getName());
         
-        //axis gbean        
-        GBeanMBean axisgbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl);
-        kernel.loadGBean(axisname, axisgbean);
-        kernel.startGBean(axisname);
-        
-        WSConfigBuilder wsconfBuilder = new WSConfigBuilder(getEARConfigBuilder(), store);
-        List uri = wsconfBuilder.buildConfiguration(null, jarfile, outFile);
-        
-        for(int i = 0; i< uri.size();i++){
-            GBeanMBean config = store.getConfiguration((URI) uri.get(i));
-            ConfigurationManager configurationManager = kernel.getConfigurationManager();
-            configName = configurationManager.load(config, null);
-            kernel.startRecursiveGBean(configName);
-        }
-        
-        
-
-
+        EARConfigBuilder earConfigBuilder = getEARConfigBuilder();
+        TestingUtils.buildConfiguration(jarfile,store,earConfigBuilder,kernel,wsConfgBuilderName);        
 
         //let us try to brows the WSDL of the service
         URL wsdlrequestUrl = AxisGeronimoUtils.getURL("/axis/services/echoPort?wsdl");

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimplePOJOWebServiceTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimplePOJOWebServiceTest.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimplePOJOWebServiceTest.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimplePOJOWebServiceTest.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimplePOJOWebServiceTest.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/SimplePOJOWebServiceTest.java	Mon Nov 22 00:23:11 2004
@@ -22,19 +22,20 @@
 import java.io.InputStreamReader;
 import java.lang.reflect.Method;
 import java.net.HttpURLConnection;
-import java.net.URI;
 import java.net.URL;
 import java.net.URLClassLoader;
-import java.util.List;
-
-import javax.management.ObjectName;
 
 import org.apache.axis.utils.ClassUtils;
+import org.apache.geronimo.axis.testUtils.TestingUtils;
 import org.apache.geronimo.gbean.WaitingException;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
-
+import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
+/**
+ * 
+ * @version $Rev: $ $Date: $
+ */
 public class SimplePOJOWebServiceTest extends AbstractWebServiceTest {
+    
 
     public SimplePOJOWebServiceTest(String testName) throws FileNotFoundException, WaitingException, IOException {
         super(testName);
@@ -45,22 +46,8 @@
         ClassLoader myCl = new URLClassLoader(new URL[]{}, cl);
         File jarfile = new File(getTestFile("target/generated/samples/echo-war/echo-ewsimpl.jar"));
   
-        //Start axis gbean        
-        GBeanMBean axisgbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl);
-        kernel.loadGBean(axisname, axisgbean);
-        kernel.startGBean(axisname);
-
-        //build the configuration
-        WSConfigBuilder wsconfBuilder = new WSConfigBuilder(getEARConfigBuilder(), store);
-        List uri = wsconfBuilder.buildConfiguration(null, jarfile, outFile);
-        //start the configuration
-        for(int i = 0; i< uri.size();i++){
-            GBeanMBean config = store.getConfiguration((URI) uri.get(i));
-            ConfigurationManager configurationManager = kernel.getConfigurationManager();
-            ObjectName configName = configurationManager.load(config, null);
-            kernel.startRecursiveGBean(configName);
-        }
-
+        EARConfigBuilder earConfigBuilder = getEARConfigBuilder();
+        TestingUtils.buildConfiguration(jarfile,store,earConfigBuilder,kernel,wsConfgBuilderName);
 
         //let us try to brows the WSDL of the service
         URL wsdlrequestUrl = AxisGeronimoUtils.getURL("/axis/services/echoPort?wsdl");

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/AdminClientDeploymentTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/AdminClientDeploymentTest.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/AdminClientDeploymentTest.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/AdminClientDeploymentTest.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/AdminClientDeploymentTest.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/AdminClientDeploymentTest.java	Mon Nov 22 00:23:11 2004
@@ -36,6 +36,7 @@
 /**
  * <p>This test case shows the possible two ways of add a entry to the Axis
  * server-config.wsdd Deployment Discrypter.</p>
+ * @version $Rev: $ $Date: $
  */
 
 public class AdminClientDeploymentTest extends AbstractWebServiceTest {

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java	Mon Nov 22 00:23:11 2004
@@ -21,10 +21,8 @@
 import java.util.jar.JarFile;
 
 import javax.management.ObjectName;
-import javax.naming.Reference;
 
 import org.apache.geronimo.axis.AbstractTestCase;
-import org.apache.geronimo.axis.AxisGeronimoUtils;
 import org.apache.geronimo.axis.testUtils.AxisGeronimoConstants;
 import org.apache.geronimo.axis.testUtils.J2EEManager;
 import org.apache.geronimo.axis.testUtils.TestingUtils;
@@ -32,6 +30,7 @@
 import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
 import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.openejb.deployment.OpenEJBModuleBuilder;
 
@@ -39,6 +38,7 @@
  * <p>This test case show the infomation about openEJB that we assumed. And the
  * simmlier code code is used in the real code. As the OpenEJB is developing and
  * rapidly changing this test case act as a notifier for saying things has chaged</p>
+ * @version $Rev: $ $Date: $
  */
 public class DynamicEJBDeploymentTest extends AbstractTestCase {
     private static final String j2eeDomainName = "openejb.server";
@@ -67,7 +67,7 @@
         System.setProperty(javax.naming.Context.URL_PKG_PREFIXES, str);
         kernel = new Kernel("blah");
         kernel.boot();
-        TestingUtils.startJ2EEContinerAndAxisServlet(kernel);
+       // TestingUtils.startJ2EEContinerAndAxisServlet(kernel);
     }
 
     private ResourceReferenceBuilder resourceReferenceBuilder = TestingUtils.RESOURCE_REFERANCE_BUILDER;
@@ -95,28 +95,45 @@
                         null);
 
         
-            File unpackedDir = new File(tempDir, "OpenEJBTest-ear-Unpacked");
             JarFile jarFileModules = null;
             System.out.println("**"+jarFile +"**");
+            
+            File ejbdir = AxisGeronimoConstants.STORE.createNewConfigurationDir();
+            
+            
             try {
                 jarFileModules = new JarFile(jarFile);
                 Object plan = earConfigBuilder.getDeploymentPlan(null, jarFileModules);
-                earConfigBuilder.buildConfiguration(plan, jarFileModules, unpackedDir);
+                earConfigBuilder.buildConfiguration(plan, jarFileModules, ejbdir);
             } finally {
                 if (jarFileModules != null) {
                     jarFileModules.close();
                 }
             }
-            ObjectName name = new ObjectName("geronimo.test:name=" + jarFile.getName());
-            GBeanMBean gbean = AxisGeronimoUtils.loadConfig(unpackedDir);
-            kernel.loadGBean(name,gbean);
-            gbean.setAttribute("baseURL",unpackedDir.toURL());
-            kernel.startGBean(name);
             
+            
+//            ObjectName name = new ObjectName("geronimo.test:name=" + jarFile.getName());
+//           GBeanMBean gbean = AxisGeronimoUtils.loadConfig(ejbdir);
+//           kernel.loadGBean(name,gbean);
+//           gbean.setAttribute("baseURL",ejbdir.toURL());
+//           kernel.startGBean(name);
+//
+            URI uri = AxisGeronimoConstants.STORE.install(ejbdir);
+            
+            
+
+//            //ObjectName name = new ObjectName("geronimo.test:name=" + jarFile.getName());
+//            GBeanMBean gbean = AxisGeronimoUtils.loadConfig(unpackedDir);
+//            URI uri = AxisGeronimoUtils.saveConfiguration(gbean,AxisGeronimoConstants.STORE);
+            
+            GBeanMBean config = AxisGeronimoConstants.STORE.getConfiguration(uri);
+            ConfigurationManager configurationManager = kernel.getConfigurationManager();
+            ObjectName configName = configurationManager.load(config, AxisGeronimoConstants.STORE.getBaseURL(uri));
+            kernel.startRecursiveGBean(configName);
     }
 
     protected void tearDown() throws Exception {
-        TestingUtils.stopJ2EEContinerAndAxisServlet(kernel);
+        //TestingUtils.stopJ2EEContinerAndAxisServlet(kernel);
         kernel.shutdown();
     }
 }

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/EWSTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/EWSTest.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/EWSTest.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/EWSTest.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/EWSTest.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/EWSTest.java	Mon Nov 22 00:23:11 2004
@@ -24,6 +24,7 @@
 /**
  * <p>This test case represents the code generation with the EWS module.
  * This test case needed the $JAVA_HOME/lib.tools.jar at the classapth.</p>
+ * @version $Rev: $ $Date: $
  */
 public class EWSTest extends AbstractTestCase {
     public EWSTest(String testName) {

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java	Mon Nov 22 00:23:11 2004
@@ -15,10 +15,19 @@
  */
 package org.apache.geronimo.axis.testUtils;
 
+import java.io.File;
+
 import javax.management.ObjectName;
+
 import org.apache.geronimo.connector.ActivationSpecWrapper;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.system.configuration.LocalConfigStore;
+
+/**
+ * @version $Rev: $ $Date: $
+ * @version $Rev: $ $Date: $
+ */
 
 public class AxisGeronimoConstants {
     public static final String J2EE_DOMAIN_NAME = "openejb.server";
@@ -50,5 +59,18 @@
     public static final ObjectName TRANSACTIONAL_TIMER_NAME = JMXUtil.getObjectName(J2EE_SERVER_PREFIX + ":type=ThreadPooledTimer,name=TransactionalThreaPooledTimer");
     public static final ObjectName NONTRANSACTIONAL_TIMER_NAME = JMXUtil.getObjectName(J2EE_SERVER_PREFIX + ":type=ThreadPooledTimer,name=NonTransactionalThreaPooledTimer");
     public static final GBeanData ACTIVATION_SPEC_INFO = new GBeanData(ActivationSpecWrapper.getGBeanInfo());
+    
+    public static File OUTFILE = new File(AxisGeronimoConstants.AXIS_CONFIG_STORE);
+    public static LocalConfigStore STORE = null;
+    
+    static{
+        try{
+            STORE = new LocalConfigStore(OUTFILE);
+            STORE.doStart();    
+        }catch(Exception e){
+            e.printStackTrace();
+        }
+    }
+
     
 }

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManager.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManager.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManager.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManager.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManager.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManager.java	Mon Nov 22 00:23:11 2004
@@ -37,6 +37,9 @@
 import org.apache.geronimo.transaction.GeronimoTransactionManager;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
 
+/**
+ * @version $Rev: $ $Date: $
+ */
 public class J2EEManager {
     public static final Log log = LogFactory.getLog(J2EEManager.class);
 
@@ -93,9 +96,11 @@
             tmGBean.setAttribute("defaultTransactionTimeoutSeconds", new Integer(10));
             tmGBean.setReferencePatterns("ResourceManagers", rmpatterns);
             AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.TRANSACTION_MANAGER_NAME, tmGBean, kernel);
+            
             GBeanMBean tcmGBean = new GBeanMBean(TransactionContextManager.GBEAN_INFO);
             tcmGBean.setReferencePattern("TransactionManager", AxisGeronimoConstants.TRANSACTION_MANAGER_NAME);
             AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.TRANSACTION_CONTEXT_MANAGER_NAME, tcmGBean, kernel);
+            
             GBeanMBean trackedConnectionAssociator = new GBeanMBean(ConnectionTrackingCoordinator.GBEAN_INFO);
             AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.TRACKED_CONNECTION_ASSOCIATOR_NAME, trackedConnectionAssociator, kernel);
         } catch (Exception e) {
@@ -119,11 +124,13 @@
         threadPoolGBean.setAttribute("poolSize", new Integer(5));
         threadPoolGBean.setAttribute("poolName", "DefaultThreadPool");
         AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.THREADPOOL_NAME, threadPoolGBean, kernel);
+        
         GBeanMBean transactionalTimerGBean = new GBeanMBean(VMStoreThreadPooledTransactionalTimer.GBEAN_INFO);
         transactionalTimerGBean.setAttribute("repeatCount", new Integer(5));
         transactionalTimerGBean.setReferencePattern("TransactionContextManager", AxisGeronimoConstants.TRANSACTION_CONTEXT_MANAGER_NAME);
         transactionalTimerGBean.setReferencePattern("ThreadPool", AxisGeronimoConstants.THREADPOOL_NAME);
         AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.TRANSACTIONAL_TIMER_NAME, transactionalTimerGBean, kernel);
+        
         GBeanMBean nonTransactionalTimerGBean = new GBeanMBean(VMStoreThreadPooledNonTransactionalTimer.GBEAN_INFO);
         nonTransactionalTimerGBean.setReferencePattern("ThreadPool", AxisGeronimoConstants.THREADPOOL_NAME);
         AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.NONTRANSACTIONAL_TIMER_NAME, nonTransactionalTimerGBean, kernel);

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManagerTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManagerTest.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManagerTest.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManagerTest.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManagerTest.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/J2EEManagerTest.java	Mon Nov 22 00:23:11 2004
@@ -23,6 +23,7 @@
 /**
  * <p>This test case represents the code generation with the EWS module.
  * This test case needed the $JAVA_HOME/lib.tools.jar at the classapth.</p>
+ * @version $Rev: $ $Date: $
  */
 public class J2EEManagerTest extends AbstractTestCase {
     private ObjectName name;

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java	Mon Nov 22 00:23:11 2004
@@ -34,6 +34,7 @@
 
 /**
  * <p>This class wrap the Jetty service, This is a test utility only</p>
+ * @version $Rev: $ $Date: $
  */
 public class JettyServiceWrapper {
     private ObjectName containerName;

Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java?view=diff&rev=106167&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java&r1=106166&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java&r2=106167
==============================================================================
--- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java	(original)
+++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java	Mon Nov 22 00:23:11 2004
@@ -15,28 +15,41 @@
  */
 package org.apache.geronimo.axis.testUtils;
 
+import java.io.File;
 import java.net.URI;
 import java.net.URL;
 import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.jar.JarFile;
+import java.util.zip.ZipEntry;
 
 import javax.management.ObjectName;
 import javax.naming.Reference;
 
 import org.apache.geronimo.axis.AxisGeronimoUtils;
+import org.apache.geronimo.axis.WSConfigBuilder;
+import org.apache.geronimo.axis.WSPlan;
 import org.apache.geronimo.deployment.DeploymentException;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.jmx.GBeanMBean;
+import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
 import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.transaction.OnlineUserTransaction;
 
+/**
+ * @version $Rev: $ $Date: $
+ */
 public class TestingUtils {
     
     protected static J2EEManager j2eeManager  = new J2EEManager();
     
 
     public static void startJ2EEContinerAndAxisServlet(Kernel kernel) throws Exception{
-        //This does the work need to be done by plan
+//        //This does the work need to be done by plan
         j2eeManager.startJ2EEContainer(kernel);
         //start the Axis Serverlet which would be started by the service plan
         org.apache.geronimo.jetty.JettyWebAppContext c = null;
@@ -93,5 +106,68 @@
             return null;
         }
     };
+    
+    
+    public static void buildConfiguration(File jarfile,
+            ConfigurationStore store,
+            EARConfigBuilder earConfigBuilder,
+            Kernel kernel,
+            ObjectName wsConfgBuilderName)throws Exception{
+        URI ejbURI = null;
+        ObjectName wsconf = new ObjectName("geronimo.test:name=" + jarfile.getName());
+        ObjectName ejbconf = new ObjectName("geronimo.test:name=" + jarfile.getName() + "EJB");
+        URI wsURI = new URI("new");
+
+        WSPlan plan = null;
+        
+        Enumeration entires = new JarFile(jarfile).entries();
+        while (entires.hasMoreElements()) {
+            ZipEntry zipe = (ZipEntry) entires.nextElement();
+            String name = zipe.getName();
+            if (name.endsWith("/ejb-jar.xml")) {
+                
+                JarFile module = new JarFile(jarfile);
+                File unpackedDir = store.createNewConfigurationDir();
+                //Install the EJB
+                Object ejbplan = earConfigBuilder.getDeploymentPlan(null, module);
+                earConfigBuilder.buildConfiguration(ejbplan, module, unpackedDir);
+                ejbURI = store.install(unpackedDir);
+
+                //load the EJB Configuration TODO, Do we need this?        
+                GBeanMBean ejbGBean = AxisGeronimoUtils.loadConfig(unpackedDir);
+                
+                plan = WSPlan.createPlan(wsURI,wsconf,ejbGBean.getObjectNameObject(),jarfile);
+                System.out.println("entry found " + name + " the web service is based on a ejb.");
+                //log.info("the web service is based on a ejb.");
+                break;
+            }
+        }
+        
+        if(plan == null){
+            plan = WSPlan.createPlan(wsURI,wsconf,jarfile);
+        }
+        File wsinstallDir = store.createNewConfigurationDir();
+        
+        kernel.invoke(wsConfgBuilderName,"buildConfiguration",
+            new Object[]{plan, null, wsinstallDir},
+            new String[]{Object.class.getName(),
+                JarFile.class.getName(),
+                File.class.getName()});
+        //wsconfBuilder.buildConfiguration(plan, null, wsinstallDir);
+        
+        if(ejbURI != null){
+            GBeanMBean config = store.getConfiguration(ejbURI);
+            ConfigurationManager configurationManager = kernel.getConfigurationManager();
+            ObjectName configName = configurationManager.load(config, null);
+            kernel.loadGBean(configName,config);
+            kernel.startRecursiveGBean(configName);
+        }
+        URI wsInstalledURI = store.install(wsinstallDir);
+        GBeanMBean config = store.getConfiguration(wsInstalledURI);
+        ConfigurationManager configurationManager = kernel.getConfigurationManager();
+        ObjectName configName = configurationManager.load(config, null);
+        kernel.startRecursiveGBean(configName);
+    
+    }
 
 }