Package org.drools.task

Examples of org.drools.task.Comment


                    session.write(resultsCmnd);
                    break;
                }
                case AddCommentRequest: {
                    response = CommandName.AddCommentResponse;
                    Comment comment = (Comment) cmd.getArguments().get(1);
                    taskSession.addComment((Long) cmd.getArguments().get(0),
                            comment);

                    List args = new ArrayList(1);
                    args.add(comment.getId());
                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.AddCommentResponse,
                            args);
                    session.write(resultsCmnd);
                    break;
View Full Code Here


   
    public static List<Comment> readCommentList(ObjectInput in) throws IOException, ClassNotFoundException  {
        int size = in.readInt();
        List<Comment> list = new ArrayList<Comment>(size);
        for ( int i = 0; i < size; i++ ) {
            Comment item = new Comment();
            item.readExternal( in );
            list.add( item );
        }
        return list;
    }    
View Full Code Here

        Task task = ( Task eval( new StringReader( str ), vars );
        client.addTask( task, null, addTaskResponseHandler );
       
        long taskId = addTaskResponseHandler.getTaskId();
       
        Comment comment = new Comment();
        Date addedAt = new Date( System.currentTimeMillis() );
        comment.setAddedAt( addedAt );
        comment.setAddedBy( users.get( "luke" ) );
        comment.setText( "This is my comment1!!!!!" );
       
        BlockingAddCommentResponseHandler addCommentResponseHandler = new BlockingAddCommentResponseHandler();
        client.addComment( taskId, comment,addCommentResponseHandler );     
        assertTrue( addCommentResponseHandler.getCommentId() != comment.getId() );
       
        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.getTask( taskId, getTaskResponseHandler );
        Task task1 = getTaskResponseHandler.getTask();
        assertNotSame(task, task1);
        assertFalsetask.equals( task1) );
      
        List<Comment> comments1 = task1.getTaskData().getComments();
        assertEquals(1, comments1.size() );
        Comment returnedComment = comments1.get( 0 );       
        assertEquals( "This is my comment1!!!!!", returnedComment.getText() );
        assertEquals( addedAt, returnedComment.getAddedAt() );
        assertEquals( users.get( "luke" ), returnedComment.getAddedBy() );
       
        assertEquals( (long)addCommentResponseHandler.getCommentId(), (long) returnedComment.getId() );
       
        // Make the same as the returned tasks, so we can test equals
        task.getTaskData().setComments( comments1 );
        task.getTaskData().setStatus( Status.Created );
        assertEquals(task, task1);      
       
        // test we can have multiple comments
        comment = new Comment();
        addedAt = new Date( System.currentTimeMillis() );
        comment.setAddedAt( addedAt );
        comment.setAddedBy( users.get( "tony" ) );
        comment.setText( "This is my comment2!!!!!" );
       
View Full Code Here

        Task task = ( Task eval( new StringReader( str ), vars );
        client.addTask( task, null, addTaskResponseHandler );
       
        long taskId = addTaskResponseHandler.getTaskId();
       
        Comment comment = new Comment();
        Date addedAt = new Date( System.currentTimeMillis() );
        comment.setAddedAt( addedAt );
        comment.setAddedBy( users.get( "luke" ) );
        comment.setText( "This is my comment1!!!!!" );
       
        BlockingAddCommentResponseHandler addCommentResponseHandler = new BlockingAddCommentResponseHandler();
        client.addComment( taskId, comment,addCommentResponseHandler );     
        assertTrue( addCommentResponseHandler.getCommentId() != comment.getId() );
       
        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.getTask( taskId, getTaskResponseHandler );
        Task task1 = getTaskResponseHandler.getTask();
        assertNotSame(task, task1);
        assertFalsetask.equals( task1) );
      
        List<Comment> comments1 = task1.getTaskData().getComments();
        assertEquals(1, comments1.size() );
        Comment returnedComment = comments1.get( 0 );       
        assertEquals( "This is my comment1!!!!!", returnedComment.getText() );
        assertEquals( addedAt, returnedComment.getAddedAt() );
        assertEquals( users.get( "luke" ), returnedComment.getAddedBy() );
       
        assertEquals( (long)addCommentResponseHandler.getCommentId(), (long) returnedComment.getId() );
       
        // Make the same as the returned tasks, so we can test equals
        task.getTaskData().setComments( comments1 );
        task.getTaskData().setStatus( Status.Created );
        assertEquals(task, task1);      
       
        // test we can have multiple comments
        comment = new Comment();
        addedAt = new Date( System.currentTimeMillis() );
        comment.setAddedAt( addedAt );
        comment.setAddedBy( users.get( "tony" ) );
        comment.setText( "This is my comment2!!!!!" );
       
View Full Code Here

        // is caching things.
        Task task = em.find( Task.class,
                             taskId );
        em.getTransaction().begin();
        for ( Iterator<Comment> it = task.getTaskData().getComments().iterator(); it.hasNext(); ) {
            Comment comment = it.next();
            if ( comment.getId() == commentId ) {
                it.remove();
                em.remove( comment ); // need to do this otherwise it just removes the link id, without removing the comment
                break;
            }
        }
View Full Code Here

                    session.write( resultsCmnd );
                    break;
                }
                case AddCommentRequest : {
                    response = CommandName.AddCommentResponse;
                    Comment comment = (Comment) cmd.getArguments().get( 1 );
                    taskSession.addComment( (Long) cmd.getArguments().get( 0 ),
                                            comment );

                    List args = new ArrayList( 1 );
                    args.add( comment.getId() );
                    Command resultsCmnd = new Command( cmd.getId(),
                                                       CommandName.AddCommentResponse,
                                                       args );
                    session.write( resultsCmnd );
                    break;
View Full Code Here

                    session.write(resultsCmnd);
                    break;
                }
                case AddCommentRequest: {
                    response = CommandName.AddCommentResponse;
                    Comment comment = (Comment) cmd.getArguments().get(1);
                    taskSession.addComment((Long) cmd.getArguments().get(0),
                            comment);

                    List args = new ArrayList(1);
                    args.add(comment.getId());
                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.AddCommentResponse,
                            args);
                    session.write(resultsCmnd);
                    break;
View Full Code Here

   
    public static List<Comment> readCommentList(ObjectInput in) throws IOException, ClassNotFoundException  {
        int size = in.readInt();
        List<Comment> list = new ArrayList<Comment>(size);
        for ( int i = 0; i < size; i++ ) {
            Comment item = new Comment();
            item.readExternal( in );
            list.add( item );
        }
        return list;
    }    
View Full Code Here

        Task task = ( Task eval( new StringReader( str ), vars );
        client.addTask( task, null, addTaskResponseHandler );
       
        long taskId = addTaskResponseHandler.getTaskId();
       
        Comment comment = new Comment();
        Date addedAt = new Date( System.currentTimeMillis() );
        comment.setAddedAt( addedAt );
        comment.setAddedBy( users.get( "luke" ) );
        comment.setText( "This is my comment1!!!!!" );
       
        BlockingAddCommentResponseHandler addCommentResponseHandler = new BlockingAddCommentResponseHandler();
        client.addComment( taskId, comment,addCommentResponseHandler );     
        assertTrue( addCommentResponseHandler.getCommentId() != comment.getId() );
       
        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.getTask( taskId, getTaskResponseHandler );
        Task task1 = getTaskResponseHandler.getTask();
        assertNotSame(task, task1);
        assertFalsetask.equals( task1) );
      
        List<Comment> comments1 = task1.getTaskData().getComments();
        assertEquals(1, comments1.size() );
        Comment returnedComment = comments1.get( 0 );       
        assertEquals( "This is my comment1!!!!!", returnedComment.getText() );
        assertEquals( addedAt, returnedComment.getAddedAt() );
        assertEquals( users.get( "luke" ), returnedComment.getAddedBy() );
       
        assertEquals( (long)addCommentResponseHandler.getCommentId(), (long) returnedComment.getId() );
       
        // Make the same as the returned tasks, so we can test equals
        task.getTaskData().setComments( comments1 );
        task.getTaskData().setStatus( Status.Created );
        assertEquals(task, task1);      
       
        // test we can have multiple comments
        comment = new Comment();
        addedAt = new Date( System.currentTimeMillis() );
        comment.setAddedAt( addedAt );
        comment.setAddedBy( users.get( "tony" ) );
        comment.setText( "This is my comment2!!!!!" );
       
View Full Code Here

        Task task = ( Task eval( new StringReader( str ), vars );
        client.addTask( task, null, addTaskResponseHandler );
       
        long taskId = addTaskResponseHandler.getTaskId();
       
        Comment comment = new Comment();
        Date addedAt = new Date( System.currentTimeMillis() );
        comment.setAddedAt( addedAt );
        comment.setAddedBy( users.get( "luke" ) );
        comment.setText( "This is my comment1!!!!!" );
       
        BlockingAddCommentResponseHandler addCommentResponseHandler = new BlockingAddCommentResponseHandler();
        client.addComment( taskId, comment,addCommentResponseHandler );     
        assertTrue( addCommentResponseHandler.getCommentId() != comment.getId() );
       
        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.getTask( taskId, getTaskResponseHandler );
        Task task1 = getTaskResponseHandler.getTask();
        assertNotSame(task, task1);
        assertFalsetask.equals( task1) );
      
        List<Comment> comments1 = task1.getTaskData().getComments();
        assertEquals(1, comments1.size() );
        Comment returnedComment = comments1.get( 0 );       
        assertEquals( "This is my comment1!!!!!", returnedComment.getText() );
        assertEquals( addedAt, returnedComment.getAddedAt() );
        assertEquals( users.get( "luke" ), returnedComment.getAddedBy() );
       
        assertEquals( (long)addCommentResponseHandler.getCommentId(), (long) returnedComment.getId() );
       
        // Make the same as the returned tasks, so we can test equals
        task.getTaskData().setComments( comments1 );
        task.getTaskData().setStatus( Status.Created );
        assertEquals(task, task1);      
       
        // test we can have multiple comments
        comment = new Comment();
        addedAt = new Date( System.currentTimeMillis() );
        comment.setAddedAt( addedAt );
        comment.setAddedBy( users.get( "tony" ) );
        comment.setText( "This is my comment2!!!!!" );
       
View Full Code Here

TOP

Related Classes of org.drools.task.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.