Package info.galleria.domain

Examples of info.galleria.domain.User


  @Test(expected = ModifyPasswordException.class)
  public final void testModifyPasswordToNull() throws Exception
  {
    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");
View Full Code Here


  @Test
  public final void testModifyPassword() throws Exception
  {
    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");
View Full Code Here

  @Test(expected = ModifyPasswordException.class)
  public final void testModifyIncorrectPassword() throws Exception
  {
    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");
View Full Code Here

  @Test(expected = ModifyPasswordException.class)
  public final void testModifySamePassword() throws Exception
  {
    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");
View Full Code Here

  @Test(expected = ModifyPasswordException.class)
  public final void testModifyPasswordIncorrectConfirmation() throws Exception
  {
    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");
View Full Code Here

  }
 
  @Test
  public void testCreateUser() throws Exception
  {
    User user = new User(TEST_USER_ID, TEST_PASSWORD);
   
    //Execute
    User newUser = repository.create(user);

    //Verify
    em.flush();
    em.clear();
    User actualUser = em.find(User.class, TEST_USER_ID);
    assertEquals(user, newUser);
    assertEquals(user, actualUser);
  }
View Full Code Here

 
  @Test
  public void testModifyUser() throws Exception
  {
    //Setup
    User user = new User(TEST_USER_ID , TEST_PASSWORD);
    em.persist(user);
   
    //Execute
    char[] modifiedPassword = "NEWPASSWORD".toCharArray();
    user.setPassword(modifiedPassword);
    User modifiedUser = repository.modify(user);
   
    //Verify
    em.flush();
    em.clear();
    User actualUser = em.find(User.class, TEST_USER_ID);
    assertEquals(user, modifiedUser);
    assertArrayEquals(modifiedPassword, actualUser.getPassword());
  }
View Full Code Here

  @Test
  public void testModifyUserAddGroup() throws Exception
  {
    //Setup
    Group group = new Group(TEST_GROUP_ID);
    User user = new User(TEST_USER_ID , TEST_PASSWORD);
    em.persist(group);
    em.persist(user);
   
    em.flush();
    em.clear();
   
    //Execute
    user.addToGroups(group);
    user = repository.modify(user);
    em.flush();
    em.clear();
   
    //Verify
    User actualUser = em.find(User.class, TEST_USER_ID);
    assertEquals(user, actualUser);
    assertTrue(actualUser.getGroups().contains(group));
  }
View Full Code Here

  @Test
  public void testModifyUserRemoveGroup() throws Exception
  {
    //Setup
    Group group = new Group(TEST_GROUP_ID);
    User user = new User(TEST_USER_ID , TEST_PASSWORD);
    user.addToGroups(group);
    em.persist(group);
    em.persist(user);
   
    em.flush();
    em.clear();
   
    //Execute
    user.removeFromGroups(group);
    user = repository.modify(user);
    em.flush();
    em.clear();
   
    //Verify
    User actualUser = em.find(User.class, TEST_USER_ID);
    Group actualGroup = em.find(Group.class, TEST_GROUP_ID);
    assertEquals(user, actualUser);
    assertFalse(actualUser.getGroups().contains(group));
    assertEquals(group, actualGroup);
  }
View Full Code Here

 
  @Test
  public void testModifyUserAddAlbum() throws Exception
  {
    //Setup
    User user = new User(TEST_USER_ID , TEST_PASSWORD);
    em.persist(user);
   
    em.flush();
    em.clear();
   
    //Execute
    Album album = new Album(TEST_ALBUM_NAME, TEST_ALBUM_DESCRIPTION);
    user.addToAlbums(album);
    user = repository.modify(user);
    em.flush();
    em.clear();
   
    //Verify
    User actualUser = em.find(User.class, TEST_USER_ID);
    assertEquals(user, actualUser);
    assertTrue(actualUser.getAlbums().contains(album));
  }
View Full Code Here

TOP

Related Classes of info.galleria.domain.User

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.