Package com.sun.appserv.security

Examples of com.sun.appserv.security.ProgrammaticLogin


  {
    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, TEST_PASSWORD, TEST_PASSWORD);
    userService.modifyPassword(request);
    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();
    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

  @Test
  public void testCreateNewAlbum() throws Exception
  {
    logger.info("About to execute test method {}", testMethod.getMethodName());

    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);

    Album album = new Album(TEST_ALBUM_NAME, TEST_ALBUM_DESCRIPTION);
    Album createdAlbum = albumService.createAlbum(album);

    assertEquals(album, createdAlbum);
View Full Code Here

  @Test(expected = AlbumException.class)
  public void testCreateDuplicateAlbum() throws Exception
  {
    logger.info("About to execute test method {}", testMethod.getMethodName());

    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);
    Album album = new Album(TEST_ALBUM_NAME, TEST_ALBUM_DESCRIPTION);
    albumService.createAlbum(album);

    Album duplicateAlbum = new Album(TEST_ALBUM_NAME, TEST_ALBUM_DESCRIPTION);
    albumService.createAlbum(duplicateAlbum);
View Full Code Here

  @Test(expected = AlbumException.class)
  public void testCreateAlbumNullValues() throws Exception
  {
    logger.info("About to execute test method {}", testMethod.getMethodName());

    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);

    Album album = new Album(null, null);
    albumService.createAlbum(album);
    fail("The execution control flow must not arrive here.");
View Full Code Here

  @Test(expected = AlbumException.class)
  public void testCreateAlbumEmptyValues() throws Exception
  {
    logger.info("About to execute test method {}", testMethod.getMethodName());

    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);

    Album album = new Album("", "");
    albumService.createAlbum(album);
    fail("The execution control flow must not arrive here.");
View Full Code Here

  @Test
  public void testModifyAlbum() throws Exception
  {
    logger.info("About to execute test method {}", testMethod.getMethodName());

    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);
    Album album = new Album(TEST_ALBUM_NAME, TEST_ALBUM_DESCRIPTION);
    Album createdAlbum = albumService.createAlbum(album);

    String newName = "New Album name";
    String newDescription = "New Album Description";
View Full Code Here

  @Test
  public void testModifyAlbumAmongMultiple() throws Exception
  {
    logger.info("About to execute test method {}", testMethod.getMethodName());

    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);
    Album album = new Album(TEST_ALBUM_NAME, TEST_ALBUM_DESCRIPTION);
    Album createdAlbum = albumService.createAlbum(album);
    Album secondAlbum = new Album("AnotherAlbum", TEST_ALBUM_DESCRIPTION);
    Album anotherAlbum = albumService.createAlbum(secondAlbum);
View Full Code Here

  @Test(expected = AlbumException.class)
  public void testModifyAlbumIntoDuplicate() throws Exception
  {
    logger.info("About to execute test method {}", testMethod.getMethodName());

    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);
    Album album = new Album(TEST_ALBUM_NAME, TEST_ALBUM_DESCRIPTION);
    Album createdAlbum = albumService.createAlbum(album);

    albumService.modifyAlbum(createdAlbum);
    fail("The execution control flow must not arrive here.");
View Full Code Here

  @Test(expected = AlbumException.class)
  public void testModifyUnownedAlbum() throws Exception
  {
    logger.info("About to execute test method {}", testMethod.getMethodName());

    ProgrammaticLogin login = new ProgrammaticLogin();
    login.login(TEST_USER_ID, TEST_PASSWORD, "GalleriaRealm", true);
    Album album = new Album(TEST_ALBUM_NAME, TEST_ALBUM_DESCRIPTION);
    Album createdAlbum = albumService.createAlbum(album);

    String newUserId = "User#2";
    User newUser = new User(newUserId, TEST_PASSWORD);
    userService.signupUser(newUser);
    login.login(newUserId, TEST_PASSWORD, "GalleriaRealm", true);

    albumService.modifyAlbum(createdAlbum);
    fail("The execution control flow must not arrive here.");

    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.