Package domain.blog.mappers

Examples of domain.blog.mappers.AuthorMapper.selectAuthor()


    manager.startManagedSession();
    AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
    Author expected = new Author(500, "cbegin", "******", "cbegin@somewhere.com", "Something...", null);
    mapper.insertAuthor(expected);
    manager.close();
    Author actual = mapper.selectAuthor(500);
    assertNull(actual);
  }

  @Test
  public void shouldDeleteAuthorUsingMapperClass() throws Exception {
View Full Code Here


  @Test
  public void shouldDeleteAuthorUsingMapperClass() throws Exception {
    AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
    int count = mapper.deleteAuthor(101);
    assertEquals(1, count);
    assertNull(mapper.selectAuthor(101));
  }

  @Test
  public void shouldUpdateAuthorUsingMapperClass() throws Exception {
    AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
View Full Code Here

  }

  @Test
  public void shouldUpdateAuthorUsingMapperClass() throws Exception {
    AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
    Author expected = mapper.selectAuthor(101);
    expected.setUsername("NewUsername");
    int count = mapper.updateAuthor(expected);
    assertEquals(1, count);
    Author actual = mapper.selectAuthor(101);
    assertEquals(expected.getUsername(), actual.getUsername());
View Full Code Here

    AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
    Author expected = mapper.selectAuthor(101);
    expected.setUsername("NewUsername");
    int count = mapper.updateAuthor(expected);
    assertEquals(1, count);
    Author actual = mapper.selectAuthor(101);
    assertEquals(expected.getUsername(), actual.getUsername());
  }

  @Test
  public void shouldSelectAllPostsUsingMapperClass() throws Exception {
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.