Package com.pugh.sockso.web

Examples of com.pugh.sockso.web.User.save()


                new String(txtPass1.getPassword()),
                txtEmail.getText(),
                isAdmin.isSelected()
            );

            newUser.save( db );
           
            usersPanel.refreshUsers();
            close();

        }
View Full Code Here


    }

    public void testAuthFailsWhenTheUserIsNotActive() throws Exception {
        User user = new User( -1, "fooaaaaaa", "bar", "foosss@bar.com" );
        user.setActive( false );
        user.save( db );
        assertFalse( auth.authenticate(user.getName(),"bar") );
    }

}
View Full Code Here

        cmd = new UserList( db );
    }

    public void testListingUsersReturnsTheirDetails() throws Exception {
        User user = new User( "foo", "", "foo@bar.com", true );
        user.save( db );
        String result = cmd.execute( new String[] { "userlist" } );
        assertContains( result, String.valueOf(user.getId()) );
        assertContains( result, user.getName() );
        assertContains( result, user.getEmail() );
    }
View Full Code Here

        assertContains( result, user.getEmail() );
    }

    public void testActiveUsersAreNotListedAsPending() throws Exception {
        User user = new User( "foo", "", "foo@bar.com", true );
        user.save( db );
        String result = cmd.execute( new String[] { "userlist" } );
        assertNotContains( result, "PENDING" );
    }

    public void testInactiveUsersAreListedAsPending() throws Exception {
View Full Code Here

    }

    public void testInactiveUsersAreListedAsPending() throws Exception {
        User user = new User( "foo", "", "foo@bar.com", true );
        user.setActive( false );
        user.save( db );
        String result = cmd.execute( new String[] { "userlist" } );
        assertContains( result, "PENDING" );
    }

    public void testListingUsersIncludesAdminIfTheyAreAnAdmin() throws Exception {
View Full Code Here

        assertContains( result, "PENDING" );
    }

    public void testListingUsersIncludesAdminIfTheyAreAnAdmin() throws Exception {
        User user = new User( "foo", "", "foo@bar.com", true );
        user.save( db );
        assertContains( cmd.execute( new String[] { "userlist" } ), "ADMIN" );
    }

    public void testListingUsersDoesntIncludeAdminIfTheyAreNotAnAdmin() throws Exception {
        User user = new User( "foo", "", "foo@bar.com", false );
View Full Code Here

        assertContains( cmd.execute( new String[] { "userlist" } ), "ADMIN" );
    }

    public void testListingUsersDoesntIncludeAdminIfTheyAreNotAnAdmin() throws Exception {
        User user = new User( "foo", "", "foo@bar.com", false );
        user.save( db );
        assertNotContains( cmd.execute( new String[] { "userlist" } ), "ADMIN" );
    }

}
View Full Code Here

                pass,
                email,
                isAdmin.equals("1") ? true : false
            );

            newUser.save( db );

            return newUser.getId() != -1
                ? locale.getString( "con.msg.userCreated")
                : locale.getString( "con.err.errorCreatingUser");
View Full Code Here

    public void testUserLoginFailsWhenUserIsNotActive() throws Exception {
        boolean gotException = false;
        try {
            User user = new User( -1, "foo", "bar", "doo@dpp.com" );
            user.setActive( false );
            user.save( db );
            u.loginUser( "foo", "bar" );
        }
        catch ( Exception e ) {
            gotException = true;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.