Package se.gu.fire.data

Examples of se.gu.fire.data.PasswordManager


        testBean.clearDb();
    }

    @Test
    public void insertAndGetPassword() {
        PasswordManager pm = new PasswordManager();
        pm.setEntityManager(em);
       
        UserManager um = new UserManager();
        um.setEntityManager(em);
       
        em.getTransaction().begin();
        Password password = new Password(10L, "tio");
        pm.create(password);
        em.getTransaction().commit();

        assertNotNull(pm.read(10L));

    }
View Full Code Here


    }
   
    @Test
    public void associatePasswordWithUser() {
        PasswordManager pm = new PasswordManager();
        pm.setEntityManager(em);
       
        UserManager um = new UserManager();
        um.setEntityManager(em);
       
        FireUser oscar = TestUtil.createRandomUser();

        em.getTransaction().begin();
        um.create(oscar);
        em.getTransaction().commit();
       
        FireUser u5 = um.read(oscar.getId());
        assertNotNull(u5);

        String smart = "haxx";
        Password oscarsPassword = new Password(oscar.getId(), smart);
        em.getTransaction().begin();
        pm.create(oscarsPassword);
        em.getTransaction().commit();
       
        assertNotNull(pm.findPassword(oscar, smart));
        assertNull(pm.findPassword(oscar, "ohack"));

    }
View Full Code Here

        assignMan = new AssignmentManager();
        subMan = new SubmissionManager();
        userMan = new UserManager();
        groupMan = new GroupManager();
        comMan = new CommentManager();
        passMan = new PasswordManager();
        fileMan = new StoredFileManager();
        mans = collectMans();

        for (IDataAccessO<?, ?> man : mans) man.setEntityManager(entMan);
    }
View Full Code Here

TOP

Related Classes of se.gu.fire.data.PasswordManager

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.