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

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

//import java.rmi.*;


import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
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: LocalUnitTestCase.java,v 1.2.2.5 2005/09/14 22:19:08 bill Exp $
 */

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

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

   public LocalUnitTestCase(String name)
   {

      super(name);

   }

   public void testSimple() throws Exception
   {
	   MBeanServerConnection server = getServer();
      ObjectName testerName = new ObjectName("jboss.ejb3:service=Tester,test=initial");
      Object[] params = {};
      String[] sig = {};
      server.invoke(testerName, "test", params, sig);
      server.invoke(testerName, "statefulTest", params, sig);
      server.invoke(testerName, "testInterceptors", params, sig);
      server.invoke(testerName, "testCallbacks", params, sig);
      server.invoke(testerName, "testSLSBCollocation", params, sig);
      server.invoke(testerName, "testSFSBCollocation", params, sig);
   }

   public void testTx() throws Exception
   {
	   MBeanServerConnection server = getServer();
      ObjectName testerName = new ObjectName("jboss.ejb3:service=TxTester,test=initial");
      Object[] params = {};
      String[] sig = {};
      server.invoke(testerName, "testTransactions", params, sig);
   }

   public void testSecurity() throws Exception
   {
	   MBeanServerConnection server = getServer();
      ObjectName testerName = new ObjectName("jboss.ejb3:service=SecurityTester,test=initial");
      Object[] params = {};
      String[] sig = {};
      server.invoke(testerName, "test", params, sig);
   }

   public static Test suite() throws Exception
   {
      return getDeploySetup(LocalUnitTestCase.class, "initial-ejb3-test.sar");
   }

}
