Package org.jbpm.formbuilder.shared.task

Examples of org.jbpm.formbuilder.shared.task.TaskRef


        GuvnorTaskDefinitionService service = createService(baseUrl, "", "");
        String process1Content = IOUtils.toString(getClass().getResourceAsStream("GuvnorGetProcessTasksTest.bpmn2"));
        String processName = "testProcess.bpmn2";
        String taskName = "Review";
       
        TaskRef task = service.getBPMN2Task(process1Content, processName, taskName);
        assertNotNull("task shouldn't be null", task);
        assertNotNull("task.taskId shouldn't be null", task.getTaskId());
        assertNotNull("task.processId shouldn't be null", task.getProcessId());
        assertEquals("task.taskName should be the same as taskName", taskName, task.getTaskName());
    }
View Full Code Here


        GuvnorTaskDefinitionService service = createService(baseUrl, "", "");
        String process1Content = "";
        String processId = "AFileThatDoesntBelongHere.txt";
        String taskId = "Review";
       
        TaskRef task = service.getBPMN2Task(process1Content, processId, taskId);
        assertNull("task should be null", task);
    }
View Full Code Here

        GuvnorTaskDefinitionService service = createService(baseUrl, "", "");
        String process1Content = IOUtils.toString(getClass().getResourceAsStream("GuvnorGetProcessTasksTest2.bpmn2"));
        String processId = "testProcess.bpmn2";
        String taskId = "ATaskThatDoesntExist";
       
        TaskRef task = service.getBPMN2Task(process1Content, processId, taskId);
        assertNull("task should be null", task);
    }
View Full Code Here

        String xml = "<some><bpmn2><content/></bpmn2></some>";
        BufferedReader reader = new BufferedReader(new StringReader(xml));
        EasyMock.expect(request.getReader()).andReturn(reader);
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        TaskDefinitionService taskService = EasyMock.createMock(TaskDefinitionService.class);
        TaskRef task = new TaskRef();
        task.setPackageName("somePackage");
        EasyMock.expect(taskService.getBPMN2Task(EasyMock.eq(xml), EasyMock.eq("PROCESS_NAME"), EasyMock.eq("USER_TASK"))).andReturn(task).once();
        FormRepresentation form = RESTAbstractTest.createMockForm("myForm", "myParam");
        EasyMock.expect(formService.getAssociatedForm(EasyMock.eq("somePackage"), EasyMock.eq(task))).andReturn(form).once();
        EmbedingServlet servlet = createServlet(formService, taskService);
        request.setAttribute(EasyMock.eq("jsonData"), EasyMock.anyObject(String.class));
View Full Code Here

        String xml = "<some><bpmn2><content/></bpmn2></some>";
        BufferedReader reader = new BufferedReader(new StringReader(xml));
        EasyMock.expect(request.getReader()).andReturn(reader);
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        TaskDefinitionService taskService = EasyMock.createMock(TaskDefinitionService.class);
        TaskRef task = new TaskRef();
        task.setPackageName("somePackage");
        EasyMock.expect(taskService.getBPMN2Task(EasyMock.eq(xml), EasyMock.eq("PROCESS_NAME"), EasyMock.eq("USER_TASK"))).andReturn(task).once();
        EasyMock.expect(formService.getAssociatedForm(EasyMock.eq("somePackage"), EasyMock.eq(task))).andReturn(null).once();
        EmbedingServlet servlet = createServlet(formService, taskService);
        request.setAttribute(EasyMock.eq("jsonData"), EasyMock.anyObject(String.class));
        EasyMock.expectLastCall().once();
View Full Code Here

        String xml = "<some><bpmn2><content/></bpmn2></some>";
        BufferedReader reader = new BufferedReader(new StringReader(xml));
        EasyMock.expect(request.getReader()).andReturn(reader);
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        TaskDefinitionService taskService = EasyMock.createMock(TaskDefinitionService.class);
        TaskRef task = new TaskRef();
        task.setPackageName("somePackage");
        EasyMock.expect(taskService.getBPMN2Task(EasyMock.eq(xml), EasyMock.eq("PROCESS_NAME"), EasyMock.eq("USER_TASK"))).
            andThrow(new TaskServiceException("problem")).once();
        EmbedingServlet servlet = createServlet(formService, taskService);
        response.sendError(EasyMock.eq(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), EasyMock.anyObject(String.class));
        EasyMock.expectLastCall().once();
View Full Code Here

        String xml = "<some><bpmn2><content/></bpmn2></some>";
        BufferedReader reader = new BufferedReader(new StringReader(xml));
        EasyMock.expect(request.getReader()).andReturn(reader);
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        TaskDefinitionService taskService = EasyMock.createMock(TaskDefinitionService.class);
        TaskRef task = new TaskRef();
        task.setPackageName("somePackage");
        EasyMock.expect(taskService.getBPMN2Task(EasyMock.eq(xml), EasyMock.eq("PROCESS_NAME"), EasyMock.eq("USER_TASK"))).andReturn(task).once();
        EasyMock.expect(formService.getAssociatedForm(EasyMock.eq("somePackage"), EasyMock.eq(task))).
            andThrow(new FormServiceException("problem")).once();
        EmbedingServlet servlet = createServlet(formService, taskService);
        response.sendError(EasyMock.eq(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), EasyMock.anyObject(String.class));
View Full Code Here

        String xml = "<some><bpmn2><content/></bpmn2></some>";
        BufferedReader reader = new BufferedReader(new StringReader(xml));
        EasyMock.expect(request.getReader()).andReturn(reader);
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        TaskDefinitionService taskService = EasyMock.createMock(TaskDefinitionService.class);
        TaskRef task = new TaskRef();
        task.setPackageName("somePackage");
        EasyMock.expect(taskService.getBPMN2Task(EasyMock.eq(xml), EasyMock.eq("PROCESS_NAME"), EasyMock.eq("USER_TASK"))).andReturn(task).once();
        FormRepresentation form = RESTAbstractTest.createMockForm("myForm", "myParam");
        EasyMock.expect(formService.getAssociatedForm(EasyMock.eq("somePackage"), EasyMock.eq(task))).andReturn(form).once();
        FormRepresentationEncoder encoder = EasyMock.createMock(FormRepresentationEncoder.class);
        EasyMock.expect(encoder.encode(EasyMock.eq(form))).andThrow(new FormEncodingException()).once();
View Full Code Here

        String xml = "<some><bpmn2><content/></bpmn2></some>";
        BufferedReader reader = new BufferedReader(new StringReader(xml));
        EasyMock.expect(request.getReader()).andReturn(reader);
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        TaskDefinitionService taskService = EasyMock.createMock(TaskDefinitionService.class);
        TaskRef task = new TaskRef();
        task.setPackageName("somePackage");
        EasyMock.expect(taskService.getBPMN2Task(EasyMock.eq(xml), EasyMock.eq("PROCESS_NAME"), EasyMock.eq("USER_TASK"))).
            andThrow(new NullPointerException()).once();
        EmbedingServlet servlet = createServlet(formService, taskService);
        response.sendError(EasyMock.eq(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), EasyMock.anyObject(String.class));
        EasyMock.expectLastCall().once();
View Full Code Here

    //test happy path for RESTIoService.getIoAssociations(...)
    public void testGetIoAssociationsOK() throws Exception {
        RESTIoService restService = new RESTIoService();
        TaskDefinitionService taskService = EasyMock.createMock(TaskDefinitionService.class);
        List<TaskRef> tasks = new ArrayList<TaskRef>();
        tasks.add(new TaskRef());
        tasks.add(new TaskRef());
        EasyMock.expect(taskService.query(EasyMock.eq("somePackage"), EasyMock.eq("someFilter"))).andReturn(tasks).once();
        restService.setTaskService(taskService);
        ServletContext context = EasyMock.createMock(ServletContext.class);
       
        EasyMock.replay(taskService, context);
View Full Code Here

TOP

Related Classes of org.jbpm.formbuilder.shared.task.TaskRef

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.