[jboss-cvs] JBossAS SVN: r77242 - in trunk: profileservice/src/main/org/jboss/profileservice/management/upload/remoting and 15 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 20 09:36:15 EDT 2008


Author: alesj
Date: 2008-08-20 09:36:15 -0400 (Wed, 20 Aug 2008)
New Revision: 77242

Added:
   trunk/testsuite/src/main/org/jboss/test/deployers/AbstractDeploymentTest.java
   trunk/testsuite/src/main/org/jboss/test/deployers/OldAbstractDeploymentTest.java
Removed:
   trunk/testsuite/src/main/org/jboss/test/deployers/AbstractDeploymentTest.java
Modified:
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/DeployHandler.java
   trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java
   trunk/system/src/main/org/jboss/deployers/plugins/managed/TypedManagedDeploymentCreator.java
   trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentID.java
   trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentManager.java
   trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentTarget.java
   trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
   trunk/testsuite/build.xml
   trunk/testsuite/src/main/org/jboss/test/deployers/client/test/ClientDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/client/test/NotClientDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/client/test/NotUnpackedClientDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/client/test/UnpackedClientDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDClientDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDConnectorDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARNoAppXmlDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EmbeddedDatasourceUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/PartUnpackedEARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/UnpackedEARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/EJBDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/NotEJBDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/NotUnpackedEJBDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/UnpackedEJBDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/jbas2904/test/EARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/NotRARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/NotUnpackedRARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/RARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/UnpackedRARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/NotSARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/NotUnpackedSARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/SARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/UnpackedSARDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java
   trunk/testsuite/src/main/org/jboss/test/deployers/web/test/MissingDependencyWEBDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/web/test/NotUnpackedWEBDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/web/test/NotWEBDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/web/test/UnpackedWEBDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/deployers/web/test/WEBDeploymentUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
Log:
[JBAS-5823]; porting deployers tests to Managed API.
Removing deployers tests from smoke-tests - they require profileservice.

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -49,8 +49,7 @@
  * @author Scott.Stark at jboss.org
  * @version $Revision$
  */
-public class DeploymentManagerImpl
-   implements DeploymentManager
+public class DeploymentManagerImpl implements DeploymentManager
 {
    private static Logger log = Logger.getLogger(DeploymentManagerImpl.class);
    private static final String BUNDLE_NAME = "org.jboss.profileservice.management.upload.messages"; //$NON-NLS-1$
@@ -123,32 +122,29 @@
       this.remotingSubsystem = remotingSubsystem;
    }
 
-   public DeploymentProgress distribute(String name, DeploymentPhase phase,
-         URL contentURL)
+   public DeploymentProgress distribute(String name, DeploymentPhase phase, URL contentURL)
    {
+      return distribute(name, phase, contentURL, true);
+   }
+
+   public DeploymentProgress distribute(String name, DeploymentPhase phase, URL contentURL, boolean copyContent)
+   {
       List<DeploymentTarget> targets = getDeploymentTargets();
       SerializableDeploymentID deployment = new SerializableDeploymentID(name, phase, contentURL.toString());
       deployment.setContentURL(contentURL);
+      deployment.setCopyContent(copyContent);
       return new DeploymentProgressImpl(targets, deployment, CommandType.DISTRIBUTE);
    }
 
-   /**
-    * Map from the external name passed to distribute to the uploaded
-    * deployment repository name.
-    * @param names - the list of external deployment names
-    * @return the mapped list of unique names in the deployment repository.
-    */
-   public String[] getRepositoryNames(String[] names, DeploymentPhase phase)
-      throws Exception
+   public String[] getRepositoryNames(String[] names, DeploymentPhase phase) throws Exception
    {
       List<DeploymentTarget> targets = getDeploymentTargets();
-      String[] repositoryNames = targets.get(0).getRepositoryNames(names, phase);
-      return repositoryNames;
+      return targets.get(0).getRepositoryNames(names, phase);
    }
 
    public boolean isRedeploySupported()
    {
-      return true;
+      return false;
    }
 
    public void loadProfile(ProfileKey key) throws Exception
@@ -166,43 +162,41 @@
       deployHandler.setDeploymentRepository(repository);
    }
 
-   public DeploymentProgress redeploy(String name, DeploymentPhase phase,
-         URL contentURL)
+   public DeploymentProgress redeploy(String name, DeploymentPhase phase, URL contentURL)
    {
       List<DeploymentTarget> targets = getDeploymentTargets();
       SerializableDeploymentID deployment = new SerializableDeploymentID(name, phase, null);
       return new DeploymentProgressImpl(targets, deployment, CommandType.REDEPLOY);
    }
 
-   public DeploymentProgress prepare(DeploymentPhase phase, String... names)
-      throws Exception
+   public DeploymentProgress prepare(DeploymentPhase phase, String... names) throws Exception
    {
-      List<DeploymentTarget> targets = getDeploymentTargets();
-      SerializableDeploymentID deployment = new SerializableDeploymentID(names, phase, null);
-      return new DeploymentProgressImpl(targets, deployment, CommandType.PREPARE);
+      return doProgress(CommandType.PREPARE, phase, names);
    }
 
-   public DeploymentProgress start(DeploymentPhase phase, String... names)
-      throws Exception
+   public DeploymentProgress start(DeploymentPhase phase, String... names) throws Exception
    {
-      List<DeploymentTarget> targets = getDeploymentTargets();
-      SerializableDeploymentID deployment = new SerializableDeploymentID(names, phase, null);
-      return new DeploymentProgressImpl(targets, deployment, CommandType.START);
+      return doProgress(CommandType.START, phase, names);
    }
 
-   public DeploymentProgress stop(DeploymentPhase phase, String... names)
-      throws Exception
+   public DeploymentProgress stop(DeploymentPhase phase, String... names) throws Exception
    {
-      List<DeploymentTarget> targets = getDeploymentTargets();
-      SerializableDeploymentID deployment = new SerializableDeploymentID(names, phase, null);
-      return new DeploymentProgressImpl(targets, deployment, CommandType.STOP);
+      return doProgress(CommandType.STOP, phase, names);
    }
 
    public DeploymentProgress undeploy(DeploymentPhase phase, String... names) throws Exception
    {
+      return doProgress(CommandType.UNDEPLOY, phase, names);
+   }
+
+   protected DeploymentProgress doProgress(CommandType type, DeploymentPhase phase, String... names)
+   {
+      if (names == null || names.length == 0)
+         log.warn("Null or empty names.");
+
       List<DeploymentTarget> targets = getDeploymentTargets();
       SerializableDeploymentID deployment = new SerializableDeploymentID(names, phase, null);
-      return new DeploymentProgressImpl(targets, deployment, CommandType.UNDEPLOY);
+      return new DeploymentProgressImpl(targets, deployment, type);
    }
 
    /**

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -22,32 +22,29 @@
 package org.jboss.profileservice.management.upload;
 
 import java.io.Serializable;
-import java.net.URL;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
 
+import org.jboss.deployers.spi.management.deploy.DeploymentID;
 import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
 import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
-import org.jboss.deployers.spi.management.deploy.DeploymentID;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus.StateType;
 import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
 import org.jboss.deployers.spi.management.deploy.ProgressEvent;
 import org.jboss.deployers.spi.management.deploy.ProgressListener;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus.StateType;
 
 /**
  * 
  * @author Scott.Stark at jboss.org
  * @version $Revision:$
  */
-public class DeploymentProgressImpl
-   implements DeploymentProgress, Serializable
+public class DeploymentProgressImpl implements DeploymentProgress, Serializable
 {
    private static final long serialVersionUID = 1;
 
    /** The client side listeners */
-   private transient CopyOnWriteArrayList<ProgressListener> listeners =
-      new CopyOnWriteArrayList<ProgressListener>();
+   private transient CopyOnWriteArrayList<ProgressListener> listeners = new CopyOnWriteArrayList<ProgressListener>();
    private transient DeploymentStatus currentStatus;
    private transient boolean isCancelled;
    /** The targets to distribute to */
@@ -56,8 +53,7 @@
    private DeploymentID deployment;
    private CommandType command;
 
-   public DeploymentProgressImpl(List<DeploymentTarget> targets, DeploymentID deployment,
-         CommandType command)
+   public DeploymentProgressImpl(List<DeploymentTarget> targets, DeploymentID deployment, CommandType command)
    {
       this.targets = targets;
       this.deployment = deployment;
@@ -83,7 +79,7 @@
       switch(command)
       {
          case DISTRIBUTE:
-            doDistribute();
+            distribute();
             break;
          case START:
             start();
@@ -140,7 +136,7 @@
       }
    }
 
-   protected void doDistribute()
+   protected void distribute()
    {
       SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.DEPLOYING);
       status.setMessage("Running distribute to: "+targets);

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -33,8 +33,7 @@
  * @author Scott.Stark at jboss.org
  * @version $Revision:$
  */
-public class SerializableDeploymentID
-   implements DeploymentID, Serializable
+public class SerializableDeploymentID implements DeploymentID, Serializable
 {
    private static final long serialVersionUID = 1;
 
@@ -45,6 +44,7 @@
    private DeploymentPhase phase;
    private String description;
    private URL contentURL;
+   private boolean copyContent;
 
    public SerializableDeploymentID(DeploymentID deployment)
    {
@@ -59,6 +59,7 @@
       this.deploymentNames = names;
       this.phase = phase;
       this.description = description;
+      this.copyContent = true; // by default we copy content
    }
 
    public String[] getNames()
@@ -95,6 +96,16 @@
       this.contentURL = contentURL;
    }
 
+   public boolean isCopyContent()
+   {
+      return copyContent;
+   }
+
+   public void setCopyContent(boolean copyContent)
+   {
+      this.copyContent = copyContent;
+   }
+
    /**
     * An optional deployment archive content stream for the top-level
     * deployment.
@@ -122,6 +133,7 @@
       if(getRepositoryNames() != getNames())
          buffer.append("repositoryNames=").append(Arrays.toString(getRepositoryNames()));
       buffer.append("phase=").append(phase);
+      buffer.append("copyContent=").append(copyContent);
       buffer.append("description=").append(description);
       return buffer.toString();
    }

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/DeployHandler.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/DeployHandler.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/DeployHandler.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -25,7 +25,6 @@
 import java.io.InputStream;
 import java.net.URL;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.Map;
 import javax.management.MBeanServer;
 
@@ -50,8 +49,8 @@
 
 /**
  * A remoting StreamInvocationHandler installed as the profile service subsystem
- * handler and used by the StreamingDeploymentTarget implementation. 
- * 
+ * handler and used by the StreamingDeploymentTarget implementation.
+ *
  * @author Scott.Stark at jboss.org
  * @version $Revision:$
  */
@@ -64,7 +63,7 @@
    private VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance();
    private MainDeployer mainDeployer;
 
-   
+
    public DeploymentRepository getDeploymentRepository()
    {
       return deploymentRepository;
@@ -74,7 +73,7 @@
       this.deploymentRepository = deploymentRepository;
    }
 
-   
+
    public VFSDeploymentFactory getDeploymentFactory()
    {
       return deploymentFactory;
@@ -97,11 +96,10 @@
     * @see DeploymentManager#distribute(String, DeploymentPhase, java.net.URL)
     * @param request - the remoting invocation
     */
-   public Object handleStream(InputStream contentIS, InvocationRequest request)
-      throws Throwable
+   public Object handleStream(InputStream contentIS, InvocationRequest request) throws Throwable
    {
       SerializableDeploymentID deploymentTarget = (SerializableDeploymentID) request.getParameter();
-      log.debug("handleStream, deploymentTarget: "+deploymentTarget);
+      log.debug("handleStream, deploymentTarget: " + deploymentTarget);
       deploymentTarget.setContentIS(contentIS);
       DeploymentPhase phase = deploymentTarget.getPhase();
       String[] names = deploymentTarget.getNames();
@@ -112,7 +110,7 @@
    }
 
    public void addListener(InvokerCallbackHandler arg0)
-   {      
+   {
    }
 
    /**
@@ -178,48 +176,46 @@
       return deploymentRepository.getRepositoryNames(names, phase);
    }
 
-   protected String distribute(DeploymentID dtID)
-      throws Exception
+   protected String[] distribute(DeploymentID dtID) throws Exception
    {
       URL contentURL = dtID.getContentURL();
       DeploymentPhase phase = dtID.getPhase();
-      VirtualFile vf = VFS.getRoot(contentURL);
-      log.info("Begin distribute, "+contentURL);
-      String repoName = null;
-      
+      log.info("Begin distribute, content url: " + contentURL + ", phase: " + phase);
       // Prevent hot deployment scans from seeing in transition deployments
       deploymentRepository.acquireDeploymentContentLock();
       try
       {
+         VirtualFile vf = VFS.getRoot(contentURL);
          VFSDeployment vfsd = createDeployment(vf);
          deploymentRepository.addDeployment(vf.getName(), vfsd, phase);
-         String[] names = {vf.getName()};
-         String[] rnames = deploymentRepository.getRepositoryNames(names, phase);
-         repoName = rnames[0];
+         mainDeployer.addDeployment(vfsd);
+         mainDeployer.process();
+         mainDeployer.checkComplete();         
+         String[] rnames = {vfsd.getName()};
+         log.info("End distribute, " + contentURL);
+         return rnames;
       }
       finally
       {
          deploymentRepository.releaseDeploymentContentLock();
       }
-      log.info("End distribute, "+contentURL);
-      return repoName;
    }
 
-   protected void start(DeploymentID dtID)
-      throws Exception
+   protected void start(DeploymentID dtID) throws Exception
    {
       String[] names = dtID.getNames();
-      log.info("Begin start, "+Arrays.asList(names));
+      DeploymentPhase phase = dtID.getPhase();
+      log.info("Begin start, "+Arrays.asList(names) + ", phase: " + phase);
       // Prevent hot deployment scans from seeing in transition deployments
       deploymentRepository.acquireDeploymentContentLock();
       try
       {
          for(String name : names)
          {
-            VirtualFile vf = deploymentRepository.getDeploymentContent(name, dtID.getPhase());
+            VirtualFile vf = deploymentRepository.getDeploymentContent(name, phase);
             VFSDeployment vfsd = createDeployment(vf);
-            deploymentRepository.addDeployment(name, vfsd, dtID.getPhase());
-            deploymentRepository.unlockDeploymentContent(vf.getPathName(), dtID.getPhase());
+            deploymentRepository.addDeployment(name, vfsd, phase);
+            deploymentRepository.unlockDeploymentContent(vf.getPathName(), phase);
             mainDeployer.addDeployment(vfsd);
             log.info("Scheduling start for: "+vfsd);
          }
@@ -233,31 +229,45 @@
       log.info("End start, "+Arrays.asList(names));
    }
 
-   protected void stop(DeploymentID dtID)
-      throws Exception
+   protected void stop(DeploymentID dtID) throws Exception
    {
       String[] names = dtID.getNames();
-      log.info("stop, "+Arrays.asList(names));
-      for(String name : names)
+      log.info("Stop, "+Arrays.asList(names));
+      deploymentRepository.acquireDeploymentContentLock();
+      try
       {
-         VFSDeployment vfsd = deploymentRepository.getDeployment(name, dtID.getPhase());
-         mainDeployer.removeDeployment(vfsd);
-         log.info("Scheduling stop for: "+vfsd);
+         for(String name : names)
+         {
+            VFSDeployment vfsd = deploymentRepository.getDeployment(name, dtID.getPhase());
+            mainDeployer.removeDeployment(vfsd);
+            log.info("Scheduling stop for: "+vfsd);
+         }
+         mainDeployer.process();
+         mainDeployer.checkComplete();
       }
-      mainDeployer.process();
-      mainDeployer.checkComplete();
+      finally
+      {
+         deploymentRepository.releaseDeploymentContentLock();
+      }
    }
 
-   protected void undeploy(DeploymentID dtID)
-      throws Exception
+   protected void undeploy(DeploymentID dtID) throws Exception
    {
       String[] names = dtID.getNames();
-      log.debug("undeploy, "+Arrays.asList(names));
-      for(String name : names)
+      log.info("Undeploy, "+Arrays.asList(names));
+      deploymentRepository.acquireDeploymentContentLock();
+      try
       {
-         deploymentRepository.removeDeployment(name, dtID.getPhase());
-         log.debug("Undeployed: "+name);
+         for(String name : names)
+         {
+            deploymentRepository.removeDeployment(name, dtID.getPhase());
+            log.info("Undeployed: "+name);
+         }
       }
+      finally
+      {
+         deploymentRepository.releaseDeploymentContentLock();
+      }
    }
 
    /**

Modified: trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java
===================================================================
--- trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -87,25 +87,34 @@
    }
 
    /**
-    * Distribute a deployment to the profile targets
+    * Distribute a deployment to the profile targets.
+    *
     * @param deployment - the encapsulation of the deployment to distribute
+    * @throws Exception for any error
     */
-   public void distribute(DeploymentID deployment)
-      throws Exception
+   public void distribute(DeploymentID deployment) throws Exception
    {
-      URL contentURL = deployment.getContentURL();
-      SerializableDeploymentID sdtID = new SerializableDeploymentID(deployment);
       Client client = getClient();
       try
       {
-         InputStream contentIS = contentURL.openStream();
-         sdtID.setContentIS(contentIS);
          log.debug("Begin distribute: " + deployment);
-         String repositoryName = transferDeployment(client, sdtID);
+         String[] rnames;
+         if (deployment.isCopyContent())
+         {
+            URL contentURL = deployment.getContentURL();
+            SerializableDeploymentID sdtID = new SerializableDeploymentID(deployment);
+            InputStream contentIS = contentURL.openStream();
+            sdtID.setContentIS(contentIS);
+            String repositoryName = transferDeployment(client, sdtID);
+            rnames = new String[]{repositoryName};
+         }
+         else
+         {
+            rnames = (String[])invoke(client, "distribute", createArgs(deployment));
+         }
          // Update the repository names on the deployment
-         String[] rnames = {repositoryName};
          deployment.setRepositoryNames(rnames);
-         log.debug("End distribute, repositoryName: "+repositoryName);
+         log.debug("End distribute, repositoryNames: "+ Arrays.asList(rnames));
       }
       finally
       {
@@ -113,8 +122,7 @@
       }
    }
 
-   public String[] getRepositoryNames(String[] names, DeploymentPhase phase)
-         throws Exception
+   public String[] getRepositoryNames(String[] names, DeploymentPhase phase) throws Exception
    {
       Client client = getClient();
       try
@@ -133,14 +141,12 @@
       }
    }
 
-   public void redeploy(DeploymentID deployment)
-      throws Exception
+   public void redeploy(DeploymentID deployment) throws Exception
    {
       throw new IllegalStateException("redeploy is not yet implemented");
    }
 
-   public void prepare(DeploymentID deployment)
-      throws Exception
+   public void prepare(DeploymentID deployment) throws Exception
    {
       throw new IllegalStateException("prepare is not yet implemented");
    }
@@ -162,9 +168,16 @@
    public void start(DeploymentID dtID) throws Exception
    {
       Client client = getClient();
-      log.debug("Start: " + dtID);
-      invoke(client, "start", createArgs(dtID));
-      log.debug("End start: "+dtID);
+      try
+      {
+         log.debug("Start: " + dtID);
+         invoke(client, "start", createArgs(dtID));
+         log.debug("End start: "+dtID);
+      }
+      finally
+      {
+         client.disconnect();
+      }
    }
 
    /**
@@ -237,16 +250,14 @@
     * @return the profile service repository unique name
     * @throws Exception
     */
-   private String transferDeployment(Client client, SerializableDeploymentID sdtID)
-      throws Exception
+   private String transferDeployment(Client client, SerializableDeploymentID sdtID) throws Exception
    {
       InputStream is = sdtID.getContentIS();
       try
       {
          // This return value depends on the proxy type
          InvocationResponse response = (InvocationResponse) client.invoke(is, sdtID);
-         String repositoryName = (String) response.getResponse();
-         return repositoryName;
+         return (String) response.getResponse();
       }
       catch(Error e)
       {
@@ -268,8 +279,7 @@
       }
    }
 
-   private Object invoke(Client client, String name, Map<?, ?> args)
-      throws Exception
+   private Object invoke(Client client, String name, Map<?, ?> args) throws Exception
    {
       try
       {

Modified: trunk/system/src/main/org/jboss/deployers/plugins/managed/TypedManagedDeploymentCreator.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/plugins/managed/TypedManagedDeploymentCreator.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/system/src/main/org/jboss/deployers/plugins/managed/TypedManagedDeploymentCreator.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -41,6 +41,7 @@
 import org.jboss.managed.api.ManagedObject;
 import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
 import org.jboss.managed.api.annotation.ManagementDeployment;
+import org.jboss.managed.api.annotation.ManagementConstants;
 import org.jboss.managed.plugins.ManagedDeploymentImpl;
 
 /**
@@ -87,14 +88,15 @@
       {
          if(phase == null)
             phase = mdAnnotation.phase();
-         if(mdAnnotation.simpleName().length() > 0)
+         String mdaSimpleName = mdAnnotation.simpleName();
+         if(mdaSimpleName.length() > 0 && ManagementConstants.GENERATED.equals(mdaSimpleName) == false)
             simpleName = mdAnnotation.simpleName();
          types = mdAnnotation.types();
       }
       if( phase == null )
          phase = DeploymentPhase.APPLICATION;
-      ManagedDeployment md = new ManagedDeploymentImpl(unit.getName(), simpleName,
-            phase, parent, unitMOs);
+      
+      ManagedDeployment md = new ManagedDeploymentImpl(unit.getName(), simpleName, phase, parent, unitMOs);
       if(types.length > 0)
       {
          for(String type : types)

Modified: trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentID.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentID.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentID.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -68,6 +68,12 @@
    public URL getContentURL();
 
    /**
+    * Do we copy content or jut ref it.
+    * @return
+    */
+   boolean isCopyContent();
+
+   /**
     * Get a description of the deployment
     *
     * @return the identifier

Modified: trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentManager.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentManager.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentManager.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.net.URL;
 
 import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-import org.jboss.profileservice.spi.NoSuchProfileException;
 import org.jboss.profileservice.spi.ProfileKey;
 
 /**
@@ -40,10 +39,9 @@
     * for future operations.
     * 
     * @param key - the profile to load
-    * @throws NoSuchProfileException
+    * @throws Exception for any error
     */
-   public void loadProfile(ProfileKey key)
-      throws Exception;
+   public void loadProfile(ProfileKey key) throws Exception;
 
    /**
     * Add raw deployment content to the profile.
@@ -53,50 +51,85 @@
     * @param contentURL - URL for obtaining the deployment archive
     * @return DeploymentProgress progress object for the deployment
     */
-   public DeploymentProgress distribute(String name, DeploymentPhase phase,
-         URL contentURL);
+   @Deprecated
+   public DeploymentProgress distribute(String name, DeploymentPhase phase, URL contentURL);
 
    /**
+    * Add raw deployment content to the profile.
+    *
+    * @param name phase unique name
+    * @param phase the phase this deployment applies to
+    * @param contentURL - URL for obtaining the deployment archive
+    * @param copyContent should we copy content or just reference it
+    * @return DeploymentProgress progress object for the deployment
+    */
+   public DeploymentProgress distribute(String name, DeploymentPhase phase, URL contentURL, boolean copyContent);
+
+   /**
     * Map from the external name passed to distribute to the uploaded
     * deployment repository name.
+    * 
     * @param names - the list of external deployment names
+    * @param phase the deployment phase
     * @return the mapped list of unique names in the deployment repository.
+    * @throws Exception for any error
     */
-   public String[] getRepositoryNames(String[] names, DeploymentPhase phase)
-      throws Exception;
+   public String[] getRepositoryNames(String[] names, DeploymentPhase phase) throws Exception;
 
+   /**
+    * Is redeploy supported.
+    *
+    * @return true if redeploy suported
+    */
    public boolean isRedeploySupported();
+
    /**
-    * 
-    * @param name
-    * @param phase
-    * @param contentURL
-    * @return
+    * Do redeploy.
+    *
+    * @param name the deployment to redeploy
+    * @param phase the deployment phase
+    * @param contentURL deployment's url
+    * @return a DeploymentProgress used to run and track the redeploy progress.
     */
-   public DeploymentProgress redeploy(String name, DeploymentPhase phase,
-         URL contentURL);
+   public DeploymentProgress redeploy(String name, DeploymentPhase phase, URL contentURL);
 
    /**
-    * Validate a set of deployments through their dependency analysis phase.
-    * @param phase
+    * Prepare a set of deployments through their dependency analysis phase.
+    *
+    * @param phase the deployment phase
     * @param names the unique names of the deployments within the phase to prepare
     * @return a DeploymentProgress used to run and track the prepare progress.
-    * @throws Exception
+    * @throws Exception for any error
     */
-   public DeploymentProgress prepare(DeploymentPhase phase, String... names)
-      throws Exception;
+   public DeploymentProgress prepare(DeploymentPhase phase, String... names) throws Exception;
 
    /**
-    * Start a previously distributed deployment
-    * @param phase
+    * Start a previously distributed deployment.
+    *
+    * @param phase the deployment phase
+    * @param names the unique names of the deployments within the phase to start
+    * @return a DeploymentProgress used to run and track the start progress.
+    * @throws Exception for any error
+    */
+   public DeploymentProgress start(DeploymentPhase phase, String... names) throws Exception;
+
+   /**
+    * Stop a previously started deployment.
+    *
+    * @param phase the deployment phase
+    * @param names the unique names of the deployments within the phase to stop
+    * @return a DeploymentProgress used to run and track the stop progress.
+    * @throws Exception for any error
+    */
+   public DeploymentProgress stop(DeploymentPhase phase, String... names) throws Exception;
+
+   /**
+    * Undeploy a previously distributed deployment.
+    *
+    * @param phase the deployment phase
     * @param names the unique names of the deployments within the phase to prepare
-    * @return
-    * @throws Exception
+    * @return a DeploymentProgress used to run and track the prepare progress.
+    * @throws Exception for any error
     */
-   public DeploymentProgress start(DeploymentPhase phase, String... names)
-      throws Exception;
-   public DeploymentProgress stop(DeploymentPhase phase, String... names)
-      throws Exception;
-   public DeploymentProgress undeploy(DeploymentPhase phase, String... names)
-      throws Exception;
+   public DeploymentProgress undeploy(DeploymentPhase phase, String... names) throws Exception;
 }

Modified: trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentTarget.java
===================================================================
--- trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentTarget.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/system/src/main/org/jboss/deployers/spi/management/deploy/DeploymentTarget.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -21,8 +21,6 @@
  */
 package org.jboss.deployers.spi.management.deploy;
 
-import java.net.URL;
-
 import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
 
 /**

Modified: trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/system/src/main/org/jboss/profileservice/spi/DeploymentRepository.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -27,7 +27,6 @@
 import java.net.URISyntaxException;
 import java.util.Collection;
 import java.util.Set;
-import java.util.zip.ZipInputStream;
 
 import org.jboss.deployers.spi.attachments.Attachments;
 import org.jboss.deployers.vfs.spi.client.VFSDeployment;
@@ -68,16 +67,23 @@
    public String addDeploymentContent(String vfsPath, InputStream contentIS, DeploymentPhase phase)
       throws IOException;
 
+   /**
+    * Get repository names.
+    *
+    * @param names the names
+    * @param phase the deployment phase
+    * @return full repository names
+    * @throws IOException for any error
+    */
    public String[] getRepositoryNames(String[] names, DeploymentPhase phase)
       throws IOException;
 
    /**
     * Get the repository virtual file for the given deployment name
     * @param name - the unique virtual file URI name as returned by addDeploymentContent
-    * @param phase - the phase of the deployment as it relates to when the
-    *    deployment is loaded
+    * @param phase - the phase of the deployment as it relates to when the deployment is loaded
     * @return the deployment content virtual file
-    * @throws IOException
+    * @throws IOException for any error
     */
    public VirtualFile getDeploymentContent(String name, DeploymentPhase phase)
       throws IOException, URISyntaxException;

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -301,18 +301,20 @@
             break;
       }
       // get cached version
-      URI uri = new URI(name);
-      VirtualFile content = getCachedApplicationVF(uri);
+      File contentRoot = getPhaseDir(phase);
+      if(contentRoot == null)
+         throw new FileNotFoundException("Failed to obtain content dir for phase: "+phase);
+      File contentFile = new File(contentRoot, name);
+      VirtualFile content = getCachedApplicationVF(contentFile);
       if(content == null || content.exists() == false)
          throw new FileNotFoundException("Failed to find content for: "+name);
       return content;
    }
 
-   public String[] getRepositoryNames(String[] names, DeploymentPhase phase)
-      throws IOException
+   public String[] getRepositoryNames(String[] names, DeploymentPhase phase) throws IOException
    {
-      ArrayList<String> tmp = new ArrayList<String>();
-      URI rootURI = this.getDeploymentURI(phase);
+      List<String> tmp = new ArrayList<String>();
+      URI rootURI = getDeploymentURI(phase);
       VirtualFile root = VFS.getRoot(rootURI);
       for(String name : names)
       {
@@ -754,16 +756,16 @@
       this.deployerCtxs.put(vfsPath, ctx);
    }
 
-   protected void addApplication(String vfsPath, VFSDeployment ctx)
-      throws Exception
+   protected void addApplication(String vfsPath, VFSDeployment ctx) throws Exception
    {
       if(vfsPath.startsWith("test"))
          log.error("Should not see a test... key");
+
+      log.info("Adding application: " + vfsPath + " / " + ctx);
       this.applicationCtxs.put(vfsPath, ctx);
    }
 
-   protected VFSDeployment getBootstrap(String vfsPath)
-      throws Exception
+   protected VFSDeployment getBootstrap(String vfsPath) throws Exception
    {
       VFSDeployment ctx = bootstrapCtxs.get(vfsPath);
       if( ctx == null )
@@ -771,8 +773,7 @@
       return ctx;
    }
 
-   protected Collection<VFSDeployment> getBootstraps()
-      throws Exception
+   protected Collection<VFSDeployment> getBootstraps() throws Exception
    {
       return bootstrapCtxs.values();
    }
@@ -826,17 +827,16 @@
       return deployerCtxs.values();
    }
 
-   protected VFSDeployment getApplication(String vfsPath)
-      throws Exception
+   protected VFSDeployment getApplication(String vfsPath) throws Exception
    {
       VFSDeployment ctx = applicationCtxs.get(vfsPath);
       if( ctx == null )
       {
          // Try to find the simple name
-         log.debug("Failed to find application for: "+vfsPath+", scanning for simple name");
+         log.info("Failed to find application for: "+vfsPath+", scanning for simple name");
          for(VFSDeployment deployment : applicationCtxs.values())
          {
-            log.info("Checking: "+deployment.getSimpleName());
+            log.debug("Checking: "+deployment.getSimpleName());
             if(deployment.getSimpleName().equals(vfsPath))
             {
                log.debug("Matched to simple name of deployment:"+deployment);
@@ -845,7 +845,10 @@
             }
          }
          if(ctx == null)
+         {
+            log.debug("Failed to find application for: "+vfsPath+", available: " + applicationCtxs.values());
             throw new NoSuchDeploymentException(vfsPath);
+         }
       }
       return ctx;
    }
@@ -860,10 +863,10 @@
    {
       VFSDeployment vfsDeployment = bootstrapCtxs.get(vfsPath);
       if(vfsDeployment == null)
-         throw new IllegalStateException("Deployment not found: " + vfsPath);
-      File bootstrapFile = new File(bootstrapDir, vfsDeployment.getSimpleName());
-      if( bootstrapFile.delete() == false )
-         throw new IOException("Failed to delete: "+bootstrapFile);
+         throw new IllegalStateException("Deployment not found: " + vfsPath + ", available: " + bootstrapCtxs.values());
+      VirtualFile root = vfsDeployment.getRoot();
+      if(root.delete() == false)
+         throw new IOException("Failed to delete: " + root);
       return bootstrapCtxs.remove(vfsPath);
    }
 
@@ -872,22 +875,18 @@
    {
       VFSDeployment vfsDeployment = deployerCtxs.get(vfsPath);
       if(vfsDeployment == null)
-         throw new IllegalStateException("Deployment not found: " + vfsPath);
-      File deployerFile = new File(deployersDir, vfsDeployment.getSimpleName());
-      if( Files.delete(deployerFile) == false )
-         throw new IOException("Failed to delete: "+deployerFile);
+         throw new IllegalStateException("Deployment not found: " + vfsPath + ", available: " + deployerCtxs.values());
+      VirtualFile root = vfsDeployment.getRoot();
+      if(root.delete() == false)
+         throw new IOException("Failed to delete: " + root);
       return deployerCtxs.remove(vfsPath);
    }
-   protected VFSDeployment removeApplication(String vfsPath) throws IOException
+   protected VFSDeployment removeApplication(String vfsPath) throws Exception
    {
-      VFSDeployment vfsDeployment = applicationCtxs.get(vfsPath);
-      if(vfsDeployment == null)
-         throw new IllegalStateException("Deployment not found: " + vfsPath);
-      // Find the application dir
-      File applicationDir = applicationDirs[0];
-      File deploymentFile = new File(applicationDir, vfsDeployment.getSimpleName());
-      if( Files.delete(deploymentFile) == false )
-         throw new IOException("Failed to delete: "+deploymentFile);
+      VFSDeployment vfsDeployment = getApplication(vfsPath);
+      VirtualFile root = vfsDeployment.getRoot();
+      if(root.delete() == false)
+         throw new IOException("Failed to delete: " + root);
       return this.applicationCtxs.remove(vfsPath);
    }
    protected void setBootstrapURI(URI uri)

Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/build.xml	2008-08-20 13:36:15 UTC (rev 77242)
@@ -824,9 +824,25 @@
   </patternset>
   <patternset id="profileservice.includes">
     <include name="org/jboss/test/profileservice/test/*TestCase.class"/>
+    <!-- deployers + seam -->
+    <include name="org/jboss/test/deployers/client/test/*UnitTestCase.class"/>
+    <include name="org/jboss/test/deployers/ear/test/*UnitTestCase.class"/>
+    <include name="org/jboss/test/deployers/ejb/test/*UnitTestCase.class"/>
+    <include name="org/jboss/test/deployers/rar/test/*UnitTestCase.class"/>
+    <include name="org/jboss/test/deployers/sar/test/*UnitTestCase.class"/>
+    <include name="org/jboss/test/deployers/web/test/*UnitTestCase.class"/>
+    <include name="org/jboss/test/deployers/seam/test/*UnitTestCase.class"/>
   </patternset>
   <patternset id="profileservice.excludes">
     <exclude name="org/jboss/test/profileservice/test/*TestCase.class"/>
+    <!-- deployers + seam -->
+    <exclude name="org/jboss/test/deployers/client/test/*UnitTestCase.class"/>
+    <exclude name="org/jboss/test/deployers/ear/test/*UnitTestCase.class"/>
+    <exclude name="org/jboss/test/deployers/ejb/test/*UnitTestCase.class"/>
+    <exclude name="org/jboss/test/deployers/rar/test/*UnitTestCase.class"/>
+    <exclude name="org/jboss/test/deployers/sar/test/*UnitTestCase.class"/>
+    <exclude name="org/jboss/test/deployers/web/test/*UnitTestCase.class"/>
+    <exclude name="org/jboss/test/deployers/seam/test/*UnitTestCase.class"/>
   </patternset>
   <patternset id="springdeployer.includes">
     <include name="org/jboss/test/spring/test/*TestCase.class"/>
@@ -1310,13 +1326,6 @@
                <exclude name="org/jboss/test/cts/test/StatefulSessionLocalUnitTestCase.class"/>
                <exclude name="org/jboss/test/cts/test/StatefulSessionUnitTestCase.class"/>
                <exclude name="org/jboss/test/cts/test/LongWaitStatefulSessionUnitTestCase.class"/>
-               <include name="org/jboss/test/deployers/client/test/*UnitTestCase.class"/>
-               <include name="org/jboss/test/deployers/ear/test/*UnitTestCase.class"/>
-               <include name="org/jboss/test/deployers/ejb/test/*UnitTestCase.class"/>
-               <include name="org/jboss/test/deployers/rar/test/*UnitTestCase.class"/>
-               <include name="org/jboss/test/deployers/sar/test/*UnitTestCase.class"/>
-               <include name="org/jboss/test/deployers/seam/test/*UnitTestCase.class"/>
-               <include name="org/jboss/test/deployers/web/test/*UnitTestCase.class"/>
                <include name="org/jboss/test/ejb3/test/SimpleSessionUnitTestCase.class"/>
                <include name="org/jboss/test/jbossmessaging/test/JBossMessagingJoramUnitTestCase.class"/>
                <include name="org/jboss/test/jca/test/BaseConnectionManagerUnitTestCase.class"/>

Deleted: trunk/testsuite/src/main/org/jboss/test/deployers/AbstractDeploymentTest.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/AbstractDeploymentTest.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/AbstractDeploymentTest.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -1,258 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * 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.test.deployers;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import javax.management.MBeanServerConnection;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployment.MainDeployerMBean;
-import org.jboss.test.JBossTestCase;
-
-/**
- * Abstract deployment test.
- * 
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class AbstractDeploymentTest extends JBossTestCase
-{
-   public static final String ear1Deployment = "testdeployers-ear1.ear";
-   public static final String earAltDDDeployment = "testdeployers-ear-altdd.ear";
-   public static final String earAltDDClientDeployment = "testdeployers-ear-altdd-client.ear";
-   public static final String earAltDDConnectorDeployment = "testdeployers-ear-altdd-connector.ear";
-   public static final String ear1DeploymentUnpacked = "unpacked-ear1.ear";
-   public static final String ear2DeploymentUnpacked = "unpacked-ear2.ear";
-   public static final String earNoAppXml = "testdeployers-ear-noappxml.ear";
-   public static final String bean1Deployment = "testdeployers-bean1ejb.jar";
-   public static final String bean1DeploymentUnpacked = "unpacked-bean1ejb.jar";
-   public static final String notBean1Deployment = "bean1ejb-not.ajar";
-   public static final String notBean1DeploymentUnpacked = "unpacked-bean1ejb-not.ajar";
-   public static final String web1Deployment = "testdeployers-web1.war";
-   public static final String web1DeploymentUnpacked = "unpacked-web1.war";
-   public static final String notWeb1Deployment = "web1-not.awar";
-   public static final String notWeb1DeploymentUnpacked = "unpacked-web1-not.awar";
-   public static final String rar1Deployment = "testdeployers-mcf1.rar";
-   public static final String rarInvalidDeployment = "testdeployers-invalidmcf.rar";
-   public static final String rar1DeploymentUnpacked = "unpacked-mcf1.rar";
-   public static final String notRar1Deployment = "mcf1-not.arar";
-   public static final String notRar1DeploymentUnpacked = "unpacked-mcf1-not.arar";
-   public static final String rarjar1Deployment = "testdeployers-mcf1.jar";
-   public static final String client1Deployment = "testdeployers-client1.jar";
-   public static final String client1DeploymentUnpacked = "unpacked-client1.jar";
-   public static final String notClient1Deployment = "client1-not.ajar";
-   public static final String notClient1DeploymentUnpacked = "unpacked-client1-not.ajar";
-   public static final String ds1Deployment = "testdeployers-mcf1-ds.xml";
-   public static final String ds1DeploymentUnpacked = "unpacked-mcf1-ds.xml";
-   public static final String ds1DeploymentUnpacked2 = "unpacked2-mcf1-ds.xml";
-   public static final String service1Deployment = "testdeployers-1-service.xml";
-   public static final String sar1Deployment = "testdeployers-mbean1.sar";
-   public static final String sar1DeploymentUnpacked = "unpacked-mbean1.sar";
-   public static final String notSar1Deployment = "mbean1-not.asar";
-   public static final String notSar1DeploymentUnpacked = "unpacked-mbean1-not.asar";
-   
-   protected <T> T invokeMainDeployer(String methodName, Object[] args, String[] sig, Class<T> clazz) throws Exception
-   {
-      if (clazz == null)
-         throw new IllegalArgumentException("Null class.");
-
-      MBeanServerConnection server = getServer();
-      Object result = server.invoke(MainDeployerMBean.OBJECT_NAME, methodName, args, sig);
-      return clazz.cast(result);
-   }
-
-   protected DeploymentUnit assertDeployed(String deployment) throws Exception
-   {
-      DeploymentUnit result = getDeploymentUnit(deployment);
-      assertNotNull("Unable to retrieve deployment info for " + deployment, result);
-      return result;
-   }
-
-   protected void assertDeployed(String deployment, Set expected) throws Exception
-   {
-      DeploymentUnit topInfo = assertDeployed(deployment);
-      CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
-      visitor.start(topInfo);
-      assertTrue("Expected subdeployments: " + expected, expected.isEmpty());
-   }
-
-   @Deprecated
-   protected void assertNotDeployed(String deployment) throws Exception
-   {
-      DeploymentUnit result = getDeploymentUnit(deployment);
-      assertNull("Should not be deployed " + result, result);
-   }
-   
-   protected DeploymentUnit getDeploymentUnit(String deployment) throws Exception
-   {
-      URL deployURL = getDeployURL(deployment);
-      String[] sig = { URL.class.getName() };
-      Object[] args = {deployURL};
-      return invokeMainDeployer("getDeploymentUnit", args, sig, DeploymentUnit.class);
-   }
-   
-   protected boolean isDeployed(String deployment) throws Exception
-   {
-      URL deployURL = getDeployURL(deployment);
-      String[] sig = { URL.class.getName() };
-      Object[] args = {deployURL};
-      return invokeMainDeployer("isDeployed", args, sig, Boolean.class);
-   }
-
-   protected void assertNoChildContexts(String deployment) throws Exception
-   {
-      DeploymentUnit unit = getDeploymentUnit(deployment);
-      assertChildContexts(unit);
-   }
-
-   protected void assertChildContexts(String deployment, String... paths) throws Exception
-   {
-      DeploymentUnit unit = getDeploymentUnit(deployment);
-      assertChildContexts(unit, paths);
-   }
-
-   protected void assertChildContexts(DeploymentUnit unit, String... paths)
-   {
-      List<String> expected = new ArrayList<String>();
-      if (paths != null)
-      {
-         for (String path : paths)
-            expected.add(path);
-      }
-      List<DeploymentUnit> children = unit.getChildren();
-      assertNotNull(children);
-      assertEquals("Expected " + expected + " got " + simplePrint(children), expected.size(), children.size());
-
-      for (String path : expected)
-      {
-         boolean found = false;
-         for (DeploymentUnit child : children)
-         {
-            if (path.equals(child.getRelativePath()))
-               found = true;
-         }
-         if (found == false)
-            fail("Expected " + path + " in " + children);
-      }
-   }
-
-   protected static String simplePrint(List<DeploymentUnit> children)
-   {
-      StringBuilder builder = new StringBuilder();
-      boolean first = false;
-      builder.append("[");
-      for (DeploymentUnit child : children)
-      {
-         if (first == false)
-            first = true;
-         else
-            builder.append(", ");
-         builder.append(child.getRelativePath());
-      }
-      builder.append("]");
-      return builder.toString();
-   }
-
-   public AbstractDeploymentTest(String test)
-   {
-      super(test);
-   }
-   
-   public static class DeploymentInfoVisitor
-   {
-      public void start(DeploymentUnit topLevel)
-      {
-         doVisit(topLevel);
-      }
-      
-      protected void doVisit(DeploymentUnit info)
-      {
-         visit(info);
-
-         List<DeploymentUnit> subDeployments = info.getChildren();
-         if (subDeployments == null || subDeployments.size() == 0)
-            return;
-
-         for (DeploymentUnit child : subDeployments)
-         {
-            doVisit(child);
-         }
-      }
-      
-      public void visit(DeploymentUnit info)
-      {
-      }
-   }
-   
-   public class CheckExpectedDeploymentInfoVisitor extends DeploymentInfoVisitor
-   {
-      protected Set expected;
-      
-      public CheckExpectedDeploymentInfoVisitor(Set expected)
-      {
-         this.expected = expected;
-      }
-      
-      public void visit(DeploymentUnit info)
-      {
-         String shortName = shortNameFromDeploymentName(info.getName());
-         log.info("Found deployment " + shortName);
-         boolean found = expected.remove(shortName);
-         if (found == false)
-            fail(shortName + " not expected, or duplicate?");
-         else
-         {
-            boolean deployed;
-            try
-            {
-               deployed = isDeployed(info.getName());
-            }
-            catch (Exception e)
-            {
-               throw new RuntimeException(e);
-            }
-            assertTrue("Should be fully deployed: " + shortName, deployed);
-         }
-      }
-   }
-   /**
-    * A utility method that takes a deployment unit name and strips it down to the base war
-    * name without the .war suffix.
-    * @param name - the DeploymentUnit name.
-    * @return the short name
-    */
-   public static String shortNameFromDeploymentName(String name)
-   {
-      String shortName = name.trim();
-      String[] parts = name.split("/|!");
-      if( parts.length > 1 )
-      {
-         shortName = parts[parts.length-1];
-      }
-      return shortName;
-   }
-
-}

Added: trunk/testsuite/src/main/org/jboss/test/deployers/AbstractDeploymentTest.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/AbstractDeploymentTest.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/AbstractDeploymentTest.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -0,0 +1,416 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.test.deployers;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Set;
+import javax.management.MBeanServerConnection;
+import javax.naming.InitialContext;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.deployers.spi.management.ManagementView;
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
+import org.jboss.deployers.spi.management.deploy.ProgressListener;
+import org.jboss.deployers.spi.management.deploy.ProgressEvent;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.logging.Logger;
+import org.jboss.managed.api.ManagedDeployment;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.JBossTestSetup;
+import org.jboss.virtual.VFS;
+
+/**
+ * Abstract deployment test.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AbstractDeploymentTest extends JBossTestCase
+{
+   protected static Logger staticLog = Logger.getLogger(AbstractDeploymentTest.class);
+
+   public static final String ear1Deployment = "testdeployers-ear1.ear";
+   public static final String earAltDDDeployment = "testdeployers-ear-altdd.ear";
+   public static final String earAltDDClientDeployment = "testdeployers-ear-altdd-client.ear";
+   public static final String earAltDDConnectorDeployment = "testdeployers-ear-altdd-connector.ear";
+   public static final String ear1DeploymentUnpacked = "unpacked-ear1.ear";
+   public static final String ear2DeploymentUnpacked = "unpacked-ear2.ear";
+   public static final String earNoAppXml = "testdeployers-ear-noappxml.ear";
+   public static final String bean1Deployment = "testdeployers-bean1ejb.jar";
+   public static final String bean1DeploymentUnpacked = "unpacked-bean1ejb.jar";
+   public static final String notBean1Deployment = "bean1ejb-not.ajar";
+   public static final String notBean1DeploymentUnpacked = "unpacked-bean1ejb-not.ajar";
+   public static final String web1Deployment = "testdeployers-web1.war";
+   public static final String web1DeploymentUnpacked = "unpacked-web1.war";
+   public static final String notWeb1Deployment = "web1-not.awar";
+   public static final String notWeb1DeploymentUnpacked = "unpacked-web1-not.awar";
+   public static final String rar1Deployment = "testdeployers-mcf1.rar";
+   public static final String rarInvalidDeployment = "testdeployers-invalidmcf.rar";
+   public static final String rar1DeploymentUnpacked = "unpacked-mcf1.rar";
+   public static final String notRar1Deployment = "mcf1-not.arar";
+   public static final String notRar1DeploymentUnpacked = "unpacked-mcf1-not.arar";
+   public static final String rarjar1Deployment = "testdeployers-mcf1.jar";
+   public static final String client1Deployment = "testdeployers-client1.jar";
+   public static final String client1DeploymentUnpacked = "unpacked-client1.jar";
+   public static final String notClient1Deployment = "client1-not.ajar";
+   public static final String notClient1DeploymentUnpacked = "unpacked-client1-not.ajar";
+   public static final String ds1Deployment = "testdeployers-mcf1-ds.xml";
+   public static final String ds1DeploymentUnpacked = "unpacked-mcf1-ds.xml";
+   public static final String ds1DeploymentUnpacked2 = "unpacked2-mcf1-ds.xml";
+   public static final String service1Deployment = "testdeployers-1-service.xml";
+   public static final String sar1Deployment = "testdeployers-mbean1.sar";
+   public static final String sar1DeploymentUnpacked = "unpacked-mbean1.sar";
+   public static final String notSar1Deployment = "mbean1-not.asar";
+   public static final String notSar1DeploymentUnpacked = "unpacked-mbean1-not.asar";
+
+   protected static Test getManagedDeployment(final Class clazz, final String jarNames) throws Exception
+   {
+      return getManagedDeployment(clazz, jarNames, false);
+   }
+
+   protected static Test getManagedDeployment(final Class clazz, final String jarNames, final boolean copyContent) throws Exception
+   {
+      TestSuite suite = new TestSuite();
+      suite.addTest(new TestSuite(clazz));
+      return new JBossTestSetup(clazz, suite)
+      {
+         private DeploymentManager dm;
+
+         protected DeploymentManager getDeploymentManager() throws Exception
+         {
+            if (dm == null)
+            {
+               InitialContext ctx = new InitialContext();
+               ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
+               dm = ps.getDeploymentManager();
+               dm.loadProfile(new ProfileKey("profileservice"));
+               return dm;
+            }
+            return dm;
+         }
+
+         protected void setUp() throws Exception
+         {
+            super.setUp();
+            deploymentException = null;
+
+            try
+            {
+               this.delegate.init();
+
+               // no secure handling
+
+               if (jarNames == null)
+                  return;
+
+               String[] names = jarNames.split(",");
+               for (String name : names)
+               {
+                  DeploymentProgress distribute = getDeploymentManager().distribute(name, ManagedDeployment.DeploymentPhase.APPLICATION, getManagedURL(name), copyContent);
+                  //distribute.addProgressListener(LOG_PROGRESS_LISTENER);
+                  distribute.run();
+                  checkProgress(distribute);
+
+                  if (copyContent)
+                  {
+                     DeploymentProgress start = getDeploymentManager().start(ManagedDeployment.DeploymentPhase.APPLICATION, name);
+                     start.run();
+                     checkProgress(start);
+                  }
+
+                  staticLog.info("Deployed package: " + name);
+               }
+            }
+            catch (Exception ex)
+            {
+               // Throw this in testServerFound() instead.
+               deploymentException = ex;
+            }
+         }
+
+         protected void tearDown() throws Exception
+         {
+            if (jarNames == null)
+               return;
+
+            String[] names = jarNames.split(",");
+
+            DeploymentProgress stop = getDeploymentManager().stop(ManagedDeployment.DeploymentPhase.APPLICATION, names);
+            stop.run();
+            checkProgress(stop);
+
+            if (copyContent)
+            {
+               DeploymentProgress undeploy = getDeploymentManager().undeploy(ManagedDeployment.DeploymentPhase.APPLICATION, names);
+               undeploy.run();
+               checkProgress(undeploy);
+            }
+            
+            // no secure handling
+
+            super.tearDown();
+         }
+      };
+   }
+
+   protected static void checkProgress(DeploymentProgress progress) throws Exception
+   {
+      DeploymentStatus status = progress.getDeploymentStatus();
+      Throwable failure = status.getFailure();
+      if (failure != null)
+      {
+         staticLog.debug(status);
+         throw new Exception(failure);
+      }
+   }
+
+   protected static URL getManagedURL(final String filename) throws MalformedURLException
+   {
+      // First see if it is already a complete url.
+      try
+      {
+         return new URL(filename);
+      }
+      catch (MalformedURLException e)
+      {
+         staticLog.debug(filename + " is not a valid URL, " + e.getMessage());
+      }
+
+      // OK, lets see if we can figure out what it might be.
+      String deployDir = System.getProperty("jbosstest.deploy.dir");
+      if (deployDir == null)
+      {
+         deployDir = "output/lib";
+      }
+      String url = deployDir + "/" + filename;
+      staticLog.debug("Testing file: " + url);
+      // try to canonicalize the strings a bit.
+      File file = new File(url);
+      if (file.exists())
+      {
+         staticLog.debug(file.getAbsolutePath() + " is a valid file");
+         return file.toURL();
+      }
+      else
+      {
+         staticLog.debug("File does not exist, creating url: " + url);
+         return new URL(url);
+      }
+   }
+
+   protected <T> T invokeMainDeployer(String methodName, Object[] args, String[] sig, Class<T> clazz) throws Exception
+   {
+      if (clazz == null)
+         throw new IllegalArgumentException("Null class.");
+
+      MBeanServerConnection server = getServer();
+      Object result = server.invoke(MainDeployerMBean.OBJECT_NAME, methodName, args, sig);
+      return clazz.cast(result);
+   }
+
+   protected String getProfileName()
+   {
+      return "profileservice";
+   }
+
+   protected ManagementView getManagementView() throws Exception
+   {
+      String profileName = getProfileName();
+      InitialContext ctx = getInitialContext();
+      ProfileService ps = (ProfileService)ctx.lookup("ProfileService");
+      ManagementView activeView = ps.getViewManager();
+      ProfileKey defaultKey = new ProfileKey(profileName);
+      activeView.loadProfile(defaultKey);
+      // Init the VFS to setup the vfs* protocol handlers
+      VFS.init();
+      return activeView;
+   }
+
+   protected ManagedDeployment getDeploymentUnit(String deployment) throws Exception
+   {
+      ManagementView mv = getManagementView();
+      return mv.getDeployment(deployment, ManagedDeployment.DeploymentPhase.APPLICATION);
+   }
+
+   protected ManagedDeployment assertDeployed(String deployment) throws Exception
+   {
+      ManagedDeployment result = getDeploymentUnit(deployment);
+      assertNotNull("Unable to retrieve deployment info for " + deployment, result);
+      return result;
+   }
+
+   protected void assertDeployed(String deployment, Set expected) throws Exception
+   {
+      ManagedDeployment topInfo = assertDeployed(deployment);
+      CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
+      visitor.start(topInfo);
+      assertTrue("Expected subdeployments: " + expected, expected.isEmpty());
+   }
+
+   @Deprecated
+   protected void assertNotDeployed(String deployment) throws Exception
+   {
+      ManagedDeployment result = getDeploymentUnit(deployment);
+      assertNull("Should not be deployed " + result, result);
+   }
+
+   protected boolean isDeployed(String deployment) throws Exception
+   {
+      ManagementView mv = getManagementView();
+      ManagedDeployment md = mv.getDeployment(deployment, ManagedDeployment.DeploymentPhase.APPLICATION);
+      return (md != null);
+   }
+
+   protected void assertNoChildContexts(String deployment) throws Exception
+   {
+      ManagedDeployment unit = getDeploymentUnit(deployment);
+      assertChildContexts(unit);
+   }
+
+   protected void assertChildContexts(String deployment, String... paths) throws Exception
+   {
+      ManagedDeployment unit = getDeploymentUnit(deployment);
+      assertChildContexts(unit, paths);
+   }
+
+   protected void assertChildContexts(ManagedDeployment unit, String... paths)
+   {
+      List<String> expected = new ArrayList<String>();
+      if (paths != null)
+         expected.addAll(Arrays.asList(paths));
+
+      List<ManagedDeployment> children = unit.getChildren();
+      assertNotNull(children);
+      assertEquals("Expected " + expected + " got " + simplePrint(children), expected.size(), children.size());
+
+      for (String path : expected)
+      {
+         boolean found = false;
+         for (ManagedDeployment child : children)
+         {
+            if (path.equals(child.getSimpleName()))
+               found = true;
+         }
+         if (found == false)
+            fail("Expected " + path + " in " + children);
+      }
+   }
+
+   protected static String simplePrint(List<ManagedDeployment> children)
+   {
+      StringBuilder builder = new StringBuilder();
+      boolean first = false;
+      builder.append("[");
+      for (ManagedDeployment child : children)
+      {
+         if (first == false)
+            first = true;
+         else
+            builder.append(", ");
+         builder.append(child.getSimpleName());
+      }
+      builder.append("]");
+      return builder.toString();
+   }
+
+   public AbstractDeploymentTest(String test)
+   {
+      super(test);
+   }
+
+   public static class DeploymentInfoVisitor
+   {
+      public void start(ManagedDeployment topLevel)
+      {
+         doVisit(topLevel);
+      }
+
+      protected void doVisit(ManagedDeployment info)
+      {
+         visit(info);
+
+         List<ManagedDeployment> subDeployments = info.getChildren();
+         if (subDeployments == null || subDeployments.size() == 0)
+            return;
+
+         for (ManagedDeployment child : subDeployments)
+         {
+            doVisit(child);
+         }
+      }
+
+      public void visit(ManagedDeployment info)
+      {
+      }
+   }
+
+   public class CheckExpectedDeploymentInfoVisitor extends DeploymentInfoVisitor
+   {
+      protected Set expected;
+
+      public CheckExpectedDeploymentInfoVisitor(Set expected)
+      {
+         this.expected = expected;
+      }
+
+      public void visit(ManagedDeployment info)
+      {
+         String shortName = info.getSimpleName();
+         log.info("Found deployment " + shortName);
+         boolean found = expected.remove(shortName);
+         if (found == false)
+            fail(shortName + " not expected, or duplicate?");
+         else if (info.getParent() == null) // only top levels
+         {
+            boolean deployed;
+            try
+            {
+               deployed = isDeployed(info.getSimpleName());
+            }
+            catch (Exception e)
+            {
+               throw new RuntimeException(e);
+            }
+            assertTrue("Should be fully deployed: " + shortName, deployed);
+         }
+      }
+   }
+
+   protected static class LogProgressListener implements ProgressListener
+   {
+      public void progressEvent(ProgressEvent eventInfo)
+      {
+         staticLog.fatal(eventInfo);
+      }
+   }
+
+   private static final ProgressListener LOG_PROGRESS_LISTENER = new LogProgressListener();
+}
\ No newline at end of file

Copied: trunk/testsuite/src/main/org/jboss/test/deployers/OldAbstractDeploymentTest.java (from rev 77008, trunk/testsuite/src/main/org/jboss/test/deployers/AbstractDeploymentTest.java)
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/OldAbstractDeploymentTest.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/OldAbstractDeploymentTest.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -0,0 +1,259 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.test.deployers;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import javax.management.MBeanServerConnection;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.test.JBossTestCase;
+
+/**
+ * Abstract deployment test.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+ at Deprecated
+public class OldAbstractDeploymentTest extends JBossTestCase
+{
+   public static final String ear1Deployment = "testdeployers-ear1.ear";
+   public static final String earAltDDDeployment = "testdeployers-ear-altdd.ear";
+   public static final String earAltDDClientDeployment = "testdeployers-ear-altdd-client.ear";
+   public static final String earAltDDConnectorDeployment = "testdeployers-ear-altdd-connector.ear";
+   public static final String ear1DeploymentUnpacked = "unpacked-ear1.ear";
+   public static final String ear2DeploymentUnpacked = "unpacked-ear2.ear";
+   public static final String earNoAppXml = "testdeployers-ear-noappxml.ear";
+   public static final String bean1Deployment = "testdeployers-bean1ejb.jar";
+   public static final String bean1DeploymentUnpacked = "unpacked-bean1ejb.jar";
+   public static final String notBean1Deployment = "bean1ejb-not.ajar";
+   public static final String notBean1DeploymentUnpacked = "unpacked-bean1ejb-not.ajar";
+   public static final String web1Deployment = "testdeployers-web1.war";
+   public static final String web1DeploymentUnpacked = "unpacked-web1.war";
+   public static final String notWeb1Deployment = "web1-not.awar";
+   public static final String notWeb1DeploymentUnpacked = "unpacked-web1-not.awar";
+   public static final String rar1Deployment = "testdeployers-mcf1.rar";
+   public static final String rarInvalidDeployment = "testdeployers-invalidmcf.rar";
+   public static final String rar1DeploymentUnpacked = "unpacked-mcf1.rar";
+   public static final String notRar1Deployment = "mcf1-not.arar";
+   public static final String notRar1DeploymentUnpacked = "unpacked-mcf1-not.arar";
+   public static final String rarjar1Deployment = "testdeployers-mcf1.jar";
+   public static final String client1Deployment = "testdeployers-client1.jar";
+   public static final String client1DeploymentUnpacked = "unpacked-client1.jar";
+   public static final String notClient1Deployment = "client1-not.ajar";
+   public static final String notClient1DeploymentUnpacked = "unpacked-client1-not.ajar";
+   public static final String ds1Deployment = "testdeployers-mcf1-ds.xml";
+   public static final String ds1DeploymentUnpacked = "unpacked-mcf1-ds.xml";
+   public static final String ds1DeploymentUnpacked2 = "unpacked2-mcf1-ds.xml";
+   public static final String service1Deployment = "testdeployers-1-service.xml";
+   public static final String sar1Deployment = "testdeployers-mbean1.sar";
+   public static final String sar1DeploymentUnpacked = "unpacked-mbean1.sar";
+   public static final String notSar1Deployment = "mbean1-not.asar";
+   public static final String notSar1DeploymentUnpacked = "unpacked-mbean1-not.asar";
+   
+   protected <T> T invokeMainDeployer(String methodName, Object[] args, String[] sig, Class<T> clazz) throws Exception
+   {
+      if (clazz == null)
+         throw new IllegalArgumentException("Null class.");
+
+      MBeanServerConnection server = getServer();
+      Object result = server.invoke(MainDeployerMBean.OBJECT_NAME, methodName, args, sig);
+      return clazz.cast(result);
+   }
+
+   protected DeploymentUnit assertDeployed(String deployment) throws Exception
+   {
+      DeploymentUnit result = getDeploymentUnit(deployment);
+      assertNotNull("Unable to retrieve deployment info for " + deployment, result);
+      return result;
+   }
+
+   protected void assertDeployed(String deployment, Set expected) throws Exception
+   {
+      DeploymentUnit topInfo = assertDeployed(deployment);
+      CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
+      visitor.start(topInfo);
+      assertTrue("Expected subdeployments: " + expected, expected.isEmpty());
+   }
+
+   @Deprecated
+   protected void assertNotDeployed(String deployment) throws Exception
+   {
+      DeploymentUnit result = getDeploymentUnit(deployment);
+      assertNull("Should not be deployed " + result, result);
+   }
+   
+   protected DeploymentUnit getDeploymentUnit(String deployment) throws Exception
+   {
+      URL deployURL = getDeployURL(deployment);
+      String[] sig = { URL.class.getName() };
+      Object[] args = {deployURL};
+      return invokeMainDeployer("getDeploymentUnit", args, sig, DeploymentUnit.class);
+   }
+   
+   protected boolean isDeployed(String deployment) throws Exception
+   {
+      URL deployURL = getDeployURL(deployment);
+      String[] sig = { URL.class.getName() };
+      Object[] args = {deployURL};
+      return invokeMainDeployer("isDeployed", args, sig, Boolean.class);
+   }
+
+   protected void assertNoChildContexts(String deployment) throws Exception
+   {
+      DeploymentUnit unit = getDeploymentUnit(deployment);
+      assertChildContexts(unit);
+   }
+
+   protected void assertChildContexts(String deployment, String... paths) throws Exception
+   {
+      DeploymentUnit unit = getDeploymentUnit(deployment);
+      assertChildContexts(unit, paths);
+   }
+
+   protected void assertChildContexts(DeploymentUnit unit, String... paths)
+   {
+      List<String> expected = new ArrayList<String>();
+      if (paths != null)
+      {
+         for (String path : paths)
+            expected.add(path);
+      }
+      List<DeploymentUnit> children = unit.getChildren();
+      assertNotNull(children);
+      assertEquals("Expected " + expected + " got " + simplePrint(children), expected.size(), children.size());
+
+      for (String path : expected)
+      {
+         boolean found = false;
+         for (DeploymentUnit child : children)
+         {
+            if (path.equals(child.getRelativePath()))
+               found = true;
+         }
+         if (found == false)
+            fail("Expected " + path + " in " + children);
+      }
+   }
+
+   protected static String simplePrint(List<DeploymentUnit> children)
+   {
+      StringBuilder builder = new StringBuilder();
+      boolean first = false;
+      builder.append("[");
+      for (DeploymentUnit child : children)
+      {
+         if (first == false)
+            first = true;
+         else
+            builder.append(", ");
+         builder.append(child.getRelativePath());
+      }
+      builder.append("]");
+      return builder.toString();
+   }
+
+   public OldAbstractDeploymentTest(String test)
+   {
+      super(test);
+   }
+   
+   public static class DeploymentInfoVisitor
+   {
+      public void start(DeploymentUnit topLevel)
+      {
+         doVisit(topLevel);
+      }
+      
+      protected void doVisit(DeploymentUnit info)
+      {
+         visit(info);
+
+         List<DeploymentUnit> subDeployments = info.getChildren();
+         if (subDeployments == null || subDeployments.size() == 0)
+            return;
+
+         for (DeploymentUnit child : subDeployments)
+         {
+            doVisit(child);
+         }
+      }
+      
+      public void visit(DeploymentUnit info)
+      {
+      }
+   }
+   
+   public class CheckExpectedDeploymentInfoVisitor extends DeploymentInfoVisitor
+   {
+      protected Set expected;
+      
+      public CheckExpectedDeploymentInfoVisitor(Set expected)
+      {
+         this.expected = expected;
+      }
+      
+      public void visit(DeploymentUnit info)
+      {
+         String shortName = shortNameFromDeploymentName(info.getName());
+         log.info("Found deployment " + shortName);
+         boolean found = expected.remove(shortName);
+         if (found == false)
+            fail(shortName + " not expected, or duplicate?");
+         else
+         {
+            boolean deployed;
+            try
+            {
+               deployed = isDeployed(info.getName());
+            }
+            catch (Exception e)
+            {
+               throw new RuntimeException(e);
+            }
+            assertTrue("Should be fully deployed: " + shortName, deployed);
+         }
+      }
+   }
+   /**
+    * A utility method that takes a deployment unit name and strips it down to the base war
+    * name without the .war suffix.
+    * @param name - the DeploymentUnit name.
+    * @return the short name
+    */
+   public static String shortNameFromDeploymentName(String name)
+   {
+      String shortName = name.trim();
+      String[] parts = name.split("/|!");
+      if( parts.length > 1 )
+      {
+         shortName = parts[parts.length-1];
+      }
+      return shortName;
+   }
+
+}


Property changes on: trunk/testsuite/src/main/org/jboss/test/deployers/OldAbstractDeploymentTest.java
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/client/test/ClientDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/client/test/ClientDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/client/test/ClientDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -35,7 +34,6 @@
  */
 public class ClientDeploymentUnitTestCase extends AbstractDeploymentTest
 {
-  
    public void testClientDeployment() throws Exception
    {
       final HashSet expected = new HashSet();
@@ -51,6 +49,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(ClientDeploymentUnitTestCase.class, client1Deployment);
+      return getManagedDeployment(ClientDeploymentUnitTestCase.class, client1Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/client/test/NotClientDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/client/test/NotClientDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/client/test/NotClientDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -45,6 +45,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(NotClientDeploymentUnitTestCase.class, notClient1Deployment);
+      return getManagedDeployment(NotClientDeploymentUnitTestCase.class, notClient1Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/client/test/NotUnpackedClientDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/client/test/NotUnpackedClientDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/client/test/NotUnpackedClientDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -22,7 +22,6 @@
 package org.jboss.test.deployers.client.test;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -36,8 +35,7 @@
   
    public void testNotClientDeployment() throws Exception
    {
-      // FIXME - once EjbParsingClient is fixed
-      assertFalse(isDeployed(notClient1DeploymentUnpacked));
+      assertTrue(isDeployed(notClient1DeploymentUnpacked));
    }
    
    public NotUnpackedClientDeploymentUnitTestCase(String test)
@@ -47,6 +45,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(NotUnpackedClientDeploymentUnitTestCase.class, notClient1DeploymentUnpacked);
+      return getManagedDeployment(NotUnpackedClientDeploymentUnitTestCase.class, notClient1DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/client/test/UnpackedClientDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/client/test/UnpackedClientDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/client/test/UnpackedClientDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -51,6 +50,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(UnpackedClientDeploymentUnitTestCase.class, client1DeploymentUnpacked);
+      return getManagedDeployment(UnpackedClientDeploymentUnitTestCase.class, client1DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDClientDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDClientDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDClientDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -22,13 +22,11 @@
 package org.jboss.test.deployers.ear.test;
 
 import java.util.Properties;
-
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -39,7 +37,7 @@
 {
    public static Test suite() throws Exception
    {
-      return getDeploySetup(EARAltDDClientDeploymentUnitTestCase.class, earAltDDClientDeployment);
+      return getManagedDeployment(EARAltDDClientDeploymentUnitTestCase.class, earAltDDClientDeployment);
    }
 
    public EARAltDDClientDeploymentUnitTestCase(String test)

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDConnectorDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDConnectorDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDConnectorDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -25,9 +25,8 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.test.deployers.AbstractDeploymentTest;
+import org.jboss.managed.api.ManagedDeployment;
 
 /**
  * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
@@ -37,7 +36,7 @@
 {
    public static Test suite() throws Exception
    {
-      return getDeploySetup(EARAltDDConnectorDeploymentUnitTestCase.class, earAltDDConnectorDeployment);
+      return getManagedDeployment(EARAltDDConnectorDeploymentUnitTestCase.class, earAltDDConnectorDeployment);
    }
 
    public EARAltDDConnectorDeploymentUnitTestCase(String test)
@@ -51,8 +50,8 @@
        expected.add(earAltDDConnectorDeployment);
        expected.add(rarInvalidDeployment);
        
-       DeploymentUnit topInfo = assertDeployed(earAltDDConnectorDeployment);
-       CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
+       ManagedDeployment topInfo = assertDeployed(earAltDDConnectorDeployment);
+       CheckExpectedDeploymentInfoVisitor visitor = new AbstractDeploymentTest.CheckExpectedDeploymentInfoVisitor(expected);
        visitor.start(topInfo);
        assertTrue("Expected subdeployments: " + expected, expected.isEmpty());
    }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARAltDDDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -21,14 +21,10 @@
   */
 package org.jboss.test.deployers.ear.test;
 
-import java.util.HashSet;
-
 import javax.naming.InitialContext;
 import javax.rmi.PortableRemoteObject;
 
 import junit.framework.Test;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.test.deployers.AbstractDeploymentTest;
 import org.jboss.test.deployers.ejb.bean1.Bean1Home;
 import org.jboss.test.deployers.ejb.bean1.Bean1Remote;
@@ -41,7 +37,7 @@
 {
    public static Test suite() throws Exception
    {
-      return getDeploySetup(EARAltDDDeploymentUnitTestCase.class, earAltDDDeployment);
+      return getManagedDeployment(EARAltDDDeploymentUnitTestCase.class, earAltDDDeployment);
    }
 
    public EARAltDDDeploymentUnitTestCase(String test)

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,8 +24,8 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.test.deployers.AbstractDeploymentTest;
+import org.jboss.managed.api.ManagedDeployment;
 
 /**
  * A test that deploys everything in an EAR.
@@ -49,8 +49,8 @@
       expected.add(service1Deployment);
       expected.add(sar1Deployment);
       
-      DeploymentUnit topInfo = assertDeployed(ear1Deployment);
-      CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
+      ManagedDeployment topInfo = assertDeployed(ear1Deployment);
+      CheckExpectedDeploymentInfoVisitor visitor = new AbstractDeploymentTest.CheckExpectedDeploymentInfoVisitor(expected);
       visitor.start(topInfo);
       assertTrue("Expected subdeployments: " + expected, expected.isEmpty());
    }
@@ -62,6 +62,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(EARDeploymentUnitTestCase.class, ear1Deployment);
+      return getManagedDeployment(EARDeploymentUnitTestCase.class, ear1Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARNoAppXmlDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARNoAppXmlDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EARNoAppXmlDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,8 +24,8 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.test.deployers.AbstractDeploymentTest;
+import org.jboss.managed.api.ManagedDeployment;
 
 /**
  * A test that deploys everything in a JavaEE 5 EAR without using an
@@ -51,8 +51,8 @@
       expected.add(rarjar1Deployment);
       expected.add(client1Deployment);
 
-      DeploymentUnit topInfo = assertDeployed(earNoAppXml);
-      CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
+      ManagedDeployment topInfo = assertDeployed(earNoAppXml);
+      AbstractDeploymentTest.CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
       visitor.start(topInfo);
       assertTrue("Expected subdeployments: " + expected, expected.isEmpty());
    }
@@ -64,6 +64,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(EARNoAppXmlDeploymentUnitTestCase.class, earNoAppXml);
+      return getManagedDeployment(EARNoAppXmlDeploymentUnitTestCase.class, earNoAppXml);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EmbeddedDatasourceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EmbeddedDatasourceUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/EmbeddedDatasourceUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,8 +24,8 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.test.deployers.AbstractDeploymentTest;
+import org.jboss.managed.api.ManagedDeployment;
 
 /**
  * JBAS-4548. Tests proper deployment of an ear that includes EJB2 entities 
@@ -47,8 +47,8 @@
       expected.add(jbas4548_ds);
       expected.add(jbas4548_ejb);
       
-      DeploymentUnit topInfo = assertDeployed(jbas4548_ear);
-      CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
+      ManagedDeployment topInfo = assertDeployed(jbas4548_ear);
+      CheckExpectedDeploymentInfoVisitor visitor = new AbstractDeploymentTest.CheckExpectedDeploymentInfoVisitor(expected);
       visitor.start(topInfo);
       assertTrue("Expected subdeployments: " + expected, expected.isEmpty());
    }
@@ -60,6 +60,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(EmbeddedDatasourceUnitTestCase.class, jbas4548_ear);
+      return getManagedDeployment(EmbeddedDatasourceUnitTestCase.class, jbas4548_ear);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/PartUnpackedEARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/PartUnpackedEARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/PartUnpackedEARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,7 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.managed.api.ManagedDeployment;
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -49,8 +49,8 @@
       expected.add(service1Deployment);
       expected.add(sar1Deployment);
       
-      DeploymentUnit topInfo = assertDeployed(ear1DeploymentUnpacked);
-      CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
+      ManagedDeployment topInfo = assertDeployed(ear1DeploymentUnpacked);
+      AbstractDeploymentTest.CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
       visitor.start(topInfo);
       assertTrue("Expected subdeployments: " + expected, expected.isEmpty());
    }
@@ -62,6 +62,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(PartUnpackedEARDeploymentUnitTestCase.class, ear1DeploymentUnpacked);
+      return getManagedDeployment(PartUnpackedEARDeploymentUnitTestCase.class, ear1DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/UnpackedEARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/UnpackedEARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ear/test/UnpackedEARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -59,6 +58,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(UnpackedEARDeploymentUnitTestCase.class, ear2DeploymentUnpacked);
+      return getManagedDeployment(UnpackedEARDeploymentUnitTestCase.class, ear2DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/EJBDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/EJBDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/EJBDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -51,6 +50,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(EJBDeploymentUnitTestCase.class, bean1Deployment);
+      return getManagedDeployment(EJBDeploymentUnitTestCase.class, bean1Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/NotEJBDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/NotEJBDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/NotEJBDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -22,7 +22,6 @@
 package org.jboss.test.deployers.ejb.test;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -46,6 +45,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(NotEJBDeploymentUnitTestCase.class, notBean1Deployment);
+      return getManagedDeployment(NotEJBDeploymentUnitTestCase.class, notBean1Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/NotUnpackedEJBDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/NotUnpackedEJBDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/NotUnpackedEJBDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -22,7 +22,6 @@
 package org.jboss.test.deployers.ejb.test;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -46,6 +45,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(NotUnpackedEJBDeploymentUnitTestCase.class, notBean1DeploymentUnpacked);
+      return getManagedDeployment(NotUnpackedEJBDeploymentUnitTestCase.class, notBean1DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/UnpackedEJBDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/UnpackedEJBDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/ejb/test/UnpackedEJBDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -51,6 +50,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(UnpackedEJBDeploymentUnitTestCase.class, bean1DeploymentUnpacked);
+      return getManagedDeployment(UnpackedEJBDeploymentUnitTestCase.class, bean1DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/jbas2904/test/EARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/jbas2904/test/EARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/jbas2904/test/EARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -14,8 +14,8 @@
 import javax.management.ObjectName;
 
 import junit.framework.Test;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.test.deployers.AbstractDeploymentTest;
+import org.jboss.managed.api.ManagedDeployment;
 
 /**
  * A test for JBAB2904
@@ -33,18 +33,18 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(EARDeploymentUnitTestCase.class,
+      return getManagedDeployment(EARDeploymentUnitTestCase.class,
             "testdeployers-jbas2904.ear");
    }
 
    public void testEARDeployment() throws Exception
    {
-      DeploymentUnit topInfo = assertDeployed("testdeployers-jbas2904.ear");
+      ManagedDeployment topInfo = assertDeployed("testdeployers-jbas2904.ear");
       // Expected ordering of the subdeployments
-      List<DeploymentUnit> actualModules = topInfo.getChildren();
+      List<ManagedDeployment> actualModules = topInfo.getChildren();
       List<String> expectedList = new ArrayList<String>(actualModules.size());
       System.out.println("Expected Deployment Ordering -------> ");
-      for (DeploymentUnit child : actualModules)
+      for (ManagedDeployment child : actualModules)
       {
          String moduleName = child.getSimpleName();
          expectedList.add(moduleName);

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/NotRARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/NotRARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/NotRARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -22,7 +22,6 @@
 package org.jboss.test.deployers.rar.test;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -46,6 +45,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(NotRARDeploymentUnitTestCase.class, notRar1Deployment);
+      return getManagedDeployment(NotRARDeploymentUnitTestCase.class, notRar1Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/NotUnpackedRARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/NotUnpackedRARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/NotUnpackedRARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -22,7 +22,6 @@
 package org.jboss.test.deployers.rar.test;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -46,6 +45,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(NotUnpackedRARDeploymentUnitTestCase.class, notRar1DeploymentUnpacked);
+      return getManagedDeployment(NotUnpackedRARDeploymentUnitTestCase.class, notRar1DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/RARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/RARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/RARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -52,6 +51,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(RARDeploymentUnitTestCase.class, rar1Deployment);
+      return getManagedDeployment(RARDeploymentUnitTestCase.class, rar1Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/UnpackedRARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/UnpackedRARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/rar/test/UnpackedRARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -52,6 +51,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(UnpackedRARDeploymentUnitTestCase.class, rar1DeploymentUnpacked);
+      return getManagedDeployment(UnpackedRARDeploymentUnitTestCase.class, rar1DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/NotSARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/NotSARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/NotSARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -22,7 +22,6 @@
 package org.jboss.test.deployers.sar.test;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -46,6 +45,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(NotSARDeploymentUnitTestCase.class, notSar1Deployment);
+      return getManagedDeployment(NotSARDeploymentUnitTestCase.class, notSar1Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/NotUnpackedSARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/NotUnpackedSARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/NotUnpackedSARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -22,7 +22,6 @@
 package org.jboss.test.deployers.sar.test;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -46,6 +45,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(NotUnpackedSARDeploymentUnitTestCase.class, notSar1DeploymentUnpacked);
+      return getManagedDeployment(NotUnpackedSARDeploymentUnitTestCase.class, notSar1DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/SARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/SARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/SARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -51,6 +50,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(SARDeploymentUnitTestCase.class, sar1Deployment);
+      return getManagedDeployment(SARDeploymentUnitTestCase.class, sar1Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/UnpackedSARDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/UnpackedSARDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/sar/test/UnpackedSARDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -51,6 +50,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(UnpackedSARDeploymentUnitTestCase.class, sar1DeploymentUnpacked);
+      return getManagedDeployment(UnpackedSARDeploymentUnitTestCase.class, sar1DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/seam/test/SeamExampleTest.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -21,9 +21,9 @@
  */
 package org.jboss.test.deployers.seam.test;
 
+import java.net.URL;
 import java.util.HashSet;
 import java.util.Set;
-import java.net.URL;
 
 import junit.framework.Test;
 import org.jboss.test.deployers.AbstractDeploymentTest;
@@ -68,7 +68,7 @@
       String deployments = String.format(exampleEar, name);
       if (includeDS)
          deployments = String.format(exampleDS, name) + "," + deployments;
-      return getDeploySetup(clazz, deployments);
+      return getManagedDeployment(clazz, deployments);
    }
 
    protected static String getExampleName(Class clazz)

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/web/test/MissingDependencyWEBDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/web/test/MissingDependencyWEBDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/web/test/MissingDependencyWEBDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -25,7 +25,6 @@
 import java.util.Set;
 
 import junit.framework.Test;
-
 import org.jboss.deployers.client.spi.IncompleteDeploymentException;
 import org.jboss.deployers.client.spi.MissingDependency;
 import org.jboss.test.deployers.AbstractDeploymentTest;
@@ -87,6 +86,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(MissingDependencyWEBDeploymentUnitTestCase.class, jbas4763Deployment);
+      return getManagedDeployment(MissingDependencyWEBDeploymentUnitTestCase.class, jbas4763Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/web/test/NotUnpackedWEBDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/web/test/NotUnpackedWEBDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/web/test/NotUnpackedWEBDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -22,7 +22,6 @@
 package org.jboss.test.deployers.web.test;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -46,6 +45,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(NotUnpackedWEBDeploymentUnitTestCase.class, notWeb1DeploymentUnpacked);
+      return getManagedDeployment(NotUnpackedWEBDeploymentUnitTestCase.class, notWeb1DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/web/test/NotWEBDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/web/test/NotWEBDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/web/test/NotWEBDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -22,7 +22,6 @@
 package org.jboss.test.deployers.web.test;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -46,6 +45,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(NotWEBDeploymentUnitTestCase.class, notWeb1Deployment);
+      return getManagedDeployment(NotWEBDeploymentUnitTestCase.class, notWeb1Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/web/test/UnpackedWEBDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/web/test/UnpackedWEBDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/web/test/UnpackedWEBDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -51,6 +50,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(UnpackedWEBDeploymentUnitTestCase.class, web1DeploymentUnpacked);
+      return getManagedDeployment(UnpackedWEBDeploymentUnitTestCase.class, web1DeploymentUnpacked);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/deployers/web/test/WEBDeploymentUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/deployers/web/test/WEBDeploymentUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/deployers/web/test/WEBDeploymentUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 
 import junit.framework.Test;
-
 import org.jboss.test.deployers.AbstractDeploymentTest;
 
 /**
@@ -51,6 +50,6 @@
 
    public static Test suite() throws Exception
    {
-      return getDeploySetup(WEBDeploymentUnitTestCase.class, web1Deployment);
+      return getManagedDeployment(WEBDeploymentUnitTestCase.class, web1Deployment);
    }
 }

Modified: trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2008-08-20 13:32:54 UTC (rev 77241)
+++ trunk/testsuite/src/main/org/jboss/test/profileservice/test/ProfileServiceUnitTestCase.java	2008-08-20 13:36:15 UTC (rev 77242)
@@ -148,26 +148,25 @@
          String sname = paths[paths.length - 2] + "/" + paths[paths.length - 1];
     	   simpleNames.add(sname);
       }
-      log.info("Deployment simple names: "+simpleNames);
+      log.info("Deployment simple names: " + simpleNames);
       // Validate some well known deployments
       String[] expectedNames = {
          // TODO: JBAS-5689 "conf/bootstrap.xml", 
          "conf/jboss-service.xml",
          "deployers/jbossweb.deployer/",
-    		"deployers/ear-deployer-beans.xml",
+    		"deployers/ear-deployer-jboss-beans.xml",
     		"deployers/jbossws.deployer/",
-    		"deployers/ejb-deployer-beans.xml",
+    		"deployers/ejb-deployer-jboss-beans.xml",
     		"deployers/ejb3.deployer/",
     		"deployers/jboss-aop-jboss5.deployer/",
-    		"deployers/security-deployer-beans.xml",
+    		"deployers/security-deployer-jboss-beans.xml",
     		"deployers/jboss-jca.deployer/",
     		"deploy/hsqldb-ds.xml",
     		"deploy/jboss-local-jdbc.rar",
     		"deploy/jboss-xa-jdbc.rar",
     		"deploy/jbossjca-service.xml",
     		"deploy/jbossws.sar/",
-    		"messaging/jms-ds.xml",
-    		"messaging/messaging-beans.xml",
+    		"deploy/messaging/",
     		"deploy/jms-ra.rar",
     		"deploy/jmx-console.war/",
     		"deploy/jmx-invoker-service.xml",
@@ -181,7 +180,7 @@
          if(simpleNames.contains(name) == false)
             missingNames.add(name);
       }
-      assertEquals("There are no missing names: "+missingNames, 0, missingNames.size());
+      assertEquals("There are missing names: "+missingNames + ", available: " + simpleNames, 0, missingNames.size());
    }
 
    public void testTemplateNames()




More information about the jboss-cvs-commits mailing list