Package org.jboss.security.client

Examples of org.jboss.security.client.SecurityClient


      }
   }
  
   public void testExceptionCase() throws Exception
   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
     
      try
View Full Code Here


      }
   }
  
   public void testRemoteBindingInterceptorStack() throws Exception
   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
      assertFalse(stateful.interceptorAccessed());
      assertTrue(RemoteBindingInterceptor.accessed);
View Full Code Here

      assertTrue(RemoteBindingInterceptor.accessed);
   }

   public void testUninstantiatedPassivation() throws Exception
   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
      stateful.lookupStateful();
      Thread.sleep(10 * 1000);
 
View Full Code Here

      assertEquals(0, size);
   }

   public void testPassivation() throws Exception
   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      System.out.println("testPassivation");
      Stateless stateless = (Stateless)getInitialContext().lookup("Stateless");
      stateless.testInjection();
     
View Full Code Here

      service.testInjection();
   }
  
   public void testClusteredPassivation() throws Exception
   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      System.out.println("testPassivation");
      Stateless stateless = (Stateless)getInitialContext().lookup("Stateless");
      stateless.testInjection();
     
View Full Code Here

   }

  
   public void testRemove() throws Exception
   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("somebody", "password");
      client.login();
     
      Stateful stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
     
      int startingRemoveCount = stateful.beansRemoved();
View Full Code Here

      super(name);
   }

   public void testSecurityClientFactory() throws Exception
   {
      SecurityClient sc = null;
      sc = SecurityClientFactory.getSecurityClient();
      assertNotNull("SecurityClient != null",sc);
      sc = SecurityClientFactory.getSecurityClient("org.jboss.security.client.JBossSecurityClient");
      assertNotNull("SecurityClient != null",sc);
      sc = SecurityClientFactory.getSecurityClient(JBossSecurityClient.class);
View Full Code Here

       with only a EchoLocal cannot call the CallerBean.
    */
   public void testLocalEJBMethodAccessWithSimpleLogin() throws Exception
   {
      log.debug("+++ testLocalEJBMethodAccessWithSimpleLogin");
      SecurityClient sc = SecurityClientFactory.getSecurityClient(JBossSecurityClient.class);
      sc.setSimple("scott", "echoman".toCharArray());
      sc.login();
      InitialContext jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("spec.CallerBean");
      obj = PortableRemoteObject.narrow(obj, CalledSessionHome.class);
      CalledSessionHome home = (CalledSessionHome) obj;
      log.debug("Found spec.CallerBean Home");
      CalledSession bean = home.create();
      log.debug("Created spec.CallerBean");
      log.debug("Bean.invokeEcho('testLocalMethodAccess') -> "+bean.invokeEcho("testLocalMethodAccess"));
      bean.remove();
      sc.logout();
   }
View Full Code Here

   public void testLocalEJBMethodAccessWithJaasLogin() throws Exception
   {
      log.debug("+++ testLocalEJBMethodAccessWithJaasLogin");
      String confName = System.getProperty("conf.name", "spec-test");

      SecurityClient sc = SecurityClientFactory.getSecurityClient(JBossSecurityClient.class);
      AppCallbackHandler acbh = new AppCallbackHandler("scott","echoman".toCharArray());
      sc.setJAAS(confName, acbh);
      sc.login();
      InitialContext jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("spec.CallerBean");
      obj = PortableRemoteObject.narrow(obj, CalledSessionHome.class);
      CalledSessionHome home = (CalledSessionHome) obj;
      log.debug("Found spec.CallerBean Home");
      CalledSession bean = home.create();
      log.debug("Created spec.CallerBean");
      log.debug("Bean.invokeEcho('testLocalMethodAccess') -> "+bean.invokeEcho("testLocalMethodAccess"));
      bean.remove();
      sc.logout();
   }
View Full Code Here

    */
   public void testLocalEJBMethodAccessWithlogout() throws Exception
   {
      log.debug("+++ testLocalEJBMethodAccessWithlogout");

      SecurityClient sc = SecurityClientFactory.getSecurityClient(JBossSecurityClient.class);
      sc.logout();
      InitialContext jndiContext = new InitialContext();
      Object obj = jndiContext.lookup("spec.CallerBean");
      obj = PortableRemoteObject.narrow(obj, CalledSessionHome.class);
      CalledSessionHome home = (CalledSessionHome) obj;
      try
View Full Code Here

TOP

Related Classes of org.jboss.security.client.SecurityClient

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.