[jboss-cvs] JBossAS SVN: r86375 - projects/ejb3/trunk/endpoint-deployer/src/test/java/org/jboss/ejb3/endpoint/deployers/test/simple/unit.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 26 03:29:30 EDT 2009


Author: wolfc
Date: 2009-03-26 03:29:29 -0400 (Thu, 26 Mar 2009)
New Revision: 86375

Modified:
   projects/ejb3/trunk/endpoint-deployer/src/test/java/org/jboss/ejb3/endpoint/deployers/test/simple/unit/DeployEndpointTestCase.java
Log:
EJBTHREE-1786: directory deployment within a single deploy action

Modified: projects/ejb3/trunk/endpoint-deployer/src/test/java/org/jboss/ejb3/endpoint/deployers/test/simple/unit/DeployEndpointTestCase.java
===================================================================
--- projects/ejb3/trunk/endpoint-deployer/src/test/java/org/jboss/ejb3/endpoint/deployers/test/simple/unit/DeployEndpointTestCase.java	2009-03-26 04:56:14 UTC (rev 86374)
+++ projects/ejb3/trunk/endpoint-deployer/src/test/java/org/jboss/ejb3/endpoint/deployers/test/simple/unit/DeployEndpointTestCase.java	2009-03-26 07:29:29 UTC (rev 86375)
@@ -89,12 +89,7 @@
       
       // TODO: another hack that simulates profile service going through deploy dir
       VirtualFile deployDir = VFS.getRoot(findDirURI("src/test/resources/deploy"));
-      List<VirtualFile> candidates = deployDir.getChildren();
-      for(VirtualFile candidate : candidates)
-      {
-         deploy(candidate.toURL(), false);
-      }
-      mainDeployer.checkComplete();
+      deployDir(deployDir);
       
       // TODO:
       deployResource("ejb3-interceptors-aop.xml");
@@ -116,19 +111,28 @@
    
    protected static void deploy(URL url) throws DeploymentException, IOException
    {
-      deploy(url, true);
-   }
-   
-   protected static void deploy(URL url, boolean checkComplete) throws DeploymentException, IOException
-   {
       log.info("Deploying " + url);
       VirtualFile root = VFS.getRoot(url);
       VFSDeployment deployment = VFSDeploymentFactory.getInstance().createVFSDeployment(root);
       mainDeployer.deploy(deployment);
-      if(checkComplete)
-         mainDeployer.checkComplete(deployment);
    }
    
+   /**
+    * Simulate the going through one deploy directory.
+    * @param deployDir  the deploy directory       
+    * @throws DeploymentException
+    * @throws IOException
+    */
+   protected static void deployDir(VirtualFile deployDir) throws DeploymentException, IOException
+   {
+      log.info("Deploying directory " + deployDir);
+      List<VirtualFile> files = deployDir.getChildren();
+      VFSDeployment deployments[] = new VFSDeployment[files.size()];
+      for(int i = 0; i < deployments.length; i++)
+         deployments[i] = VFSDeploymentFactory.getInstance().createVFSDeployment(files.get(i));
+      mainDeployer.deploy(deployments);
+   }
+   
    private static String findDir(String path) throws IOException
    {
       File file = new File(path);




More information about the jboss-cvs-commits mailing list