Examples of User


Examples of com.sun.jersey.samples.contacts.models.User

    @Test
    public void testCreateUpdateDeleteUser() {
        List<User> users = client.findUsers();
        assertEquals(1, users.size());
        User user = new User();
        user.setId("new_id");
        user.setUsername("OldUsername");
        user.setPassword("OldPassword");
        client.createUser(user);
        user = client.findUser("OldUsername");
        assertNotNull(user);
        assertEquals("new_id", user.getId());
        assertEquals("OldUsername", user.getUsername());
        assertEquals("OldPassword", user.getPassword());
        List<Contact> contacts = client.findContacts("OldUsername");
        assertEquals(0, contacts.size());
        users = client.findUsers();
        assertEquals(2, users.size());
        user.setPassword("NewPassword");
        client.updateUser(user);
        user = client.findUser("OldUsername");
        assertNotNull(user);
        assertEquals("new_id", user.getId());
        assertEquals("OldUsername", user.getUsername());
        assertEquals("NewPassword", user.getPassword());
        client.deleteUser("OldUsername");
        users = client.findUsers();
        assertEquals(1, users.size());
        try {
            client.findUser("OldUsername");
View Full Code Here

Examples of com.supinfo.analytics.entities.User

    @GET @Path("/login") @Produces(MediaType.APPLICATION_JSON)
    public Map<String, Object> login(
            @QueryParam("e") String email,
            @QueryParam("p") String password)
    {
        User u = userService.authenticateUser(email, password);
        if(u != null)
        {
            HashMap<String, Object> results = new HashMap<String, Object>();
            results.put("token", u.getToken());
            results.put("id", u.getId());
           
            return results;
        }
       
        return null;
View Full Code Here

Examples of com.swinarta.sunflower.core.model.User

  }

  @Get("json")
  public SgwtRestFetchResponseBase represent(){
      Authentication auth = SecurityContextHolder.getContext().getAuthentication();
      User actor = (User)auth.getPrincipal();
     
      DisplayLogin disp = mapper.map(actor, DisplayLogin.class);
     
      SgwtRestFetchResponseBase resp = new SgwtRestFetchResponseBase(disp);
   
View Full Code Here

Examples of com.talosdigital.cotejo.entity.User

 
  @Test
  public void testGetUserById(){
    when(userDao.getUserById(USER_ID)).thenReturn(user);
    when(user.getId()).thenReturn(USER_ID);
    User tempUser = userService.getUserById(USER_ID);
    assertEquals(USER_ID, tempUser.getId());
  }
View Full Code Here

Examples of com.tan.bean.User

 
  public static void main(String[] args) {
    StringBuffer symbol = new StringBuffer();
    StringBuffer sql = new StringBuffer();
   
    User dto = new User();
    dto.id = 1;
    //dto.lastTime = new Date();
    dto.realname = "realname";
    dto.username = "username";
   
    Class clz = dto.getClass();
    Table table = (Table) clz.getAnnotation(Table.class);
    if (null == table) {
      throw new RuntimeException("DTO内不含有Table注解Annotation");
    }
    sql.append("INSERT INTO ").append(table.name()).append(" (");
View Full Code Here

Examples of com.tap5.hotelbooking.entities.User

     * @return link to the current hotel booking
     */
    @OnEvent(value = EventConstants.SUCCESS, component = "startBookingForm")
    Object startBooking(Hotel hotel)
    {
        User user = (User) dao.find(User.class, authenticator.getLoggedUser().getId());
        userWorkspace.startBooking(hotel, user);
        return Book.class;
    }
View Full Code Here

Examples of com.tapestry5book.entities.User

        authenticator = new AuthenticatorImpl(userDao, applicationStateManager);
    }

    @Test
    public void authenticateSuccessfully() {
        expect(userDao.findByName("admin")).andReturn(new User("admin", "21232f297a57a5a743894a0e4a801fc3"));
        replay();

        User user = authenticator.authenticate("admin", "admin");

        verify();

        assertNotNull(user);
        assertEquals(user.getName(), "admin");
        assertEquals(user.getPassword(), "21232f297a57a5a743894a0e4a801fc3");
    }
View Full Code Here

Examples of com.tapestry5book.tlog.core.entities.User

    @Inject
    private ApplicationStateManager applicationStateManager;

    public User authenticate(String userName, String password) {
        User user = blogService.findUserByName(userName);

        if (user != null) {
            String digest = DigestUtils.md5Hex(password);

            if (user.getPassword().equals(digest)) {
                return user;
            }
        }

        return null;
View Full Code Here

Examples of com.taskadapter.redmineapi.bean.User

import java.util.Date;

public class UserGenerator {
    public static User generateRandomUser() {
        User user = UserFactory.create();
        user.setFirstName("fname");
        user.setLastName("lname");
        long randomNumber = new Date().getTime();
        user.setLogin("login" + randomNumber);
        user.setMail("somemail" + randomNumber + "@somedomain.com");
        user.setPassword("zzzz1234");
        return user;
    }
View Full Code Here

Examples of com.tcs.hrr.domain.User

  public void setSession(Map<String, Object> arg0) {
    this.session = arg0;
  }
  public String changePassword() throws Exception{
    System.out.println("oldpwd"+this.oldpassword);
    User user = (User)session.get("User");
    if(user.getPassword().equals(this.oldpassword)){
      user.setPassword(this.newpassword);
      this.userManager.mergeUser(user);
    }
    return SUCCESS;
  }
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.