Package org.jbpm.formbuilder.shared.form

Examples of org.jbpm.formbuilder.shared.form.FormServiceException


                        "<content src=\"" + url + "/" + templateUrlName + "/binary\"/>" +
                    "</entry>";
                method.setRequestEntity(new StringRequestEntity(entry, "application/atom+xml", "UTF-8"));
                client.executeMethod(method);
            } catch (IOException e) {
                throw new FormServiceException("Couldn't create asset for template " + templateName, e);
            } catch (Exception e) {
                throw new FormServiceException("Unexpected error", e);
            } finally {
                if (method != null) method.releaseConnection();
            }
        }
    }
View Full Code Here


                        return false;
                    }
                    return true;
                }
            } catch (IOException e) {
                throw new FormServiceException("Problem reading existing template", e);
            } catch (Exception e) {
                throw new FormServiceException("Unexpected error", e);
            } finally {
                method.releaseConnection();
            }
        } catch (UnsupportedEncodingException e) {
            throw new FormServiceException("Problem encoding template name " + templateName, e);
        }
    }
View Full Code Here

        EasyMock.expect(request.getParameter(EasyMock.eq("pwd"))).andReturn(null).once();
        EasyMock.expect(request.getParameter(EasyMock.eq("uuid"))).andReturn(uuid).once();
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        TaskDefinitionService taskService = EasyMock.createMock(TaskDefinitionService.class);
        EasyMock.expect(taskService.getContainingPackage(EasyMock.eq(uuid))).andReturn("somePackage").once();
        EasyMock.expect(formService.getFormByUUID(EasyMock.eq("somePackage"), EasyMock.eq(uuid))).andThrow(new FormServiceException()).once();
        response.sendError(EasyMock.eq(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), EasyMock.anyObject(String.class));
        EasyMock.expectLastCall().once();
        EmbedingServlet servlet = createServlet(formService, taskService);
       
        EasyMock.replay(request, response, formService, taskService);
View Full Code Here

        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));
        EasyMock.expectLastCall().once();
       
        EasyMock.replay(request, response, formService, taskService);
View Full Code Here

    public void testGetFormsServiceProblem() throws Exception {
        RESTFormService restService = new RESTFormService();
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        ServletContext context = EasyMock.createMock(ServletContext.class);
       
        FormServiceException exception = new FormServiceException("Something going wrong");
       
        EasyMock.expect(formService.getForms(EasyMock.same("somePackage"))).andThrow(exception).once();
        restService.setFormService(formService);
       
        EasyMock.replay(formService, context);
View Full Code Here

    public void testGetFormServiceProblem() throws Exception {
        RESTFormService restService = new RESTFormService();
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        ServletContext context = EasyMock.createMock(ServletContext.class);
       
        FormServiceException exception = new FormServiceException("Something going wrong");
       
        EasyMock.expect(formService.getForm(EasyMock.same("somePackage"), EasyMock.same("myFormId"))).andThrow(exception).once();
        restService.setFormService(formService);
       
        EasyMock.replay(formService, context);
View Full Code Here

    public void testSaveFormServiceProblem() throws Exception {
        FormEncodingFactory.register(FormEncodingServerFactory.getEncoder(), FormEncodingServerFactory.getDecoder());
        RESTFormService restService = new RESTFormService();
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        FormRepresentation form = RESTAbstractTest.createMockForm("formToBeSaved", "param1", "param2", "param3");
        FormServiceException exception = new FormServiceException("Something going wrong");
        EasyMock.expect(formService.saveForm(EasyMock.eq("somePackage"), EasyMock.eq(form))).andThrow(exception).once();
        restService.setFormService(formService);
        ServletContext context = EasyMock.createMock(ServletContext.class);
        HttpSession session = EasyMock.createMock(HttpSession.class);
        HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
View Full Code Here

    //test response to a FormServiceException for RESTFormService.deleteForm(...)
    public void testDeleteFormServiceProblem() throws Exception {
        RESTFormService restService = new RESTFormService();
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        formService.deleteForm(EasyMock.eq("somePackage"), EasyMock.eq("myFormId"));
        FormServiceException exception = new FormServiceException("Something going wrong");
        EasyMock.expectLastCall().andThrow(exception).once();
        restService.setFormService(formService);
        ServletContext context = EasyMock.createMock(ServletContext.class);
        HttpSession session = EasyMock.createMock(HttpSession.class);
        HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
View Full Code Here

   
    //test response to a FormServiceException for RESTFormService.getFormItems(...)
    public void testGetFormItemsServiceProblem() throws Exception {
        RESTFormService restService = new RESTFormService();
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        FormServiceException exception = new FormServiceException("Something going wrong");
        EasyMock.expect(formService.getFormItems(EasyMock.eq("somePackage"))).andThrow(exception).once();
        ServletContext context = EasyMock.createMock(ServletContext.class);
        restService.setFormService(formService);
       
        EasyMock.replay(formService, context);
View Full Code Here

    //test response to FormServiceException for RESTFormService.getFormItem(...)
    public void testGetFormItemServiceProblem() throws Exception {
        RESTFormService restService = new RESTFormService();
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        FormServiceException exception = new FormServiceException("Something going wrong");
        EasyMock.expect(formService.getFormItem(EasyMock.eq("somePackage"), EasyMock.eq("MY_FORM_ITEM_ID"))).andThrow(exception).once();
        restService.setFormService(formService);
        ServletContext context = EasyMock.createMock(ServletContext.class);
       
        EasyMock.replay(formService, context);
View Full Code Here

TOP

Related Classes of org.jbpm.formbuilder.shared.form.FormServiceException

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.