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

import java.util.HashSet;

import junit.framework.Test;

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

/**
 * A test that deploys EJBs.
 * 
 * @author <a href="adrian@jboss.com">Adrian Brock</a>
 * @version $Revision: 1.1.2.3 $
 */
public class EJBDeploymentUnitTestCase extends AbstractDeploymentTest
{
  
   public void testEJBDeployment() throws Exception
   {
      final HashSet expected = new HashSet();
      expected.add(bean1Deployment);
      
      DeploymentInfo topInfo = assertDeployed(bean1Deployment);
      CheckExpectedDeploymentInfoVisitor visitor = new CheckExpectedDeploymentInfoVisitor(expected);
      visitor.start(topInfo);
      assertTrue("Expected subdeployments: " + expected, expected.isEmpty());
   }
   
   public EJBDeploymentUnitTestCase(String test)
   {
      super(test);
   }

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