Package br.com.visualmidia.persistence

Examples of br.com.visualmidia.persistence.GetUser


    protected void setUp() throws Exception {
        super.setUp();
        display = new Display();
        GDSystem.setStandAloneMode();
        system = GDSystem.getInstance();
        system.login((Person) system.query(new GetUser("admin")));
        system.authenticate("admin", "gdadmin");
        studentRegisterScreen = new StudentControlCenter(new CTabFolder(new Shell(display),SWT.NONE), SWT.NONE, new MainScreen());
        studentRegisterScreen.display();
    }
View Full Code Here


        super.setUp();
        display = new Display();
        GDSystem.setStandAloneMode();
        new GDSetup().start();
        system = GDSystem.getInstance();
        system.login((Person) system.query(new GetUser("admin")));
        system.authenticate("admin", "gdadmin");

        registerMachineControlCenter = new RegisterMachineControlCenter(new CTabFolder(new Shell(display),SWT.NONE), SWT.NONE, new MainScreen());
        registerMachineControlCenter.display();
View Full Code Here

        Person user = (Person) system.query(new GetPersonByName("Desenvolvedor do Sistema"));
        system.execute(new AddUserToGroup("Secret�ria Geral", user));
    }
   
    public void testIfSystemUserIsNotOk() throws Exception {
        Person person = (Person) system.query(new GetUser("developer"));
        User user = (User) person.getPersonType("user");
        assertNotSame("senhaErrada", user.getPassword());
    }
View Full Code Here

        User user = (User) person.getPersonType("user");
        assertNotSame("senhaErrada", user.getPassword());
    }

    public void testIfSystemUserIsOk() throws Exception {
        Person person = (Person) system.query(new GetUser("developer"));
        User user = (User) person.getPersonType("user");
        assertEquals("simpsons", user.getPassword());
    }
View Full Code Here

        User user = (User) person.getPersonType("user");
        assertEquals("simpsons", user.getPassword());
    }

    public void testSystemAuthentication() throws Exception {
        Person person = (Person) system.query(new GetUser("developer"));
        User user = (User) person.getPersonType("user");
        assertFalse(system.authenticate(user.getUserName(), "senhaErrada"));
        assertTrue(system.authenticate(user.getUserName(), "simpsons"));
    }
View Full Code Here

        this.userID = userID;
    }
   
    public boolean validate() {
        try {
            Person user = (Person) system.query(new GetUser(control.getText()));
            if(!user.getId().equals(userID.getText())) {
                control.setBackground(backgroundProblem);
                addMessage();
                return true;
            } else {
View Full Code Here

    }

    public boolean authenticate(String userName, String passWord) {
        Person person;
        try {
            person = (Person) query(new GetUser(userName));
            if (person.isPersonType("employee")) {
                Employee employee = (Employee) person.getPersonType("employee");
                if (employee.isActivated()) {
                    User user = (User) person.getPersonType("user");
                    isAuthenticated = user.getPassword().equals(passWord);
View Full Code Here

TOP

Related Classes of br.com.visualmidia.persistence.GetUser

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.