Package com.agilebooster.data.entity

Examples of com.agilebooster.data.entity.User


     * Init the test environment.
     */
    @BeforeClass
    public static void initContext() {
        userController = new UserController();
        scrumMaster = new User("ScrumMaster@agilebooster.fr", "Forename", "Last Name", "password", true);
        scrumMaster = userController.create(scrumMaster);
        productOwner = new User("ProductOwner@agilebooster.fr", "Forename", "Last Name", "password", true);
        productOwner = userController.create(productOwner);

        projectController = new ProjectController();
        Date date = new Date();
        project = new Project("Test Sprint ", "TST", "Project Sprint test.", date, "http://www.testSprint.com", "http://www.Sprint.git", scrumMaster, productOwner);
View Full Code Here


     * Init the test environment.
     */
    @BeforeClass
    public static void initContext() {
        userController = new UserController();
        scrumMaster = new User("ScrumMaster@agilebooster.fr", "Forename", "Last Name", "password", true);
        scrumMaster = userController.create(scrumMaster);
        productOwner = new User("ProductOwner@agilebooster.fr", "Forename", "Last Name", "password", true);
        productOwner = userController.create(productOwner);

        projectController = new ProjectController();
        Date date = new Date();
        project1 = new Project("Test Release 1", "TR1", "Project Release 1 test.", date, "http://www.testRelease1.com", "http://www.testRelease1.git", scrumMaster, productOwner);
View Full Code Here

    @BeforeClass
    public static void initContext() {
        Date date = new Date();

        userController = new UserController();
        scrumMaster = new User("ScrumMaster@agilebooster.fr", "Forename", "Last Name", "password", true);
        scrumMaster = userController.create(scrumMaster);
        productOwner = new User("ProductOwner@agilebooster.fr", "Forename", "Last Name", "password", true);
        productOwner = userController.create(productOwner);
        creator = new User("Creator@agilebooster.fr", "Forename", "Last Name", "password", true);
        creator = userController.create(creator);
        assignedUser1 = new User("AssignedUser1@agilebooster.fr", "Forename", "Last Name", "password", true);
        assignedUser1 = userController.create(assignedUser1);
        assignedUser2 = new User("AssignedUser2@agilebooster.fr", "Forename", "Last Name", "password", true);
        assignedUser2 = userController.create(assignedUser2);
        assignedUser3 = new User("AssignedUser3@agilebooster.fr", "Forename", "Last Name", "password", true);
        assignedUser3 = userController.create(assignedUser3);

        projectController = new ProjectController();
        project = new Project("Test BacklogItem", "TBM", "Project BacklogItem test.", date, "http://www.testBacklogItem.com", "http://www.testBacklogItem.git", scrumMaster, productOwner);
        project = projectController.create(project);
View Full Code Here

     *
     * @return The list of all the projects.
     */
    public List<Project> getProjects() {
        List<Project> projects = null;
        User user = sessionBean.getUser();
        if (user != null) {
            projects = user.getAccessibleProject();
        }
        return projects;
    }
View Full Code Here

     * Test of create method, of class UserController.
     */
    @Test
    public void testCreate() {
        System.out.println("UserController:Create");
        User user = new User("testCreate@agilebooster.com", "Forename", "Last Name", "password", true);
        UserController instance = new UserController();
        User userResult = instance.create(user);
        assertNotNull(userResult.getId());
        assertEquals(user.getMail(), userResult.getMail());
        assertEquals(user.getForename(), userResult.getForename());
        assertEquals(user.getLastName(), userResult.getLastName());
        assertEquals(user.getPassword(), userResult.getPassword());
        assertEquals(user.isAdmin(), userResult.isAdmin());
        instance.destroy(user);
    }
View Full Code Here

     * @param password User password.
     */
    public void connect(String mail, String password) {
        FacesContext context = FacesContext.getCurrentInstance();
        try {
            User userChecked = userController.getUserByMail(mail);
            if (userChecked == null) {
                context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Connection faild", "The user is not existing." + mail));
            } else {
                if (PasswordManager.CheckPassword(password, userChecked.getPassword()) == false) {
                    context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Connection faild", "The password is not correct." + mail));
                } else {
                    context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Connection succeed", "Welcome " + userChecked.getForename()));
                    user = userChecked;
                    FacesContext.getCurrentInstance().getExternalContext().redirect("/Agile-Booster/dashboard.xhtml");
                }
            }
        } catch (Exception ex) {
View Full Code Here

     */
    @Test
    public void testEdit() {
        System.out.println("UserController:Edit");
        UserController instance = new UserController();
        User oldUser = new User("testEditOld@agilebooster.com", "Forename", "Last Name", "password", true);
        oldUser = instance.create(oldUser);
        User newUser = new User("testEditNew@agilebooster.com", "New Forename", "New Last Name", "new password", false);
        newUser.setId(oldUser.getId());
        User editResult = instance.edit(newUser);
        assertEquals(newUser.getMail(), editResult.getMail());
        assertEquals(newUser.getForename(), editResult.getForename());
        assertEquals(newUser.getLastName(), editResult.getLastName());
        assertEquals(newUser.getPassword(), editResult.getPassword());
        assertEquals(newUser.isAdmin(), editResult.isAdmin());
        instance.destroy(editResult);
    }
View Full Code Here

     * Test of destroy method, of class UserController.
     */
    @Test
    public void testDestroy() {
        System.out.println("UserController:Destroy");
        User newUser = new User("testDestroy@agilebooster.com", "Forename", "Last Name", "password", true);
        UserController instance = new UserController();
        newUser = instance.create(newUser);
        assertTrue(instance.destroy(newUser));
        assertNull(instance.getUserByMail("testDestroy@agilebooster.com"));
    }
View Full Code Here

     */
    @Test
    public void testGetUsers() {
        System.out.println("UserController:GetUsers");
        UserController instance = new UserController();
        User user1 = new User("testGetUsers1@agilebooster.com", "Forename", "Last Name", "password", true);
        User user2 = new User("testGetUsers2@agilebooster.com", "Forename", "Last Name", "password", true);
        User user3 = new User("testGetUsers3@agilebooster.com", "Forename", "Last Name", "password", true);
        user1 = instance.create(user1);
        user2 = instance.create(user2);
        user3 = instance.create(user3);
        List result = instance.getUsers();
        assertTrue(result.contains(user1));
View Full Code Here

     */
    @Test
    public void testGetAdmins() {
        System.out.println("UserController:GetAdmins");
        UserController instance = new UserController();
        User user1 = new User("testGetAdmins1@agilebooster.com", "Forename", "Last Name", "password", true);
        User user2 = new User("testGetAdmins2@agilebooster.com", "Forename", "Last Name", "password", false);
        User user3 = new User("testGetAdmins3@agilebooster.com", "Forename", "Last Name", "password", true);
        user1 = instance.create(user1);
        user2 = instance.create(user2);
        user3 = instance.create(user3);
        List result = instance.getAdmins();
        assertTrue(result.contains(user1));
View Full Code Here

TOP

Related Classes of com.agilebooster.data.entity.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.