Package org.libreplan.business.users.entities

Examples of org.libreplan.business.users.entities.Profile


    }

    @Test
    @Transactional
    public void testNavigateFromOrderAuthorizationToProfile() {
        Profile profile = createValidProfile();
        profileDAO.save(profile);
        ProfileOrderAuthorization profileOrderAuthorization = createValidProfileOrderAuthorization();
        profileOrderAuthorization.setProfile(profile);
        orderAuthorizationDAO.save(profileOrderAuthorization);
        assertEquals(profile.getId(), profileOrderAuthorization.getProfile().getId());
    }
View Full Code Here


    public Profile findByProfileName(String profileName)
        throws InstanceNotFoundException{

        Criteria c = getSession().createCriteria(Profile.class);
        c.add(Restrictions.eq("profileName", profileName).ignoreCase());
        Profile profile = (Profile) c.uniqueResult();

        if (profile == null) {
            throw new InstanceNotFoundException(profileName,
                Profile.class.getName());
        } else {
View Full Code Here

    @Override
    @Transactional(readOnly = true)
    public Profile findByProfileNameLoadingRoles(String profileName)
            throws InstanceNotFoundException {
        Profile profile = findByProfileName(profileName);
        profile.getRoles().size();
        return profile;
    }
View Full Code Here

    @Override
    @Transactional
    public void loadRequiredData() {
        if (profileDAO.list(Profile.class).isEmpty()) {
            for (PredefinedProfiles each : PredefinedProfiles.values()) {
                Profile profile = each.createProfile();
                profileDAO.save(profile);
                profile.dontPoseAsTransientObjectAnymore();
            }
        }
    }
View Full Code Here

    public void testListProfiles() throws InstanceNotFoundException{

        User user = createUser(getUniqueName());
        userDAO.save(user);

        Profile profile = createProfile(getUniqueName());
        profileDAO.save(profile);

        int previous = user.getProfiles().size();
        user.addProfile(profile);
        userDAO.save(user);
View Full Code Here

    }

    @Test
    @Transactional
    public void testSaveProfile() {
        Profile profile = createValidProfile();
        profileDAO.save(profile);
        assertNotNull(profile.getId());
    }
View Full Code Here

    }

    @Test
    @Transactional
    public void testRemoveProfile() throws InstanceNotFoundException {
        Profile profile = createValidProfile();
        profileDAO.save(profile);
        profileDAO.remove(profile.getId());
        assertFalse(profileDAO.exists(profile.getId()));
    }
View Full Code Here

    @Test
    @Transactional
    public void testListProfiles() {
        int previous = profileDAO.list(Profile.class).size();
        Profile profile = createValidProfile();
        profileDAO.save(profile);
        assertEquals(previous + 1, profileDAO.list(Profile.class).size());
    }
View Full Code Here

    @Autowired
    private IProfileDAO dao;

    @Override
    public String _toString(Object value) {
        Profile profile = (Profile) value;
        return (profile != null)? profile.getProfileName() : "";
    }
View Full Code Here

TOP

Related Classes of org.libreplan.business.users.entities.Profile

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.