Package net.sf.esims.model.entity

Examples of net.sf.esims.model.entity.Role


   
  }

  public void testGetRolesForUserCreation() {
   
    Role role1 = new Role(EsimsConstants._ADMIN_ROLE);
    if(this.roleDAO.getAll().size()==0)
      this.roleDAO.save(role1);
    List<Role> roles = this.userManagerService.getRolesForUserCreation();
    assertNotNull(roles);
    assertTrue( (roles.size() >0) );
View Full Code Here


    assertTrue( (roles.size() >0) );
    roleDAO.delete(role1);
  }

  public void testGetRole(){
    Role role1 = new Role(EsimsConstants._ADMIN_ROLE);
    if(this.roleDAO.getAll().size()==0)
      this.roleDAO.save(role1);
    List<Role> roles = this.userManagerService.getRolesForUserCreation();
    assertNotNull(roles);
    Role role2=roles.get(0);
    assertNotNull(this.userManagerService.getRole(role2.getRoleId()));
    roleDAO.delete(role1);
  }
View Full Code Here

 
 
 
  @HandlesEvent("createUser")
  public Resolution createUser(){
    Role roleToBeAssigned = this.userManagerService.getRole(role);
    String userName = userManagerService.createUserName(this.firstName, this.lastName);
    String password = userManagerService.createPassWord(userName);
    String message=EsimsConstants._BLANK_STRING ;
    user = new User(roleToBeAssigned,userName,password,this.firstName,this.middleName,this.lastName,this.gender);
    this.userManagerService.saveUser(user);
View Full Code Here

  }
 
  @HandlesEvent("updateUser")
  public Resolution updateUser(){
    user = userManagerService.getUserById(new Long(this.getContext().getRequest().getParameter("userId")));
    Role roleToBeAssigned = this.userManagerService.getRole(role);
    user.setFirstName(firstName);
    user.setMiddleName(middleName);
    user.setLastName(lastName);
    user.setGender(gender);
    user.setRole(roleToBeAssigned);
View Full Code Here

*
*/
public class RoleLoader {
  @SuppressWarnings("unused")
  public static void main(String[] args) {
    Role adminRole = new Role(_ADMIN_ROLE);
    Role principalRole = new Role(_PRINCIPAL_ROLE);
    Role officeRole = new Role(_OFFICE_STAFF_ROLE);
    Role teacherRole = new Role(_TEACHER_ROLE);
   
  }
View Full Code Here

  }
 
 
  public void testSaveWithValidRole()throws Exception{
      DatabaseOperation.DELETE_ALL.execute(connection, dataSet);
      role1 = new Role(_ADMIN_ROLE);
      roleDAO.save(role1);
      DatabaseOperation.DELETE_ALL.execute(connection, dataSet);
  }
View Full Code Here

  }
 
 
  public void testGetAll()throws Exception{
    DatabaseOperation.DELETE_ALL.execute(connection, dataSet);
    role1 = new Role(_ADMIN_ROLE);
    roleDAO.save(role1);
    assertEquals(1,roleDAO.getAll().size());
    DatabaseOperation.DELETE_ALL.execute(connection, dataSet);
  }
View Full Code Here

  }
 
  public void testDeletes()throws Exception{
    //test a valid delete
    DatabaseOperation.DELETE_ALL.execute(connection, dataSet);
    role1 = new Role(_ADMIN_ROLE);
    roleDAO.save(role1);
    assertEquals(1,roleDAO.getAll().size());
    roleDAO.delete(role1);
   
    //test with invalid subjectId
View Full Code Here

    this.roleDAO = roleDAO;
  }


  protected void onSetUp()throws Exception{
    role1 = new Role(_ADMIN_ROLE);
    this.connection = super.getConnectionForTests();
    dataSet = getDataSet("roleDataSet.xml");
  }
View Full Code Here

   
    DatabaseOperation.CLEAN_INSERT.execute(conxn, rolesDataSet);
   
    List<Role> listOfRoles = roleDAO.getByQuery(_HQL_GET_ADMIN_ROLE);
    assertEquals(1, listOfRoles.size());
    Role role = listOfRoles.get(0);
   
    user1 = new User(role,"jvictor","test123","Juby",null,"Victor","M");
    //role.getUsersForRole().add(user1);
    userDAO.save(user1);
   
View Full Code Here

TOP

Related Classes of net.sf.esims.model.entity.Role

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.