[jboss-cvs] JBossAS SVN: r59646 - in trunk/embedded: src/main/java/org/jboss/embedded and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jan 15 11:04:03 EST 2007


Author: bill.burke at jboss.com
Date: 2007-01-15 11:03:44 -0500 (Mon, 15 Jan 2007)
New Revision: 59646

Added:
   trunk/embedded/src/main/java/org/jboss/embedded/junit/
   trunk/embedded/src/main/java/org/jboss/embedded/junit/ClasspathBasedTestServices.java
   trunk/embedded/src/main/java/org/jboss/embedded/junit/EmbeddedTestCase.java
   trunk/embedded/src/test/java/org/jboss/embedded/test/ejb/unit/EjbJBossTestCase.java
Modified:
   trunk/embedded/build-test.xml
   trunk/embedded/build.xml
   trunk/embedded/src/main/java/org/jboss/embedded/Bootstrap.java
   trunk/embedded/src/main/java/org/jboss/embedded/DeploymentGroup.java
   trunk/embedded/src/test/java/org/jboss/embedded/test/ejb/unit/EjbTestCase.java
Log:
Not sure why tearDown() would close the delegate.  JBossTestSetup is supposed to setup() and teardown the delegate.

Modified: trunk/embedded/build-test.xml
===================================================================
--- trunk/embedded/build-test.xml	2007-01-15 14:54:07 UTC (rev 59645)
+++ trunk/embedded/build-test.xml	2007-01-15 16:03:44 UTC (rev 59646)
@@ -32,11 +32,10 @@
       &libraries;
 
 
-      <echo message="${junit.junit.lib}"/>
-
       <!-- The combined library classpath -->
       <path id="library.classpath">
          <path refid="junit.junit.classpath"/>
+         <path refid="jboss.test.classpath"/>
       </path>
 
       <!-- ======= -->
@@ -47,10 +46,10 @@
 
       <!-- The combined dependent module classpath -->
       <path id="dependentmodule.classpath">
+         <pathelement location="output/lib/embedded-jboss/bootstrap"/>
          <fileset dir="output/lib/embedded-jboss/lib">
             <include name="*.jar"/>
          </fileset>
-         <pathelement location="output/lib/embedded-jboss/bootstrap"/>
       </path>
 
       <!-- ===== -->
@@ -215,7 +214,7 @@
          haltonfailure="false"
          fork="true">
 
-         <sysproperty key="jbosstest.deploy.dir" value="${build.lib}"/>
+         <sysproperty key="jbosstest.deploy.dir" value="test-lib"/>
          <sysproperty key="build.testlog" value="${build.testlog}"/>
          <sysproperty key="jbosstest.threadcount" value="${jbosstest.threadcount}"/>
          <sysproperty key="jbosstest.iterationcount" value="${jbosstest.iterationcount}"/>

Modified: trunk/embedded/build.xml
===================================================================
--- trunk/embedded/build.xml	2007-01-15 14:54:07 UTC (rev 59645)
+++ trunk/embedded/build.xml	2007-01-15 16:03:44 UTC (rev 59646)
@@ -128,6 +128,7 @@
          <path refid="jboss.jca.classpath"/>
          <path refid="jboss.jmx.classpath"/>
          <path refid="jboss.iiop.classpath"/>
+         <path refid="jboss.test.classpath"/>
       </path>
 
       <!-- ===== -->

Modified: trunk/embedded/src/main/java/org/jboss/embedded/Bootstrap.java
===================================================================
--- trunk/embedded/src/main/java/org/jboss/embedded/Bootstrap.java	2007-01-15 14:54:07 UTC (rev 59645)
+++ trunk/embedded/src/main/java/org/jboss/embedded/Bootstrap.java	2007-01-15 16:03:44 UTC (rev 59646)
@@ -26,11 +26,15 @@
 import org.jboss.deployers.spi.IncompleteDeployments;
 import org.jboss.deployers.spi.IncompleteDeploymentsBuilder;
 import org.jboss.deployers.spi.deployment.MainDeployer;
+import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
 import org.jboss.kernel.Kernel;
 import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
 import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer;
+import org.jboss.virtual.VirtualFile;
 
 import java.net.URL;
+import java.io.IOException;
+import java.util.List;
 
 /**
  * Basic bootstrap class for embeddable JBoss
@@ -46,6 +50,7 @@
    private Kernel kernel;
    private ClassLoader loader = Thread.currentThread().getContextClassLoader();
    private MainDeployer mainDeployer;
+   private boolean started;
 
 
 
@@ -73,16 +78,12 @@
       this.kernel = kernel;
    }
 
-   public DeploymentGroup createDeploymentGroup()
+
+   public boolean isStarted()
    {
-      DeploymentGroup group = new DeploymentGroup();
-      group.setClassLoader(loader);
-      group.setMainDeployer(mainDeployer);
-      group.setKernel(kernel);
-      return group;
+      return started;
    }
 
-
    public Kernel getKernel()
    {
       return kernel;
@@ -137,7 +138,7 @@
          throw new RuntimeException("Unable to bootstrap: ", throwable);
       }
       checkIncomplete();
-
+      started = true;
    }
 
    /**
@@ -189,4 +190,87 @@
       mainDeployer.shutdown();
    }
 
+   public void deploy(URL url) throws DeploymentException
+   {
+      DeploymentGroup group = createDeploymentGroup();
+      group.add(url);
+      group.process();
+   }
+
+   public void deployResource(String resource) throws DeploymentException
+   {
+      DeploymentGroup group = createDeploymentGroup();
+      group.addResource(resource);
+      group.process();
+   }
+
+   public void deployDirectory(URL url, boolean recurse) throws DeploymentException, IOException
+   {
+      DeploymentGroup group = createDeploymentGroup();
+      group.addDirectory(url, recurse);
+      group.process();
+   }
+
+   public void deployDirectoryFromResource(String resource, boolean recurse) throws DeploymentException, IOException
+   {
+      DeploymentGroup group = createDeploymentGroup();
+      group.addDirectoryByResource(resource, recurse);
+      group.process();
+   }
+
+   public void undeployResource(String resource) throws DeploymentException
+   {
+      ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+      if (loader != null) classLoader = loader;
+      URL url = classLoader.getResource(resource);
+      if (url == null) throw new NullPointerException("Resource was null: " + resource);
+      undeploy(url);
+   }
+
+   public void undeploy(URL url) throws DeploymentException
+   {
+      VirtualFile vf = DeploymentGroup.getVirtualFile(url);
+      undeploy(vf);
+   }
+
+   public void undeploy(VirtualFile vf)
+           throws DeploymentException
+   {
+      String name = AbstractDeploymentContext.getDeploymentName(vf);
+      mainDeployer.removeDeploymentContext(name);
+      mainDeployer.process();
+   }
+
+   public void undeployDirectory(URL url, boolean recurse) throws DeploymentException, IOException
+   {
+      List<VirtualFile> files = DeploymentGroup.getDeployerDirUrls(null, url, recurse);
+      for (VirtualFile vf : files)
+      {
+         String name = AbstractDeploymentContext.getDeploymentName(vf);
+         mainDeployer.removeDeploymentContext(name);
+      }
+      mainDeployer.process();
+   }
+
+   public void undeployDirectoryFromResource(String resource, boolean recurse) throws DeploymentException, IOException
+   {
+      ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+      if (loader != null) classLoader = loader;
+      List<VirtualFile> files = DeploymentGroup.getDeployerDirUrlsFromResource(null, classLoader, resource, recurse);
+      for (VirtualFile vf : files)
+      {
+         String name = AbstractDeploymentContext.getDeploymentName(vf);
+         mainDeployer.removeDeploymentContext(name);
+      }
+      mainDeployer.process();
+   }
+
+   public DeploymentGroup createDeploymentGroup()
+   {
+      DeploymentGroup group = new DeploymentGroup();
+      group.setClassLoader(loader);
+      group.setMainDeployer(mainDeployer);
+      group.setKernel(kernel);
+      return group;
+   }
  }
\ No newline at end of file

Modified: trunk/embedded/src/main/java/org/jboss/embedded/DeploymentGroup.java
===================================================================
--- trunk/embedded/src/main/java/org/jboss/embedded/DeploymentGroup.java	2007-01-15 14:54:07 UTC (rev 59645)
+++ trunk/embedded/src/main/java/org/jboss/embedded/DeploymentGroup.java	2007-01-15 16:03:44 UTC (rev 59646)
@@ -19,6 +19,7 @@
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
+
 package org.jboss.embedded;
 
 import org.jboss.deployers.plugins.structure.AbstractDeploymentContext;
@@ -89,7 +90,7 @@
     *
     * We may recurse.
     */
-   private void addDeployments(List<VirtualFile> list, VirtualFile root, boolean recurse)
+   private static void addDeployments(VirtualFileFilter filter, List<VirtualFile> list, VirtualFile root, boolean recurse)
       throws IOException
    {
       List<VirtualFile> components = root.getChildren();
@@ -107,7 +108,7 @@
          else if (component.getName().indexOf('.') == -1 && recurse)
          {
             // recurse if not '.' in name and recursive search is enabled
-            addDeployments(list, component, true);
+            addDeployments(filter, list, component, true);
          }
          else
          {
@@ -163,24 +164,19 @@
    }
 
    /**
-    * convenience function adds and processes.
+    * schedules a URL to be deployed
     *
     * @param url
     * @throws DeploymentException
     */
-   public void deploy(URL url) throws DeploymentException
+   public void add(URL url) throws DeploymentException
    {
-      add(url);
-      process();
+      VirtualFile file = getVirtualFile(url);
+      add(file);
    }
 
-   /**
-    * schedules a URL to be deployed
-    *
-    * @param url
-    * @throws DeploymentException
-    */
-   public void add(URL url) throws DeploymentException
+   public static VirtualFile getVirtualFile(URL url)
+           throws DeploymentException
    {
       VirtualFile file = null;
       try
@@ -191,7 +187,7 @@
       {
          throw new DeploymentException("Unable to get VirtualFile for url: " + url, e);
       }
-      add(file);
+      return file;
    }
 
    /**
@@ -230,6 +226,12 @@
     */
    public void addClasspath() throws DeploymentException
    {
+      addUrls(getClassPaths());
+   }
+
+   public static List<URL> getClassPaths() throws DeploymentException
+   {
+      List<URL> list = new ArrayList<URL>();
       String classpath = System.getProperty("java.class.path");
       StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator);
 
@@ -240,27 +242,17 @@
          if (!fp.exists()) throw new DeploymentException("File in java.class.path does not exist: " + fp);
          try
          {
-            add(fp.toURL());
+            list.add(fp.toURL());
          }
          catch (MalformedURLException e)
          {
             throw new DeploymentException(e);
          }
       }
+      return list;
    }
 
    /**
-    *  convience function.  Same as addClasspath() but it processes deployments
-    *
-    * @throws DeploymentException
-    */
-   public void scanClasspath() throws DeploymentException
-   {
-      addClasspath();
-      process();
-   }
-
-   /**
     * Scan Java Classpath (found with java.class.path)
     * for a specified list of files you want to deploy
     *
@@ -272,6 +264,14 @@
     */
    public void addClasspath(String paths) throws DeploymentException
    {
+      List<URL> urls = getClassPaths(paths);
+      addUrls(urls);
+   }
+
+   public static List<URL> getClassPaths(String paths) throws DeploymentException
+   {
+      ArrayList<URL> list = new ArrayList<URL>();
+
       String classpath = System.getProperty("java.class.path");
       StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator);
       String[] split = paths.split(",");
@@ -297,28 +297,17 @@
          if (!fp.exists()) throw new DeploymentException("File in java.class.path does not exists: " + fp);
          try
          {
-            add(fp.toURL());
+            list.add(fp.toURL());
          }
          catch (MalformedURLException e)
          {
             throw new DeploymentException(e);
          }
       }
+      return list;
    }
 
    /**
-    * convenience  function.  Same as addClasspath(String) but processes deployments too
-    *
-    * @param paths
-    * @throws DeploymentException
-    */
-   public void scanClasspath(String paths) throws DeploymentException
-   {
-      addClasspath(paths);
-      process();
-   }
-
-   /**
     * Search for the resource using the group's configured classloader
     * if no classloader, then Thread.currentThread().getContextClassLoader() is used.
     *    classLoader.getResource(String resource)
@@ -339,20 +328,6 @@
    }
 
    /**
-    * convenience function.  Same as addResource(String) but processes deployments too
-    *
-    * @param resource
-    * @throws DeploymentException
-    * @throws NullPointerException
-    */
-   public void deployResource(String resource)  throws DeploymentException, NullPointerException
-   {
-      addResource(resource);
-      process();
-   }
-
-
-   /**
     * Search for resources using the group's configured classloader
     * if no classloader, then Thread.currentThread().getContextClassLoader() is used.
     *    classLoader.getResources(String resource)
@@ -375,21 +350,6 @@
    }
 
    /**
-    *
-    * convenience function.  Same as addMultipleResources(String) but processes deployments too
-    *
-    * @param resource
-    * @throws DeploymentException
-    * @throws IOException
-    */
-   public void deployMultipleResrouces(String resource) throws DeploymentException, IOException
-   {
-      addMultipleResources(resource);
-      process();
-   }
-
-
-   /**
     * Searches for a directory as described in the  getDirFromResource() method of this class.
     *
     * schedules all possible files in directory to be deployed
@@ -404,11 +364,30 @@
    {
       ClassLoader loader = Thread.currentThread().getContextClassLoader();
       if (classLoader != null) loader = classLoader;
+      List<VirtualFile> files = getDeployerDirUrlsFromResource(filter, loader, resource, recurse);
+      addVirtualFiles(files);
+   }
+
+   public void addDirectory(URL directory, boolean recurse) throws DeploymentException, IOException
+   {
+      addVirtualFiles(getDeployerDirUrls(filter, directory, recurse));
+   }
+
+   public static List<VirtualFile> getDeployerDirUrlsFromResource(VirtualFileFilter filter, ClassLoader loader, String resource, boolean recurse)
+           throws DeploymentException, IOException
+   {
       URL url = getDirFromResource(loader, resource);
       if (url == null)
       {
          throw new DeploymentException("Unable to find deployDir from resource: " + resource);
       }
+      List<VirtualFile> files = getDeployerDirUrls(filter, url, recurse);
+      return files;
+   }
+
+   public static List<VirtualFile> getDeployerDirUrls(VirtualFileFilter filter, URL url, boolean recurse)
+           throws DeploymentException, IOException
+   {
       VirtualFile file = null;
       try
       {
@@ -416,29 +395,14 @@
       }
       catch (Exception e)
       {
-         throw new DeploymentException("Unable to find deployDir from resource: " + resource, e);
+         throw new DeploymentException("Unable to find deployDir from url: " + url, e);
       }
       List<VirtualFile> files = new ArrayList<VirtualFile>();
-      addDeployments(files, file, recurse);
-      addVirtualFiles(files);
+      addDeployments(filter, files, file, recurse);
+      return files;
    }
 
    /**
-    * convenience function.  Same as deployDirectoryByResource(String, boolean) but processes deployments too
-    *
-    * @param resource
-    * @param recurse
-    * @throws DeploymentException
-    * @throws IOException
-    */
-   public void deployDirectoryByResource(String resource, boolean recurse) throws DeploymentException, IOException
-   {
-      addDirectoryByResource(resource, recurse);
-      process();
-   }
-
-
-   /**
     * Find the directory that contains a given resource.
     * <p/>
     * The '.' character can be used to specify the current directory.

Added: trunk/embedded/src/main/java/org/jboss/embedded/junit/ClasspathBasedTestServices.java
===================================================================
--- trunk/embedded/src/main/java/org/jboss/embedded/junit/ClasspathBasedTestServices.java	2007-01-15 14:54:07 UTC (rev 59645)
+++ trunk/embedded/src/main/java/org/jboss/embedded/junit/ClasspathBasedTestServices.java	2007-01-15 16:03:44 UTC (rev 59646)
@@ -0,0 +1,102 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.embedded.junit;
+
+import org.jboss.test.JBossTestServices;
+import org.jboss.embedded.Bootstrap;
+
+import javax.management.MBeanServerConnection;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.io.File;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class ClasspathBasedTestServices extends JBossTestServices
+{
+   private boolean top;
+   private Bootstrap bootstrap;
+
+   public ClasspathBasedTestServices(String className)
+   {
+      super(className);
+   }
+
+   public ClasspathBasedTestServices(Class clazz)
+   {
+      super(clazz);
+   }
+
+
+   @Override
+   public void setUp() throws Exception
+   {
+      bootstrap = Bootstrap.getInstance();
+      if (!bootstrap.isStarted())
+      {
+         bootstrap.bootstrap();
+         top = true;
+      }
+      super.setUp();
+   }
+
+   @Override
+   public void tearDown() throws Exception
+   {
+      super.tearDown();
+      if (top) bootstrap.shutdown();
+   }
+
+
+   @Override
+   public MBeanServerConnection getServer() throws Exception
+   {
+      return super.getServer();    //To change body of overridden methods use File | Settings | File Templates.
+   }
+
+   @Override
+   public void deploy(String name) throws Exception
+   {
+      URL url = getDeployURL(name);
+      bootstrap.deploy(url);
+   }
+
+   @Override
+   public void redeploy(String name) throws Exception
+   {
+      URL url = getDeployURL(name);
+      bootstrap.deploy(url);
+   }
+
+   @Override
+   public void undeploy(String name) throws Exception
+   {
+      URL url = getDeployURL(name);
+      bootstrap.undeploy(url);
+   }
+
+
+}

Added: trunk/embedded/src/main/java/org/jboss/embedded/junit/EmbeddedTestCase.java
===================================================================
--- trunk/embedded/src/main/java/org/jboss/embedded/junit/EmbeddedTestCase.java	2007-01-15 14:54:07 UTC (rev 59645)
+++ trunk/embedded/src/main/java/org/jboss/embedded/junit/EmbeddedTestCase.java	2007-01-15 16:03:44 UTC (rev 59646)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.embedded.junit;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.AbstractTestDelegate;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class EmbeddedTestCase extends JBossTestCase
+{
+   public EmbeddedTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test getAdaptedSetup(final Class clazz, final String jarName)
+      throws Exception
+   {
+      TestSuite suite = new TestSuite();
+      suite.addTest(new TestSuite(clazz));
+      return getDeploySetup(EmbeddedTestCase.class, suite, jarName);
+   }
+
+   /**
+    * Overriden to return JBossTestServices as the test delegate.
+    */
+   public static AbstractTestDelegate getDelegate(Class clazz) throws Exception
+   {
+      AbstractTestDelegate delegate = new ClasspathBasedTestServices(clazz);
+      return delegate;
+   }
+}

Added: trunk/embedded/src/test/java/org/jboss/embedded/test/ejb/unit/EjbJBossTestCase.java
===================================================================
--- trunk/embedded/src/test/java/org/jboss/embedded/test/ejb/unit/EjbJBossTestCase.java	2007-01-15 14:54:07 UTC (rev 59645)
+++ trunk/embedded/src/test/java/org/jboss/embedded/test/ejb/unit/EjbJBossTestCase.java	2007-01-15 16:03:44 UTC (rev 59646)
@@ -0,0 +1,84 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.embedded.test.ejb.unit;
+
+import junit.framework.Test;
+import org.jboss.embedded.junit.EmbeddedTestCase;
+import org.jboss.embedded.test.ejb.Customer;
+import org.jboss.embedded.test.ejb.DAO;
+import org.jboss.test.JBossTestCase;
+
+import javax.naming.InitialContext;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision: 42757 $
+ */
+public class EjbJBossTestCase extends JBossTestCase
+{
+   public EjbJBossTestCase()
+   {
+      super("BootstrapTestCase");
+   }
+
+   /*
+   private static void outputJNDI()
+           throws InstanceNotFoundException, MBeanException, ReflectionException, MalformedObjectNameException
+   {
+      MBeanServer server = getMBeanServer();
+      String xml = (String)server.invoke(new ObjectName("jboss:service=JNDIView"), "listXML", null, null);
+      System.out.println(xml);
+   }
+
+   private static MBeanServer getMBeanServer()
+   {
+      JMXKernel jmxKernel = (JMXKernel) bootstrap.getKernel().getRegistry().getEntry("JMXKernel").getTarget();
+      MBeanServer server = jmxKernel.getMbeanServer();
+      return server;
+   }
+   */
+
+
+   public void testSimpleEjb() throws Exception
+   {
+      InitialContext ctx = getInitialContext();
+      DAO dao = (DAO)ctx.lookup("DAOBean/local");
+      Customer cust = dao.createCustomer("Bill");
+      cust = dao.findCustomer("Bill");
+      assertNotNull(cust);
+      assertEquals(cust.getName(), "Bill");
+   }
+
+   public void testDummy()
+   {
+      
+   }
+
+   public static Test suite() throws Exception
+   {
+      return EmbeddedTestCase.getAdaptedSetup(EjbJBossTestCase.class, "ejb-test.jar");
+   }
+
+
+}
\ No newline at end of file

Modified: trunk/embedded/src/test/java/org/jboss/embedded/test/ejb/unit/EjbTestCase.java
===================================================================
--- trunk/embedded/src/test/java/org/jboss/embedded/test/ejb/unit/EjbTestCase.java	2007-01-15 14:54:07 UTC (rev 59645)
+++ trunk/embedded/src/test/java/org/jboss/embedded/test/ejb/unit/EjbTestCase.java	2007-01-15 16:03:44 UTC (rev 59646)
@@ -126,7 +126,8 @@
    public void testSimpleEjb() throws Exception
    {
       DeploymentGroup group = bootstrap.createDeploymentGroup();
-      group.scanClasspath("ejb-test.jar");
+      group.addClasspath("ejb-test.jar");
+      group.process();
 
       outputJNDI();
       InitialContext ctx = new InitialContext();




More information about the jboss-cvs-commits mailing list