Package org.jboss.test.security.interfaces

Examples of org.jboss.test.security.interfaces.StatelessSession.echo()


      obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class);
      StatelessSessionHome home = (StatelessSessionHome) obj;
      log.debug("Found StatelessSessionHome");
      StatelessSession bean = home.create();
      log.debug("Created spec.StatelessSession_test");
      log.debug("Bean.echo('testMethodAccess2') -> " + bean.echo("testMethodAccess2"));
      bean.remove();
   }

   /**
    * Test a user with Echo and EchoLocal roles can access the CalleeBean through its local interface by calling the
View Full Code Here


      obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class);
      StatelessSessionHome home = (StatelessSessionHome) obj;
      log.debug("Found UncheckedSessionRemoteLast");
      StatelessSession bean = home.create();
      log.debug("Created spec.UncheckedSessionRemoteLast");
      log.debug("Bean.echo('testUncheckedRemote') -> " + bean.echo("testUncheckedRemote"));
      try
      {
         bean.excluded();
         fail("Was able to call UncheckedSessionRemoteLast.excluded");
      }
View Full Code Here

      obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class);
      StatelessSessionHome home = (StatelessSessionHome) obj;
      log.debug("Found UncheckedSessionRemoteFirst");
      StatelessSession bean = home.create();
      log.debug("Created spec.UncheckedSessionRemoteFirst");
      log.debug("Bean.echo('testRemoteUnchecked') -> " + bean.echo("testRemoteUnchecked"));
      try
      {
         bean.excluded();
         fail("Was able to call UncheckedSessionRemoteFirst.excluded");
      }
View Full Code Here

      obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class);
      StatelessSessionHome home = (StatelessSessionHome) obj;
      log.debug("Found RunAsStatelessSession Home");
      StatelessSession bean = home.create();
      log.debug("Created spec.RunAsStatelessSession");
      log.debug("Bean.echo('testRunAs') -> " + bean.echo("testRunAs"));
      bean.noop();
      log.debug("Bean.noop(), ok");

      try
      {
View Full Code Here

      log.debug("Created spec.StatelessSession");
      Handle h = bean.getHandle();
      log.debug("Obtained handle: " + h);
      bean = (StatelessSession) h.getEJBObject();
      log.debug("Obtained bean from handle: " + bean);
      log.debug("Bean.echo('testHandle') -> " + bean.echo("testHandle"));
      logout();

      /*
       * Attempting to obtain the EJB fron the handle without security association present should fail
       */
 
View Full Code Here

      h = bean.getHandle();
      login();
      // Now we should be able to obtain and use the secure bean
      bean = (StatelessSession) h.getEJBObject();
      log.debug("Obtained bean from handle: " + bean);
      log.debug("Bean.echo('testHandle2') -> " + bean.echo("testHandle2"));
      logout();
   }

   /**
    * Test the security behavior of stateful handles. To obtain secured bean from a handle requires that there be a
View Full Code Here

               obj = PortableRemoteObject.narrow(obj, StatelessSessionHome.class);
               StatelessSessionHome home = (StatelessSessionHome) obj;
               log.debug("Found StatelessSessionHome");
               StatelessSession bean = home.create();
               log.debug("Created spec.StatelessSession");
               log.debug("Bean.echo('Hello') -> " + bean.echo("Hello"));
               bean.remove();
               log.debug("Removed bean");
               lc.logout();
            }
         }
View Full Code Here

        try
        {
            InitialContext ctx = new InitialContext();
            StatelessSessionHome home = (StatelessSessionHome) ctx.lookup("java:comp/env/ejb/Session");
            StatelessSession bean = home.create();
            echo = bean.echo(echoArg);
        }
        catch(Exception e)
        {
            log.debug("StatelessSession.echo failed", e);
            e.fillInStackTrace();
View Full Code Here

      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)
      {
      }
View Full Code Here

      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

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.