Package org.jbpm.formbuilder.server.mock

Examples of org.jbpm.formbuilder.server.mock.MockAnswer


        String process1Content = IOUtils.toString(getClass().getResourceAsStream("GuvnorGetProcessTasksTest.bpmn2"));
        String process2Content = IOUtils.toString(getClass().getResourceAsStream("GuvnorGetProcessTasksTest2.bpmn2"));
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "sampleProcess1.bpmn2", process1Content);
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "sampleProcess2.bpmn2", process2Content);
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).times(3);
        service.getHelper().setClient(client);
       
        EasyMock.replay(client);
        List<TaskRef> tasks = service.query("somePackage", "");
        EasyMock.verify(client);
View Full Code Here


        responses.put("GET " + helper.getApiSearchUrl("somePackage"), props.toString());
        String process2Content = IOUtils.toString(getClass().getResourceAsStream("GuvnorGetProcessTasksTest2.bpmn2"));
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "sampleProcess1.bpmn2", "");
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "sampleProcess2.bpmn2", process2Content);
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).times(3);
        service.getHelper().setClient(client);
       
        EasyMock.replay(client);
        List<TaskRef> tasks = service.query("somePackage", "");
        EasyMock.verify(client);
View Full Code Here

        String process1Content = IOUtils.toString(getClass().getResourceAsStream("GuvnorGetProcessTasksTest.bpmn2"));
        String process2Content = IOUtils.toString(getClass().getResourceAsStream("GuvnorGetProcessTasksTest2.bpmn2"));
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "sampleProcess1.bpmn2", process1Content);
        responses.put("GET " + helper.getApiSearchUrl("somePackage") + "sampleProcess2.bpmn2", process2Content);
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).times(3);
        service.getHelper().setClient(client);
       
        EasyMock.replay(client);
        String filter = "Review";
        List<TaskRef> tasks = service.query("somePackage", filter);
View Full Code Here

        responses.put("GET " + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess1", xml2);
        responses.put("GET " + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess2", xml3);
        responses.put("GET " + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess1/source", process1Content);
        responses.put("GET " + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess2/source", process2Content);
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).times(5);
        service.getHelper().setClient(client);
        String taskId = "Review";
        String processId = "com.sample.humantask";
       
        EasyMock.replay(client);
View Full Code Here

        Map<String, String> responses = new HashMap<String, String>();
        String xml1 = "<collection><package><title>somePackage</title>" +
                "<assets>" + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess1</assetsBROKEN_XML>";
        responses.put("GET " + helper.getRestBaseUrl(), xml1);
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).once();
        service.getHelper().setClient(client);
        String taskId = "Review";
        String processId = "com.sample.humantask";
       
        EasyMock.replay(client);
View Full Code Here

                "</sourceLink><metadata><format>bpmn2</format><uuid>" + uuid2 + "</uuid></metadata></asset>";
        responses.put("GET " + helper.getRestBaseUrl(), xml1);
        responses.put("GET " + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess1", xml2);
        responses.put("GET " + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess2", xml3);
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).times(3);
        service.getHelper().setClient(client);
       
        EasyMock.replay(client);
        String packageName = service.getContainingPackage(uuid2);
        EasyMock.verify(client);
View Full Code Here

        Map<String, String> responses = new HashMap<String, String>();
        String xml1 = "<collection><package><title>somePackage</title>" +
                "<assets>" + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess1</assetsBROKEN_XML>";
        responses.put("GET " + helper.getRestBaseUrl(), xml1);
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).once();
        service.getHelper().setClient(client);
       
        EasyMock.replay(client);
        try {
            service.getContainingPackage(uuid1);
View Full Code Here

        responses.put("GET " + helper.getRestBaseUrl(), xml1);
        responses.put("GET " + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess1", xml2);
        responses.put("GET " + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess2", xml3);
        responses.put("GET " + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess2/source", process2Content);
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).times(4);
        service.getHelper().setClient(client);
        String taskId = "Review";
       
        EasyMock.replay(client);
        TaskRef task = service.getTaskByUUID("somePackage", taskId, uuid1);
View Full Code Here

        String xml1 = "<collection><package><title>somePackage</title>" +
                "<assets>" + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess1</assets>" +
                "<assets>" + helper.getRestBaseUrl() + "somePackage/assets/sampleProcess2</assetsBROKEN_XML>";
        responses.put("GET " + helper.getRestBaseUrl(), xml1);
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IllegalArgumentException("unexpected call"))).once();
        service.getHelper().setClient(client);
       
        EasyMock.replay(client);
        try {
            service.getTaskByUUID("somePackage", "Review", uuid1);
View Full Code Here

        GuvnorFileService service = createService("http://www.redhat.com", "user", "pass");
        HttpClient client = EasyMock.createMock(HttpClient.class);
        Map<String, Integer> statuses = new HashMap<String, Integer>();
        statuses.put("GET http://www.redhat.com/rest/packages/somePackage/assets/fileName-upfile", 404);
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
            andAnswer(new MockAnswer(statuses)).once();
        EasyMock.expect(client.executeMethod(EasyMock.isA(MockPostMethod.class))).andReturn(201).once();
        service.getHelper().setClient(client);
       
        EasyMock.replay(client);
        String url = service.storeFile("somePackage", "fileName.txt", new byte[] { 1,2,3,4,5,6,7,8,9 } );
View Full Code Here

TOP

Related Classes of org.jbpm.formbuilder.server.mock.MockAnswer

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.