Package com.rapleaf.jack.test_project.database_1.iface

Examples of com.rapleaf.jack.test_project.database_1.iface.ICommentPersistence.create()


    comments.deleteAll();
    Long userId = 1L;
    Long otherUserId = 2L;
    Comment c1 = comments.create("comment1", userId.intValue(), 1L, 0);
    Comment c2 = comments.create("comment2", userId.intValue(), 1L, 0);
    Comment c3 = comments.create("comment3", userId.intValue(), 1L, 0);
    Comment c4 = comments.create("comment4", otherUserId.intValue(), 1L, 0);
    Comment c5 = comments.create("comment5", 3, 1L, 0);

    Set<Long> commenterIds = new HashSet<Long>();
    commenterIds.add(userId);
View Full Code Here


    Long userId = 1L;
    Long otherUserId = 2L;
    Comment c1 = comments.create("comment1", userId.intValue(), 1L, 0);
    Comment c2 = comments.create("comment2", userId.intValue(), 1L, 0);
    Comment c3 = comments.create("comment3", userId.intValue(), 1L, 0);
    Comment c4 = comments.create("comment4", otherUserId.intValue(), 1L, 0);
    Comment c5 = comments.create("comment5", 3, 1L, 0);

    Set<Long> commenterIds = new HashSet<Long>();
    commenterIds.add(userId);
    commenterIds.add(otherUserId);
View Full Code Here

    Long otherUserId = 2L;
    Comment c1 = comments.create("comment1", userId.intValue(), 1L, 0);
    Comment c2 = comments.create("comment2", userId.intValue(), 1L, 0);
    Comment c3 = comments.create("comment3", userId.intValue(), 1L, 0);
    Comment c4 = comments.create("comment4", otherUserId.intValue(), 1L, 0);
    Comment c5 = comments.create("comment5", 3, 1L, 0);

    Set<Long> commenterIds = new HashSet<Long>();
    commenterIds.add(userId);
    commenterIds.add(otherUserId);
    Set<Comment> userComments = comments.findAllByForeignKey("commenter_id", commenterIds);
View Full Code Here

  }

  public void testFindAllByForeignKeyCache() throws Exception {
    ICommentPersistence comments = dbs.getDatabase1().comments();
    int userId = 1;
    comments.create("comment1", userId, 1, 1);
    comments.create("comment2", userId, 1, 1);
    comments.create("comment3", userId, 1, 1);

    Set<Comment> c1 = comments.findAllByForeignKey("commenter_id", userId);
    Set<Comment> c2 = comments.findAllByForeignKey("commenter_id", userId);
View Full Code Here

  public void testFindAllByForeignKeyCache() throws Exception {
    ICommentPersistence comments = dbs.getDatabase1().comments();
    int userId = 1;
    comments.create("comment1", userId, 1, 1);
    comments.create("comment2", userId, 1, 1);
    comments.create("comment3", userId, 1, 1);

    Set<Comment> c1 = comments.findAllByForeignKey("commenter_id", userId);
    Set<Comment> c2 = comments.findAllByForeignKey("commenter_id", userId);
    assertTrue(c1 == c2);
View Full Code Here

  public void testFindAllByForeignKeyCache() throws Exception {
    ICommentPersistence comments = dbs.getDatabase1().comments();
    int userId = 1;
    comments.create("comment1", userId, 1, 1);
    comments.create("comment2", userId, 1, 1);
    comments.create("comment3", userId, 1, 1);

    Set<Comment> c1 = comments.findAllByForeignKey("commenter_id", userId);
    Set<Comment> c2 = comments.findAllByForeignKey("commenter_id", userId);
    assertTrue(c1 == c2);
  }
View Full Code Here

  public void testTransactionRollback() throws IOException {
    dbs.getDatabase1().setAutoCommit(false);

    ICommentPersistence comments = dbs.getDatabase1().comments();
    try {
      comments.create("comment1", 1, 1, 1);
      assertEquals("There should be 1 record during transaction", 1, comments.findAll().size());

      dbs.getDatabase1().rollback();
     
      assertEquals("There should be 0 records after rollback", 0, comments.findAll().size());
View Full Code Here

  }

  public void testFindAllByForeignKey() throws Exception {
    ICommentPersistence comments = dbs.getDatabase1().comments();
    int userId = 1;
    Comment c1 = comments.create("comment1", userId, 1L, 1);
    Comment c2 = comments.create("comment2", userId, 1L, 1);
    Comment c3 = comments.create("comment3", userId, 1L, 1);

    Set<Comment> userComments = comments.findAllByForeignKey("commenter_id", userId);
    assertEquals(3, userComments.size());
View Full Code Here

  public void testFindAllByForeignKey() throws Exception {
    ICommentPersistence comments = dbs.getDatabase1().comments();
    int userId = 1;
    Comment c1 = comments.create("comment1", userId, 1L, 1);
    Comment c2 = comments.create("comment2", userId, 1L, 1);
    Comment c3 = comments.create("comment3", userId, 1L, 1);

    Set<Comment> userComments = comments.findAllByForeignKey("commenter_id", userId);
    assertEquals(3, userComments.size());
    assertTrue(userComments.contains(c1));
View Full Code Here

  public void testFindAllByForeignKey() throws Exception {
    ICommentPersistence comments = dbs.getDatabase1().comments();
    int userId = 1;
    Comment c1 = comments.create("comment1", userId, 1L, 1);
    Comment c2 = comments.create("comment2", userId, 1L, 1);
    Comment c3 = comments.create("comment3", userId, 1L, 1);

    Set<Comment> userComments = comments.findAllByForeignKey("commenter_id", userId);
    assertEquals(3, userComments.size());
    assertTrue(userComments.contains(c1));
    assertTrue(userComments.contains(c2));
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.