Package org.jbpm.formapi.shared.form

Examples of org.jbpm.formapi.shared.form.FormEncodingException


        EasyMock.expect(client.executeMethod(EasyMock.anyObject(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).anyTimes();
        GuvnorFormDefinitionService service = createService(baseUrl, "", "");
        service.getHelper().setClient(client);
        FormRepresentationDecoder decoder = EasyMock.createMock(FormRepresentationDecoder.class);
        EasyMock.expect(decoder.decode(EasyMock.eq(jsonForm))).andThrow(new FormEncodingException("Something going wrong")).once();
        FormEncodingFactory.register(FormEncodingServerFactory.getEncoder(), decoder);
       
        EasyMock.replay(client, decoder);
        try {
            service.getForm("somePackage", "form2AutoForm");
View Full Code Here


        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses1, new IllegalArgumentException("unexpected call"))).times(3);
        EasyMock.expect(client);
        service.getHelper().setClient(client);
        FormRepresentationDecoder decoder = EasyMock.createMock(FormRepresentationDecoder.class);
        FormEncodingException exception = new FormEncodingException("Something going wrong");
        EasyMock.expect(decoder.decode(EasyMock.isA(String.class))).andThrow(exception).once();
        FormEncodingFactory.register(FormEncodingFactory.getEncoder(), decoder);
       
        EasyMock.replay(client, decoder);
        try {
View Full Code Here

        String jsonForm = FormEncodingServerFactory.getEncoder().encode(form);
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "myForm.formdef", jsonForm);
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).once();
        FormRepresentationDecoder decoder = EasyMock.createMock(FormRepresentationDecoder.class);
        FormEncodingException exception = new FormEncodingException("Something going wrong");
        EasyMock.expect(decoder.decode(EasyMock.isA(String.class))).andThrow(exception).once();
        FormEncodingFactory.register(FormEncodingFactory.getEncoder(), decoder);
       
        EasyMock.replay(client, decoder);
        try {
View Full Code Here

    public void testGetFormsEncodingProblem() throws Exception {
        RESTFormService restService = new RESTFormService();
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        ServletContext context = EasyMock.createMock(ServletContext.class);
       
        FormEncodingException exception = new FormEncodingException("Something going wrong");
       
        FormRepresentationEncoder encoder = EasyMock.createMock(FormRepresentationEncoder.class);
        EasyMock.expect(encoder.encode(EasyMock.anyObject(FormRepresentation.class))).andThrow(exception).once();
       
        FormEncodingFactory.register(encoder, FormEncodingServerFactory.getDecoder());
View Full Code Here

    public void testGetFormEncodingProblem() throws Exception {
        RESTFormService restService = new RESTFormService();
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        ServletContext context = EasyMock.createMock(ServletContext.class);
       
        FormEncodingException exception = new FormEncodingException("Something going wrong");
       
        FormRepresentationEncoder encoder = EasyMock.createMock(FormRepresentationEncoder.class);
        EasyMock.expect(encoder.encode(EasyMock.anyObject(FormRepresentation.class))).andThrow(exception).once();
       
        FormEncodingFactory.register(encoder, FormEncodingServerFactory.getDecoder());
View Full Code Here

        RESTFormService restService = new RESTFormService();
        FormRepresentationDecoder decoder = EasyMock.createMock(FormRepresentationDecoder.class);
        FormEncodingFactory.register(FormEncodingServerFactory.getEncoder(), decoder);
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        FormRepresentation form = RESTAbstractTest.createMockForm("formToBeSaved", "param1", "param2", "param3");
        FormEncodingException exception = new FormEncodingException("Something going wrong");
        EasyMock.expect(decoder.decode(EasyMock.anyObject(String.class))).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 FormEncodingException for RESTFormService.getFormItems(...)
    public void testGetFormItemsEncodingProblem() throws Exception {
        RESTFormService restService = new RESTFormService();
        FormRepresentationEncoder encoder = EasyMock.createMock(FormRepresentationEncoder.class);
        FormEncodingException exception = new FormEncodingException("Something going wrong");
        EasyMock.expect(encoder.encode(EasyMock.notNull(FormItemRepresentation.class))).andThrow(exception).anyTimes();
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        Map<String, FormItemRepresentation> map = mockGetFormItems();
        EasyMock.expect(formService.getFormItems(EasyMock.eq("somePackage"))).andReturn(map).once();
        ServletContext context = EasyMock.createMock(ServletContext.class);
View Full Code Here

   
    //test response to FormServiceException for RESTFormService.getFormItem(...)
    public void testGetFormItemEncodingProblem() throws Exception {
        RESTFormService restService = new RESTFormService();
        FormRepresentationEncoder encoder = EasyMock.createMock(FormRepresentationEncoder.class);
        FormEncodingException exception = new FormEncodingException("Something going wrong");
        EasyMock.expect(encoder.encode(EasyMock.notNull(FormItemRepresentation.class))).andThrow(exception).anyTimes();
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        FormItemRepresentation item = createMockForm("myForm", "param1").getFormItems().iterator().next();
        EasyMock.expect(formService.getFormItem(EasyMock.eq("somePackage"), EasyMock.eq("MY_ITEM_ID"))).andReturn(item).once();
        ServletContext context = EasyMock.createMock(ServletContext.class);
View Full Code Here

        RESTFormService restService = new RESTFormService();
        FormRepresentationDecoder decoder = EasyMock.createMock(FormRepresentationDecoder.class);
        FormEncodingFactory.register(FormEncodingServerFactory.getEncoder(), decoder);
        FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
        FormItemRepresentation item = RESTAbstractTest.createMockForm("formToBeSaved", "param1").getFormItems().iterator().next();
        FormEncodingException exception = new FormEncodingException("Something going wrong");
        EasyMock.expect(decoder.decodeItem(EasyMock.anyObject(String.class))).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

        FormPreviewDTO dto = new FormPreviewDTO();
        FormRepresentation form = createMockForm("myForm", "key1", "key2");
        String jsonBody = FormEncodingFactory.getEncoder().encode(form);
        dto.setRepresentation(jsonBody);
       
        FormEncodingException exception = new FormEncodingException("Something going wrong");
        EasyMock.expect(decoder.decode(EasyMock.eq(jsonBody))).andThrow(exception).once();
       
        EasyMock.replay(context, request);
        Response resp = restService.getFormPreview(dto, "lang", context, request);
        EasyMock.verify(context, request);
View Full Code Here

TOP

Related Classes of org.jbpm.formapi.shared.form.FormEncodingException

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.