Package org.jboss.security.client

Examples of org.jboss.security.client.SecurityClient.login()


  
   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

   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

   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

  
   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

   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");
View Full Code Here

      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");
View Full Code Here

   @Test
   public void testTestUser() throws Throwable
   {
      SecurityClient client = SecurityClientFactory.getSecurityClient();
      client.setSimple("testuser", "testpwd");
      client.login();
      try
      {
         DirectContainer<SecuredBean> container = new DirectContainer<SecuredBean>("Test", "SimpleContainer", SecuredBean.class);
         BeanContext<SecuredBean> bean = container.construct();
         Principal callerPrincipal = container.invoke(bean, "getCallerPrincipal");
View Full Code Here

    @Test
    public void testJackInABox() throws Exception {
        SecurityClient client = SecurityClientFactory.getSecurityClient();
        client.setSimple("user1", "password1");
        client.login();
        try {
            WhoAmI bean =  lookupCallerWithIdentity();
            String actual = bean.getCallerPrincipal();
            Assert.assertEquals("jackinabox", actual);
        } finally {
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.