/*
 *
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

package org.jboss.ejb3.test.hbm.unit;

//import java.rmi.*;


import java.util.List;
import org.jboss.ejb3.test.hbm.Annotated;
import org.jboss.ejb3.test.hbm.EntityTest;
import org.jboss.ejb3.test.hbm.HBM;
import org.jboss.test.JBossTestCase;
import junit.framework.Test;

/**
 * Sample client for the jboss container.
 *
 * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
 * @version $Id: EntityUnitTestCase.java,v 1.1.2.4 2005/09/14 22:19:07 bill Exp $
 */

public class EntityUnitTestCase
extends JBossTestCase
{
   org.apache.log4j.Category log = getLog();

   static boolean deployed = false;
   static int test = 0;

   public EntityUnitTestCase(String name)
   {

      super(name);

   }

   public void testAll() throws Exception
   {
      EntityTest tester = (EntityTest) getInitialContext().lookup(EntityTest.class.getName());
      tester.createBoth();
      List annotated = tester.findAnnotated();
      assertEquals(annotated.size(), 1);
      Annotated an = (Annotated)annotated.get(0);
      HBM hbm = an.getHbm();
      assertEquals(hbm.getName(), "Gavin");
      assertEquals(tester.findHBM().size(), 1);
   }

   public static Test suite() throws Exception
   {
      return getDeploySetup(EntityUnitTestCase.class, "hbm2-test.par, hbm-test.ejb3");
   }

}
