Examples of StatelessSession


Examples of org.jboss.test.deadlock.interfaces.StatelessSession

      completed = 0;
      unexpected = null;

      // Create some beans
      StatelessSessionHome home = (StatelessSessionHome) new InitialContext().lookup("nextgen.StatelessSession");
      StatelessSession session = home.create();
      session.createCMRTestData(jndiName);

      // Create some threads
      CMRTestThread[] threads = new CMRTestThread[target];
      for (int i = 0; i < target; i++)
         threads[i] = new CMRTestThread(new CMRTest(session, jndiName, i % 2 == 0 ? "First" : "Second"));
View Full Code Here

Examples of org.jboss.test.iiop.interfaces.StatelessSession

   {
      StatelessSessionHome home =
         (StatelessSessionHome)PortableRemoteObject.narrow(
                    getInitialContext().lookup(StatelessSessionHome.JNDI_NAME),
                    StatelessSessionHome.class);
      StatelessSession session = home.create();
      //----------------------------------------------------------------------
      String s = session.getString();
      assertEquals(Util.STRING, s);
      //----------------------------------------------------------------------
      session.remove();
   }
View Full Code Here

Examples of org.jboss.test.invokers.interfaces.StatelessSession

      getLog().debug("bmp2 name: " + bmp2.getName());
      assertTrue("bmp1 " + bmp1.getName() + "  == bmp2 " + bmp2.getName(), bmp1.getName().equals(bmp2.getName()));

      StatelessSessionHome shome1 = (StatelessSessionHome)ctx.lookup("StatelessSession");
      StatelessSessionHome shome2 = (StatelessSessionHome)ctx.lookup("CompressionStatelessSession");
      StatelessSession ss1 = shome1.create();
      StatelessSession ss2 = shome2.create();

      ss1.getBMP(1);
      ss2.getBMP(1);
     
   }
View Full Code Here

Examples of org.jboss.test.jrmp.interfaces.StatelessSession

      InitialContext jndiContext = new InitialContext();
      log.debug("Lookup StatelessSessionWithGZip");
      Object obj = jndiContext.lookup("StatelessSessionWithGZip");
      StatelessSessionHome home = (StatelessSessionHome)obj;
      log.debug("Found StatelessSessionWithGZip Home");
      StatelessSession bean = home.create();
      log.debug("Created StatelessSessionWithGZip");
      // Test that the Entity bean sees username as its principal
      String echo = bean.echo("jrmp-comp");
      log.debug("bean.echo(jrmp-comp) = " + echo);
      bean.remove();
   }
View Full Code Here

Examples of org.jboss.test.pooled.interfaces.StatelessSession

      failures = 0;
      System.out.println("------------------------");
      System.out.println("**** OldProxy " + ejbname + " ****");
     
      StatelessSessionHome home = (StatelessSessionHome)ctx.lookup(ejbname);
      StatelessSession proxy = home.create();
      Thread[] threads = new Thread[NUM_THREADS];
      for (int i = 0; i < NUM_THREADS; i++)
      {
         threads[i] = new Thread(new OldProxy(proxy));
      }
View Full Code Here

Examples of org.jboss.test.security.interfaces.StatelessSession

      log.debug("+++ testEJB");
      Object obj = getInitialContext().lookup("null.StatelessSession");
      obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class);
      StatelessSessionHome home = (StatelessSessionHome) obj;
      log.debug("Found null.StatelessSession Home");
      StatelessSession bean = null;
      try
      {
         bean = home.create();
         fail("Invoking create() should fail");
      }
      catch (Exception e)
      {
         Throwable t = e.getCause();
         if (t instanceof SecurityException)
         {
            log.debug("Invoking create() was correctly denied by a SecurityException:", e);
         }
         else
         {
            log.debug("Invoking create() failed by an unexpected reason:", e);
            fail("Unexpected exception");
         }
      }
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple(username, password);
      client.login();
      try
      {
         bean = home.create();
         bean.echo("hi");
      }
      catch(Exception e)
      {
         fail(e.getLocalizedMessage());
      }
View Full Code Here

Examples of org.jboss.test.security.interfaces.StatelessSession

      log.debug("+++ testEJBNullSecurityDomain");
      Object obj = getInitialContext().lookup("null.StatelessSession");
      obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class);
      StatelessSessionHome home = (StatelessSessionHome) obj;
      log.debug("Found null.StatelessSession Home");
      StatelessSession bean = null;
      try
      {
         bean = home.create();
         fail("Invoking create() should fail");
      }
      catch (Exception e)
      {
         Throwable t = e.getCause();
         if (t instanceof SecurityException)
         {
            log.debug("Invoking create() was correctly denied by a SecurityException:", e);
         }
         else
         {
            log.debug("Invoking create() failed by an unexpected reason:", e);
            fail("Unexpected exception");
         }
      }
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("scott", "echoman");
      client.login();
      try
      {
         bean = home.create();
         bean.echo("hi");
      }
      catch (Exception e)
      {
         fail(e.getLocalizedMessage());
      }
View Full Code Here

Examples of org.jboss.test.security.interfaces.StatelessSession

   {
      Object obj = getInitialContext().lookup("DeploymentLevelRoleMappingBean");
      obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class);
      StatelessSessionHome home = (StatelessSessionHome) obj;
      log.debug("Found Unsecure StatelessSessionHome");
      StatelessSession bean = null;
      try
      {
         bean = home.create();
         log.debug("Created spec.UnsecureStatelessSession2");
         bean.echo("Hello from nobody?")
         fail("Should not be allowed");
      }
      catch(RemoteException re)
      {
      }
      finally
      {
         if(bean != null)
           bean.remove()
      }
     
      login();
      obj = getInitialContext().lookup("DeploymentLevelRoleMappingBean");
      obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class);
      home = (StatelessSessionHome) obj;
      log.debug("Found spec.StatelessSession2");
      bean = home.create();
      log.debug("Created spec.StatelessSession2");
      // Test that the Entity bean sees username as its principal
      String echo = bean.echo("jduke");
      log.debug("bean.echo(username) = "+echo);
      assertTrue("username == echo", echo.equals("jduke"));
      bean.remove();
      logout();
   }
View Full Code Here

Examples of org.jboss.test.testbean.interfaces.StatelessSession

            p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
            InitialContext ctx = new InitialContext(p);
           
            StatelessSessionHome  statelessSessionHome =  (StatelessSessionHome) ctx.lookup("nextgen.StatelessSession");
            EnterpriseEntityHome  cmpHome =  (EnterpriseEntityHome)ctx.lookup("nextgen.EnterpriseEntity");
            StatelessSession statelessSession = statelessSessionHome.create();
            EnterpriseEntity cmp = null;
            try
            {
               cmp = cmpHome.findByPrimaryKey("bill");
            }
            catch (Exception ex)
            {
               cmp = cmpHome.create("bill");
            }
            int count = 0;
            while (true)
            {
               System.out.println(statelessSession.callBusinessMethodB());
               try
               {
                  cmp.setOtherField(count++);
               }
               catch (Exception ex)
View Full Code Here

Examples of org.jboss.test.web.interfaces.StatelessSession

        try
        {
            InitialContext ctx = new InitialContext();
            Context enc = (Context) ctx.lookup("java:comp/env");
            StatelessSessionHome home = (StatelessSessionHome) enc.lookup("ejb/OptimizedEJB");
            StatelessSession bean = home.create();
            optimized = runRemoteTest(bean, true);

            home = (StatelessSessionHome) enc.lookup("ejb/NotOptimizedEJB");
            bean = home.create();
            notOptimized = runRemoteTest(bean, false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.