/*
 * JBoss, the OpenSource J2EE webOS
 * 
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.test.deployers.ear.test;

import java.util.HashSet;

import junit.framework.Test;

import org.jboss.deployment.DeploymentInfo;
import org.jboss.test.deployers.AbstractDeploymentTest;

/**
 * A test that deploys everything in an EAR.
 * 
 * @author <a href="adrian@jboss.com">Adrian Brock</a>
 * @version $Revision: 1.1.2.1 $
 */
public class PartUnpackedEARDeploymentUnitTestCase extends AbstractDeploymentTest
{
  
   public void testEARDeployment() throws Exception
   {
      final HashSet expected = new HashSet();
      expected.add(ear1DeploymentUnpacked);
      expected.add(bean1Deployment);
      expected.add(web1Deployment);
      expected.add(rar1Deployment);
      expected.add(rarjar1Deployment);
      expected.add(client1Deployment);
      expected.add(ds1DeploymentUnpacked);
      expected.add(service1Deployment);
      expected.add(sar1Deployment);
      
      DeploymentInfo topInfo = assertDeployed(ear1DeploymentUnpacked);
      CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
      visitor.start(topInfo);
      assertTrue("Expected subdeployments: " + expected, expected.isEmpty());
   }
   
   public PartUnpackedEARDeploymentUnitTestCase(String test)
   {
      super(test);
   }

   public static Test suite() throws Exception
   {
      return getDeploySetup(PartUnpackedEARDeploymentUnitTestCase.class, ear1DeploymentUnpacked);
   }
}
