Package org.jbpm.formapi.shared.api

Examples of org.jbpm.formapi.shared.api.FormRepresentation


        responses.put("POST " + helper.getApiSearchUrl("somePackage") + "form1AutoForm.formdef", "PROBLEM");
        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);
        FormRepresentation form = RESTAbstractTest.createMockForm("form1", "oneParam");
       
        EasyMock.replay(client);
        try {
            service.saveForm("somePackage", form);
        } catch (FormServiceException e) {
View Full Code Here


    }
   
    //test happy path for update for GuvnorFormDefinitionService.saveForm(...)
    public void testSaveFormUpdateOK() throws Exception {
        HttpClient client = EasyMock.createMock(HttpClient.class);
        FormRepresentation form = RESTAbstractTest.createMockForm("form2", "oneParam");
        String jsonForm = FormEncodingFactory.getEncoder().encode(form);
        Map<String, String> responses1 = new HashMap<String, String>();
        responses1.put("GET " + helper.getApiSearchUrl("somePackage") + "form2AutoForm.formdef", jsonForm);
        Map<String, String> responses2 = new HashMap<String, String>();
        responses2.put("PUT " + helper.getApiSearchUrl("somePackage") + "form2AutoForm.formdef", "OK");
View Full Code Here

   
    //test response to a FormEncodingException for GuvnorFormDefinitionService.saveForm(...)
    public void testSaveFormDecodingProblem() throws Exception {
        HttpClient client = EasyMock.createMock(HttpClient.class);
        Map<String, String> responses = new HashMap<String, String>();
        FormRepresentation form = RESTAbstractTest.createMockForm("form2", "oneParam");
        String jsonForm = FormEncodingFactory.getEncoder().encode(form);
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "form2AutoForm.formdef", jsonForm);
        EasyMock.expect(client.executeMethod(EasyMock.anyObject(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).anyTimes();
        GuvnorFormDefinitionService service = createService(baseUrl, "", "");
View Full Code Here

   
  //test response to a FormEncodingException for GuvnorFormDefinitionService.saveForm(...)
    public void testSaveFormEncodingProblem() throws Exception {
        HttpClient client = EasyMock.createMock(HttpClient.class);
        Map<String, String> responses = new HashMap<String, String>();
        FormRepresentation form = RESTAbstractTest.createMockForm("form2", "oneParam");
        String jsonForm = FormEncodingFactory.getEncoder().encode(form);
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "form2AutoForm.formdef", jsonForm);
        EasyMock.expect(client.executeMethod(EasyMock.anyObject(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).anyTimes();
        GuvnorFormDefinitionService service = createService(baseUrl, "", "");
View Full Code Here

   
    //test response to a IOException for GuvnorFormDefinitionService.saveForm(...)
    public void testSaveFormIOProblem() throws Exception {
        HttpClient client = EasyMock.createMock(HttpClient.class);
        Map<String, String> responses = new HashMap<String, String>();
        FormRepresentation form = RESTAbstractTest.createMockForm("form2", "oneParam");
        String jsonForm = FormEncodingFactory.getEncoder().encode(form);
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "form2AutoForm.formdef", jsonForm);
        EasyMock.expect(client.executeMethod(EasyMock.anyObject(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IOException("MOCKING IO ERROR"))).anyTimes();
        GuvnorFormDefinitionService service = createService(baseUrl, "", "");
View Full Code Here

   
    //test response to a NullPointerException for GuvnorFormDefinitionService.saveForm(...)
    public void testSaveFormUnknownProblem() throws Exception {
        HttpClient client = EasyMock.createMock(HttpClient.class);
        Map<String, String> responses = new HashMap<String, String>();
        FormRepresentation form = RESTAbstractTest.createMockForm("form2", "oneParam");
        String jsonForm = FormEncodingFactory.getEncoder().encode(form);
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "form2AutoForm.formdef", jsonForm);
        EasyMock.expect(client.executeMethod(EasyMock.anyObject(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new NullPointerException("MOCKING IO ERROR"))).anyTimes();
        GuvnorFormDefinitionService service = createService(baseUrl, "", "");
View Full Code Here

   
    //test happy path for GuvnorFormDefinitionService.getForm(...)
    public void testGetFormOK() throws Exception {
        HttpClient client = EasyMock.createMock(HttpClient.class);
        Map<String, String> responses = new HashMap<String, String>();
        FormRepresentation form = RESTAbstractTest.createMockForm("form1", "oneParam");
        String jsonForm = FormEncodingFactory.getEncoder().encode(form);
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "form1AutoForm.formdef", jsonForm);
        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);
       
        EasyMock.replay(client);
        FormRepresentation form1 = service.getForm("somePackage", "form1AutoForm");
        EasyMock.verify(client);
       
        assertNotNull("form1 shouldn't be null", form1);
        assertEquals("form and form1 should be identical", form, form1);
    }
View Full Code Here

        assertEquals("form and form1 should be identical", form, form1);
    }
   
    public void testGetFormEmptyName() throws Exception {
        GuvnorFormDefinitionService service = createService(baseUrl, "", "");
        FormRepresentation form1 = service.getForm("somePackage", "");
        assertNull("form1 should be null", form1);
       
        FormRepresentation form2 = service.getForm("somePackage", null);
        assertNull("form2 should be null", form2);
    }
View Full Code Here

   
    //test response to a FormEncodingException for GuvnorFormDefinitionService.getForm(...)
    public void testGetFormEncodingProblem() throws Exception {
        HttpClient client = EasyMock.createMock(HttpClient.class);
        Map<String, String> responses = new HashMap<String, String>();
        FormRepresentation form = RESTAbstractTest.createMockForm("form2", "oneParam");
        String jsonForm = FormEncodingFactory.getEncoder().encode(form);
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "form2AutoForm.formdef", jsonForm);
        EasyMock.expect(client.executeMethod(EasyMock.anyObject(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).anyTimes();
        GuvnorFormDefinitionService service = createService(baseUrl, "", "");
View Full Code Here

        EasyMock.verify(client);
    }
   
    public void testGetFormByUUIDEmptyPackage() throws Exception {
        GuvnorFormDefinitionService service = createService(baseUrl, "", "");
        FormRepresentation form1 = service.getFormByUUID(null, null);
        assertNull("form1 should be null", form1);
        FormRepresentation form2 = service.getFormByUUID("", null);
        assertNull("form1 should be null", form2);
    }
View Full Code Here

TOP

Related Classes of org.jbpm.formapi.shared.api.FormRepresentation

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.