Package com.sun.appserv.security

Examples of com.sun.appserv.security.ProgrammaticLogin.logout()


    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);
    userService = (UserService) context.lookup("java:global/galleria/galleria-ejb/UserService");

    userService.deleteUserAccount();
    login.logout();

    Connection conn = datasource.getConnection();
    PreparedStatement pStmt = conn.prepareStatement("SELECT COUNT(1) FROM USERS WHERE USERID=?");
    pStmt.setString(1, TEST_USER_ID);
    ResultSet rs = pStmt.executeQuery();
View Full Code Here


    login.login("User #2", TEST_PASSWORD, "GalleriaRealm", true);
    fail("The execution control flow must not arrive here.");
    userService = (UserService) context.lookup("java:global/galleria/galleria-ejb/UserService");

    userService.deleteUserAccount();
    login.logout();

    logger.info("Finished executing test method {}", testMethod.getMethodName());
  }

  @Test(expected = UserException.class)
View Full Code Here

    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);
    userService = (UserService) context.lookup("java:global/galleria/galleria-ejb/UserService");
    userService.deleteUserAccount();

    userService.deleteUserAccount();
    login.logout();
    logger.info("Finished executing test method {}", testMethod.getMethodName());
  }

  @Test(expected = ModifyPasswordException.class)
  public final void testModifyPasswordToNull() throws Exception
View Full Code Here

    userService = (UserService) context.lookup("java:global/galleria/galleria-ejb/UserService");

    ModifyPasswordRequest request = new ModifyPasswordRequest(TEST_PASSWORD, null, null);
    userService.modifyPassword(request);
    fail("The execution control flow must not arrive here.");
    login.logout();

    logger.info("Finished executing test method {}", testMethod.getMethodName());
  }

  @Test
View Full Code Here

    userService = (UserService) context.lookup("java:global/galleria/galleria-ejb/UserService");

    char[] password = "password123".toCharArray();
    ModifyPasswordRequest request = new ModifyPasswordRequest(TEST_PASSWORD, password, password);
    userService.modifyPassword(request);
    login.logout();

    char[] expectedDigestInChars = PasswordUtility.getDigest("password123".toCharArray(), "SHA-512");
    String expectedDigest = new String(expectedDigestInChars);
    Connection conn = datasource.getConnection();
    PreparedStatement pStmt = conn.prepareStatement("SELECT password FROM USERS WHERE USERID=?");
View Full Code Here

    char[] incorrectOriginalPassword = "password1".toCharArray();
    char[] password = "password2".toCharArray();
    ModifyPasswordRequest request = new ModifyPasswordRequest(incorrectOriginalPassword, password, password);
    userService.modifyPassword(request);
    login.logout();

    logger.info("Finished executing test method {}", testMethod.getMethodName());
  }

  @Test(expected = ModifyPasswordException.class)
View Full Code Here

    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);
    userService = (UserService) context.lookup("java:global/galleria/galleria-ejb/UserService");

    ModifyPasswordRequest request = new ModifyPasswordRequest(TEST_PASSWORD, TEST_PASSWORD, TEST_PASSWORD);
    userService.modifyPassword(request);
    login.logout();

    logger.info("Finished executing test method {}", testMethod.getMethodName());
  }

  @Test(expected = ModifyPasswordException.class)
View Full Code Here

    char[] password = "password123".toCharArray();
    char[] confirmPassword = "password1234".toCharArray();
    ModifyPasswordRequest request = new ModifyPasswordRequest(TEST_PASSWORD, password, confirmPassword);
    userService.modifyPassword(request);
    login.logout();

    logger.info("Finished executing test method {}", testMethod.getMethodName());
  }
}
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.