Examples of BlockingGetContentResponseHandler


Examples of org.drools.task.service.BlockingGetContentResponseHandler

    client.getTask(taskSummary.getId(), getTaskResponseHandler);
    Task task = getTaskResponseHandler.getTask();
    assertEquals(AccessType.Inline, task.getTaskData().getDocumentAccessType());
    long contentId = task.getTaskData().getDocumentContentId();
    assertTrue(contentId != -1);
    BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
    client.getContent(contentId, getContentResponseHandler);
    ByteArrayInputStream bis = new ByteArrayInputStream(getContentResponseHandler.getContent().getContent());
    ObjectInputStream in = new ObjectInputStream(bis);
    Object data = in.readObject();
    in.close();
    assertEquals("This is the content", data);
   
View Full Code Here

Examples of org.drools.task.service.responsehandlers.BlockingGetContentResponseHandler

      client.getTask(new Long(ref.getReferenceId()), getTaskResponseHandler);
    Task task = getTaskResponseHandler.getTask();
    Object input = null;
    long contentId = task.getTaskData().getDocumentContentId();
    if (contentId != -1) {
      BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
        client.getContent(contentId, getContentResponseHandler);
        Content content = getContentResponseHandler.getContent();
        ByteArrayInputStream bis = new ByteArrayInputStream(content.getContent());
      ObjectInputStream in;
      try {
        in = new ObjectInputStream(bis);
        input = in.readObject();
View Full Code Here

Examples of org.drools.task.service.responsehandlers.BlockingGetContentResponseHandler

      client.getTask(new Long(ref.getReferenceId()), getTaskResponseHandler);
    Task task = getTaskResponseHandler.getTask();
    Object input = null;
    long contentId = task.getTaskData().getDocumentContentId();
    if (contentId != -1) {
      BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
        client.getContent(contentId, getContentResponseHandler);
        Content content = getContentResponseHandler.getContent();
        ByteArrayInputStream bis = new ByteArrayInputStream(content.getContent());
      ObjectInputStream in;
      try {
        in = new ObjectInputStream(bis);
        input = in.readObject();
View Full Code Here

Examples of org.drools.task.service.responsehandlers.BlockingGetContentResponseHandler

        // Make the same as the returned tasks, so we can test equals
        task.getTaskData().setAttachments( attachments1 );
        task.getTaskData().setStatus( Status.Created );
        assertEquals(task, task1);           
       
        BlockingGetContentResponseHandler  getResponseHandler = new BlockingGetContentResponseHandler();
        client.getContent( returnedAttachment.getAttachmentContentId(), getResponseHandler );
        content = getResponseHandler.getContent();
        assertEquals( "Ths is my attachment text1", new String( content.getContent() ) );
       
        // test we can have multiple attachments
       
        attachment = new Attachment();
        attachedAt = new Date( System.currentTimeMillis() );
        attachment.setAttachedAt( attachedAt);
        attachment.setAttachedBy( users.get( "tony" ) );
        attachment.setName( "file2.txt" );
        attachment.setAccessType( AccessType.Inline );
        attachment.setContentType( "txt" );
       
        bytes = "Ths is my attachment text2".getBytes();
        content = new Content();
        content.setContent( bytes );
       
        addAttachmentResponseHandler = new BlockingAddAttachmentResponseHandler();
        client.addAttachment( taskId, attachment, content, addAttachmentResponseHandler);  
       
        getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.getTask( taskId, getTaskResponseHandler );
        task1 = getTaskResponseHandler.getTask();
        assertNotSame(task, task1);
        assertFalsetask.equals( task1) );
      
        List<Attachment> attachments2 = task1.getTaskData().getAttachments();
        assertEquals(2, attachments2.size() );
       
        getResponseHandler = new BlockingGetContentResponseHandler();
        client.getContent( addAttachmentResponseHandler.getContentId(), getResponseHandler );
        content = getResponseHandler.getContent();
        assertEquals( "Ths is my attachment text2", new String( content.getContent() ) );       
       
        // make two collections the same and compare
        attachment.setSize( 26 );
        attachment.setAttachmentContentId( addAttachmentResponseHandler.getContentId() );
View Full Code Here

Examples of org.drools.task.service.responsehandlers.BlockingGetContentResponseHandler

        Content content = new Content();
        content.setContent( "['subject' : 'My Subject', 'body' : 'My Body']".getBytes() );
        BlockingSetContentResponseHandler setContentResponseHandler  = new BlockingSetContentResponseHandler();
        client.setDocumentContent( taskId, content, setContentResponseHandler );
        long contentId = setContentResponseHandler.getContentId();
        BlockingGetContentResponseHandler  getResponseHandler = new BlockingGetContentResponseHandler();
        client.getContent( contentId, getResponseHandler );
        content = getResponseHandler.getContent();
        assertEquals( "['subject' : 'My Subject', 'body' : 'My Body']", new String( content.getContent() ) );
       
        // emails should not be set yet
        assertEquals(0, wiser.getMessages().size() );            
        Thread.sleep( 100 );
View Full Code Here

Examples of org.drools.task.service.responsehandlers.BlockingGetContentResponseHandler

        assertEquals( AccessType.Inline, task1.getTaskData().getDocumentAccessType() );
        assertEquals( "type", task1.getTaskData().getDocumentType() );
        long contentId = task1.getTaskData().getDocumentContentId();
        assertTrue( contentId != -1 );

        BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
        client.getContent(contentId, getContentResponseHandler);
        Content content = getContentResponseHandler.getContent();
        assertEquals("content", new String(content.getContent()));
    }
View Full Code Here

Examples of org.drools.task.service.responsehandlers.BlockingGetContentResponseHandler

        assertEquals( AccessType.Inline, task2.getTaskData().getOutputAccessType() );
        assertEquals( "type", task2.getTaskData().getOutputType() );
        long contentId = task2.getTaskData().getOutputContentId();
        assertTrue( contentId != -1 );
       
        BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
        client.getContent(contentId, getContentResponseHandler);
        Content content = getContentResponseHandler.getContent();
        assertEquals("content", new String(content.getContent()));
    }
View Full Code Here

Examples of org.drools.task.service.responsehandlers.BlockingGetContentResponseHandler

        assertEquals( "type", task2.getTaskData().getFaultType() );
        assertEquals( "faultName", task2.getTaskData().getFaultName() );
        long contentId = task2.getTaskData().getFaultContentId();
        assertTrue( contentId != -1 );
       
        BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
        client.getContent(contentId, getContentResponseHandler);
        Content content = getContentResponseHandler.getContent();
        assertEquals("content", new String(content.getContent()));
    }
View Full Code Here

Examples of org.drools.task.service.responsehandlers.BlockingGetContentResponseHandler

        client.getTask(taskSummary.getId(), getTaskResponseHandler);
        Task task = getTaskResponseHandler.getTask();
        assertEquals(AccessType.Inline, task.getTaskData().getDocumentAccessType());
        long contentId = task.getTaskData().getDocumentContentId();
        assertTrue(contentId != -1);
        BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
        client.getContent(contentId, getContentResponseHandler);
        ByteArrayInputStream bis = new ByteArrayInputStream(getContentResponseHandler.getContent().getContent());
        ObjectInputStream in = new ObjectInputStream(bis);
        Object data = in.readObject();
        in.close();
        assertEquals("This is the content", data);
View Full Code Here

Examples of org.drools.task.service.responsehandlers.BlockingGetContentResponseHandler

    getClient().getTask(taskSummary.getId(), getTaskResponseHandler);
    Task task = getTaskResponseHandler.getTask();
    assertEquals(AccessType.Inline, task.getTaskData().getDocumentAccessType());
    long contentId = task.getTaskData().getDocumentContentId();
    assertTrue(contentId != -1);
    BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
    getClient().getContent(contentId, getContentResponseHandler);
    ByteArrayInputStream bis = new ByteArrayInputStream(getContentResponseHandler.getContent().getContent());
    ObjectInputStream in = new ObjectInputStream(bis);
    Object data = in.readObject();
    in.close();
    assertEquals("This is the content", data);
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.