Package com.firefly.demo1.service

Examples of com.firefly.demo1.service.UserService


      connection = dataSource.getConnection();
      preparedStatement = connection
          .prepareStatement("select id, name, password from cms_user");
      resultSet = preparedStatement.executeQuery();
      while (resultSet.next()) {
        User user = new User();
        user.setId(resultSet.getString("id"));
        user.setName(resultSet.getString("name"));
        user.setPassword(resultSet.getString("password"));
        ret.add(user);
      }
      connection.commit();

    } catch (SQLException e) {
View Full Code Here


*/
public class UserTests extends ForgeAPITestBase {

  @Test
  public void testListUsers() throws IOException {
    UserService service = getTestUserForge().createUserService();
    List<User> Users = service.list(null);
    assertNotNull("Null User list", Users);
    assertFalse("Empty User list", Users.isEmpty());
  }
View Full Code Here

    assertFalse("Empty User list", Users.isEmpty());
  }

  @Test
  public void testListUsersSorted() throws IOException {
    UserService service = getTestUserForge().createUserService();
    ListPreferences listPrefs = new ListPreferences();
    listPrefs.setLimit(4);
    listPrefs.setOffset(1);
    listPrefs.setSortBy("username");
    listPrefs.setSortOrder("descending");
    List<User> Users = service.list(listPrefs);
    assertNotNull("Null User list", Users);
    assertFalse("Empty User list", Users.isEmpty());
  }
View Full Code Here

    assertFalse("Empty User list", Users.isEmpty());
  }

  @Test
  public void testUserDetail() throws IOException {
    UserService service = getTestUserForge().createUserService();
    User user = service.get(TEST_USER);
    assertNotNull("Null user", user);
  }
View Full Code Here

TOP

Related Classes of com.firefly.demo1.service.UserService

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.