Package edu.chl.jadetalk.core

Examples of edu.chl.jadetalk.core.Comment


        userManagerBean.removeUser(user);
    }

    //Remove comment
    public void removeComment(ActionEvent e) {
        Comment comm = (Comment) e.getComponent().getAttributes().get(conBack.getCommentAttName());
        commentFacade.remove(comm);
    }
View Full Code Here


    }
   
    @Test
    public void testCreate() {
       
        Comment comment1 = new Comment();
        comment1.setCommentText("comment1");
       
        Comment comment2 = new Comment();
        comment2.setCommentText("comment2");
       
        beginTr();
        commentFacade.create(comment1);
        commentFacade.create(comment2);
        commitTr();
       
        Comment comment1db = em.find(Comment.class, comment1.getId());
        Comment comment2db = em.find(Comment.class, comment2.getId());
       
        assertEquals(comment1, comment1db);
        assertEquals(comment2, comment2db);
        assertEquals(comment1.getCommentText(), "comment1");
        assertEquals(comment2.getCommentText(), "comment2");
View Full Code Here

    }
   
    @Test
    public void testEdit() {
       
        Comment comment1 = new Comment();
        comment1.setCommentText("comment1");
       
        Comment comment2 = new Comment();
        comment2.setCommentText("comment2");
       
        beginTr();
        em.persist(comment1);
        em.persist(comment2);
        commitTr();
       
        comment1.setCommentText("othercomment1");
        comment2.setCommentText("othercomment2");
       
        beginTr();
        commentFacade.edit(comment1);
        commentFacade.edit(comment2);
        commitTr();
       
        assertEquals(comment1.getCommentText(), em.find(Comment.class, comment1.getId()).getCommentText());
        assertEquals(comment2.getCommentText(), em.find(Comment.class, comment2.getId()).getCommentText());
       
        beginTr();
        em.remove(comment1);
        em.remove(comment2);
        commitTr();
View Full Code Here

    }
   
    @Test
    public void testRemove() {
       
        Comment comment1 = new Comment();
        Comment comment2 = new Comment();
       
        beginTr();
        em.persist(comment1);
        em.persist(comment2);
        commitTr();
       
        beginTr();
        commentFacade.remove(comment1);
        commentFacade.remove(comment2);
        commitTr();
       
        assertFalse(em.contains(comment1));
        assertFalse(em.contains(comment2));
        assertNull(em.find(Comment.class, comment1.getId()));
        assertNull(em.find(Comment.class, comment2.getId()));
       
    }
View Full Code Here

    }
   
    @Test
    public void testFind() {
       
        Comment comment1 = new Comment();
       
        beginTr();
        em.persist(comment1);
        commitTr();
       
        Comment comment1db = commentFacade.find(comment1.getId());
       
        assertEquals(comment1, comment1db);
       
        beginTr();
        em.remove(comment1);
View Full Code Here

    }
   
    @Test
    public void testFindAll() {
       
        Comment comment1 = new Comment();
        Comment comment2 = new Comment();
       
        beginTr();
        em.persist(comment1);
        em.persist(comment2);
        commitTr();
View Full Code Here

    }
   
    @Test
    public void testFindRange() {
       
        Comment comment1 = new Comment();
        Comment comment2 = new Comment();
        Comment comment3 = new Comment();
       
        beginTr();
        em.persist(comment1);
        em.persist(comment2);
        em.persist(comment3);
View Full Code Here

    }
   
    @Test
    public void testCount() {
       
        Comment comment1 = new Comment();
        Comment comment2 = new Comment();
        Comment comment3 = new Comment();
       
        beginTr();
        em.persist(comment3);
        em.persist(comment2);
        em.persist(comment1);
View Full Code Here

TOP

Related Classes of edu.chl.jadetalk.core.Comment

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.