Package org.jdesktop.wonderland.testharness.master

Examples of org.jdesktop.wonderland.testharness.master.GroupUserManagerImpl$UserGroup


    return sessionFactory.getCurrentSession();
  }

  @Before
  public void init() {
    UserGroup group = new UserGroup("main");
    groupId = getSession().save(group);

    User user1 = new User("User1");
    user1Id = getSession().save(user1);

    User user2 = new User("user2");
    user2Id = getSession().save(user2);

    group.addUser(user1);
    group.addUser(user2);

    Authority adminAuthority = new Authority("admin");
    adminAuthotityId = getSession().save(adminAuthority);

    DefaultMapperFactory.Builder builder = new DefaultMapperFactory.Builder();
View Full Code Here


    getSession().clear();

  }

  private void removeGroup() {
    UserGroup group = (UserGroup) getSession().load(UserGroup.class,
        groupId);

    User user1 = (User) getSession().load(User.class, user1Id);

    assertTrue(group.getUsers().contains(user1));

    UserDto userDto1 = mapperFacade.map(user1, UserDto.class);

    UserGroupDto groupDto = mapperFacade.map(group, UserGroupDto.class);
    groupDto.removeUser(userDto1);

    mapperFacade.map(groupDto, group,
        TypeFactory.valueOf(UserGroupDto.class),
        TypeFactory.valueOf(UserGroup.class));

    assertFalse(group.getUsers().contains(user1));
  }
View Full Code Here

    assertFalse(group.getUsers().contains(user1));
  }

  private void revertGroup() {
    UserGroup group = (UserGroup) getSession().load(UserGroup.class,
        groupId);

    User user1 = (User) getSession().load(User.class, user1Id);

    assertFalse(group.getUsers().contains(user1));

    UserDto userDto1 = mapperFacade.map(user1, UserDto.class);

    UserGroupDto groupDto = mapperFacade.map(group, UserGroupDto.class);
    groupDto.addUser(userDto1);

    mapperFacade.map(groupDto, group,
        TypeFactory.valueOf(UserGroupDto.class),
        TypeFactory.valueOf(UserGroup.class));

    assertTrue(group.getUsers().contains(user1));
  }
View Full Code Here

TOP

Related Classes of org.jdesktop.wonderland.testharness.master.GroupUserManagerImpl$UserGroup

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.