Package org.jboss.embedded

Examples of org.jboss.embedded.DeploymentGroup


   }


   public void testSimpleEjb() throws Exception
   {
      DeploymentGroup group = Bootstrap.getInstance().createDeploymentGroup();
      group.addClasspath("ejb-test.jar");
      group.process();

      outputJNDI();
      InitialContext ctx = new InitialContext();
      DAO dao = (DAO)ctx.lookup("DAOBean/local");
      Customer cust = dao.createCustomer("Bill");
      cust = dao.findCustomer("Bill");
      assert cust != null;
      assert cust.getName().equals("Bill");

      group.undeploy();


   }
View Full Code Here


   }

    public void testSimpleEjb2() throws Exception
    {
       DeploymentGroup group = Bootstrap.getInstance().createDeploymentGroup();
       group.addClasspath("ejb-test.jar");
       group.process();

       outputJNDI();
       InitialContext ctx = new InitialContext();
       DAO dao = (DAO)ctx.lookup("DAOBean/local");
       Customer cust = dao.createCustomer("Bill");
       cust = dao.findCustomer("Bill");
       assert cust != null;
       assert cust.getName().equals("Bill");

       group.undeploy();


    }
View Full Code Here

   }

   private static void sendMessage()
           throws DeploymentException, NamingException, JMSException, InterruptedException
   {
      DeploymentGroup group = Bootstrap.getInstance().createDeploymentGroup();
      //group.addResource("mdbtest-service.xml");
      group.addClasspath("mdb-test.jar");
      group.process();

      ExampleMDB.executed = false;

      InitialContext ctx = new InitialContext();
      ConnectionFactory factory = (ConnectionFactory) ctx.lookup("ConnectionFactory");
View Full Code Here

   }


   public void testSimpleEjb() throws Exception
   {
      DeploymentGroup group = Bootstrap.getInstance().createDeploymentGroup();
      group.addClasspath("ejb-test.jar");
      group.process();

      outputJNDI();
      InitialContext ctx = new InitialContext();
      DAO dao = (DAO)ctx.lookup("DAOBean/local");
      Customer cust = dao.createCustomer("Bill");
      cust = dao.findCustomer("Bill");
      assert cust != null;
      assert cust.getName().equals("Bill");

      group.undeploy();


   }
View Full Code Here

   }

    public void testSimpleEjb2() throws Exception
    {
       DeploymentGroup group = Bootstrap.getInstance().createDeploymentGroup();
       group.addClasspath("ejb-test.jar");
       group.process();

       outputJNDI();
       InitialContext ctx = new InitialContext();
       DAO dao = (DAO)ctx.lookup("DAOBean/local");
       Customer cust = dao.createCustomer("Bill");
       cust = dao.findCustomer("Bill");
       assert cust != null;
       assert cust.getName().equals("Bill");

       group.undeploy();


    }
View Full Code Here

    }

   public void testSecurity() throws Exception
   {
      DeploymentGroup group = Bootstrap.getInstance().createDeploymentGroup();
      group.addClasspath("ejb-test.jar");
      group.process();

      Hashtable env = new Hashtable();
      env.put(Context.SECURITY_PRINCIPAL, "scott");
      env.put(Context.SECURITY_CREDENTIALS, "invalidpassword");

      InitialContext ctx = new InitialContext(env);
      Secured secured = (Secured)ctx.lookup("SecuredBean/local");
      boolean exceptionThrown = false;
      try
      {
         secured.allowed();
      }
      catch (EJBAccessException ignored)
      {
         exceptionThrown = true;
      }
      assertTrue("Security exception not thrown for invalid password", exceptionThrown);
      env.put(Context.SECURITY_CREDENTIALS, "password");
      ctx = new InitialContext(env);

      secured.allowed();

      exceptionThrown = false;
      try
      {
         secured.nobody();
      }
      catch (EJBAccessException ignored)
      {
         exceptionThrown = true;
      }
      assertTrue("Security exception not thrown for invalid role", exceptionThrown);

      group.undeploy();


   }
View Full Code Here

TOP

Related Classes of org.jboss.embedded.DeploymentGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.