assertNotNull( "List of users should not be null", allUsers );
assertTrue( "List of users should be greater or equal to 10", allUsers.size() >= 10 );
}
public void testSaveUser() {
UserInfo userInfo = new UserInfo();
userInfo.setUserName( "James" );
userInfo.setUserPassword( "Gosling" );
userInfo.setUserPrincipal( "User Principal" );
userInfo.setAdmin( true );
UserID userID = dao.addUser( userInfo );
// Modify the user info then update db
userInfo.setUserID( userID );
userInfo.setUserPassword( "Arnold" );
userInfo.setUserPrincipal( "Scott McNealy" );
userInfo.setAdmin( false );
dao.saveUser( userInfo );
// Verify that the info are indeed saved in the db
userInfo = dao.getUserInfo( userInfo.getUserID() );
assertEquals( "Arnold", userInfo.getUserPassword() );
assertEquals( "Scott McNealy", userInfo.getUserPrincipal() );
assertEquals( false, userInfo.isAdmin() );
}