Package org.ops4j.pax.exam.sample2.model

Examples of org.ops4j.pax.exam.sample2.model.User


      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


  }

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

    return "thymeleaf/users";
  }

  private void buildUserList(Model model) {
    List<User> users = new ArrayList<User>();
    users.add(new User("Paul", "Chapman"));
    users.add(new User("Mike", "Wiesner"));
    users.add(new User("Mark", "Secrist"));
    users.add(new User("Ken", "Krueger"));
    users.add(new User("Wes", "Gruver"));
    users.add(new User("Kevin", "Crocker"));
    model.addAttribute("users", users);
  }
View Full Code Here

    UsernamePasswordToken token = (UsernamePasswordToken) authcToken;
    String username = token.getUsername();
    char[] password = token.getPassword();
    String pwd = password != null ? new String(password) : null;

    User user = userManager.loadUser(username, pwd);

    if (user != null) {
      return new SimpleAuthenticationInfo(username, pwd, getName());
    } else {
      return null;
View Full Code Here

public class UserManagerImpl implements UserManager {

  @Override
  public User loadUser(String username, String password) {
    if ("111111".equals(username) && "111111".equals(password)) {
      return new User("111111", "111111");
    }
    if ("222222".equals(username) && "222222".equals(password)) {
      return new User("222222", "222222");
    }
    return null;
  }
View Full Code Here

   
   
   
    public List<User> FindAllUser(){
        List<User> users = new ArrayList<User>();
        User u = new User();
        u.setUser("admin");
        u.setPass("admin");
        u.setVivienda("Departamento");
        u.setNombre("Guillermo Barraza");
        u.setTitulo("Sr.");
        users.add(u);
       
        User o = new User();
       
        o.setUser("diego");
        o.setPass("urrutia");
        o.setVivienda("Casa");
        o.setNombre("Diego Urrutia");
        o.setTitulo("Sr.");
        users.add(o);
        return users;
    }
View Full Code Here

        Collection<Map<String, ?>> cast = (Collection<Map<String, ?>>) data.get("cast");
        for (Map<String, ?> entry : cast) {
            Integer id = (Integer) entry.get("id");
            String jobName = (String) entry.get("job");
            if ("Actor".equals(jobName)) {
                Actor actor = new Actor();
                actor.setId(id);
                doImportPerson(actor);
                Role role = new Role();
                role.setActor(actor);
                role.setMovie(movie);
                role.setName((String) entry.get("character"));
View Full Code Here

    @PersistenceContext
    private EntityManager em;

    public Actor findById(int id) {
        Actor actor = em.find(Actor.class, id);
        actor.getRoles();
        return actor;
    }
View Full Code Here

                role.setName((String) entry.get("character"));
                em.persist(role);
                movie.getRoles().add(role);
            }
            else if ("Director".equals(jobName)) {
                Director director = new Director();
                director.setId(id);
                director.getMovies().add(movie);
                doImportPerson(director);
                movie.setDirector(director);
            }
            else {
                logger.info("Could not add person with job {} {}", jobName, entry);
View Full Code Here

    @PersistenceContext
    private EntityManager em;

    public Movie findById(int id) {
        Movie movie = em.find(Movie.class, id);
        movie.getActors();
        movie.getRoles();
        movie.getRatings();
        return movie;
    }
View Full Code Here

TOP

Related Classes of org.ops4j.pax.exam.sample2.model.User

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.