Package com.sun.appserv.security

Examples of com.sun.appserv.security.ProgrammaticLogin


    String anotherUserId = "User#2";
    char[] anotherUserPassword = "PASSWORD".toCharArray();
    User anotherUser = new User(anotherUserId, anotherUserPassword);
    userService.signupUser(anotherUser);
    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(anotherUserId, anotherUserPassword, "GalleriaRealm", true);

    uploadedPhoto.setTitle(TEST_PHOTO_TITLE);
    uploadedPhoto.setDescription(TEST_PHOTO_DESCRIPTION);
    photoService.modifyPhoto(uploadedPhoto);
View Full Code Here


    String anotherUserId = "User#2";
    char[] anotherUserPassword = "PASSWORD".toCharArray();
    User anotherUser = new User(anotherUserId, anotherUserPassword);
    userService.signupUser(anotherUser);
    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(anotherUserId, anotherUserPassword, "GalleriaRealm", true);

    boolean isExceptionThrown = false;
    try
    {
      photoService.deletePhoto(uploadedPhoto);
View Full Code Here

    String anotherUserId = "User#2";
    char[] anotherUserPassword = "PASSWORD".toCharArray();
    User anotherUser = new User(anotherUserId, anotherUserPassword);
    userService.signupUser(anotherUser);
    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(anotherUserId, anotherUserPassword, "GalleriaRealm", true);

    photoService.findPhotoById(photoId, true);

    fail("The execution control flow must not arrive here.");
    logger.info("Finished executing test method {}", testMethod.getMethodName());
View Full Code Here

    String anotherUserId = "User#2";
    char[] anotherUserPassword = "PASSWORD".toCharArray();
    User anotherUser = new User(anotherUserId, anotherUserPassword);
    userService.signupUser(anotherUser);
    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(anotherUserId, anotherUserPassword, "GalleriaRealm", true);

    photoService.setAlbumCover(secondPhoto);

    fail("The execution control flow must not arrive here.");
    logger.info("Finished executing test method {}", testMethod.getMethodName());
View Full Code Here

  {
    logger.info("About to execute test method {}", testMethod.getMethodName());
    User user = new User(TEST_USER_ID, TEST_PASSWORD);
    userService.signupUser(user);

    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

  {
    logger.info("About to execute test method {}", testMethod.getMethodName());
    User user = new User(TEST_USER_ID, TEST_PASSWORD);
    userService.signupUser(user);

    ProgrammaticLogin login = new ProgrammaticLogin();
    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());
  }
View Full Code Here

  {
    logger.info("About to execute test method {}", testMethod.getMethodName());
    User user = new User(TEST_USER_ID, TEST_PASSWORD);
    userService.signupUser(user);

    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();

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

  {
    logger.info("About to execute test method {}", testMethod.getMethodName());
    User user = new User(TEST_USER_ID, TEST_PASSWORD);
    userService.signupUser(user);

    ProgrammaticLogin login = new ProgrammaticLogin();
    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, null, null);
    userService.modifyPassword(request);
    fail("The execution control flow must not arrive here.");
    login.logout();

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

  {
    logger.info("About to execute test method {}", testMethod.getMethodName());
    User user = new User(TEST_USER_ID, TEST_PASSWORD);
    userService.signupUser(user);

    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);
    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

  {
    logger.info("About to execute test method {}", testMethod.getMethodName());
    User user = new User(TEST_USER_ID, TEST_PASSWORD);
    userService.signupUser(user);

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

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

TOP

Related Classes of com.sun.appserv.security.ProgrammaticLogin

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.