Package org.jbpm.formapi.shared.api

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


        responses.put("POST " + helper.getApiSearchUrl("somePackage") + "formItemDefinition_item1.json", "{}");
        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);
        FormItemRepresentation item = RESTAbstractTest.createMockForm("form1", "oneParam").getFormItems().iterator().next();
        FormRepresentationEncoder encoder = EasyMock.createMock(FormRepresentationEncoder.class);
        FormEncodingFactory.register(encoder, FormEncodingFactory.getDecoder());
        EasyMock.expect(encoder.encode(EasyMock.eq(item))).andThrow(new FormEncodingException("Something wrong")).once();
       
        EasyMock.replay(client, encoder);
View Full Code Here


        Map<String, String> responses = new HashMap<String, String>();
        EasyMock.expect(client.executeMethod(EasyMock.anyObject(MockGetMethod.class))).
            andAnswer(new MockAnswer(responses, new IOException("MOCK IO ERROR"))).anyTimes();
        GuvnorFormDefinitionService service = createService(baseUrl, "", "");
        service.getHelper().setClient(client);
        FormItemRepresentation item = RESTAbstractTest.createMockForm("form1", "oneParam").getFormItems().iterator().next();
       
        EasyMock.replay(client);
        try {
            service.saveFormItem("somePackage", "item1", item);
            fail("Shouldn't have succeeded");
View Full Code Here

            int column = index%this.columns;
            int row = index/this.columns;
            Widget widget = grid.getWidget(row, column);
            if (widget != null && widget instanceof FBFormItem) {
                FBFormItem item = (FBFormItem) widget;
                FormItemRepresentation subRep = item.getRepresentation();
                rep.setElement(row, column, subRep);
            }
        }
        return rep;
    }
View Full Code Here

        if (trep.getElements() != null) {
            for (int rowindex = 0; rowindex < trep.getElements().size(); rowindex++) {
                List<FormItemRepresentation> row = trep.getElements().get(rowindex);
                if(row != null) {
                    for (int cellindex = 0; cellindex < row.size(); cellindex++) {
                        FormItemRepresentation cell = row.get(cellindex);
                        FBFormItem subItem = super.createItem(cell);
                        this.grid.setWidget(rowindex, cellindex, subItem);
                        super.add(subItem);
                    }
                }
View Full Code Here

       
        //for each object, check field coverage
        for (Class<?> clazz : instances.keySet()) {
            Field[] fields = clazz.getFields();
            List<String> uncoveredFields = new ArrayList<String>();
            FormItemRepresentation item = instances.get(clazz);
            Map<String, Object> data = item.getDataMap();
            for (Field field : fields) {
                String fieldName = field.getName();
                if (!data.containsKey(fieldName)) {
                    uncoveredFields.add(fieldName);
                }
View Full Code Here

        assertNull("result should be null", encoder.fromMap(new HashMap<String, Object>()));
       
        assertNotNull("formattedDate shouldn't be null", encoder.formatDate(new Date()));
       
        FormRepresentation form = RESTAbstractTest.createMockForm("myForm", "myParam1", "myParam2");
        FormItemRepresentation item = form.getFormItems().iterator().next();
        Map<String, Object> data = item.getDataMap();
        Object obj = encoder.fromMap(data);
        assertNotNull("obj shouldn't be null", obj);
        assertTrue("obj should be of type FormItemRepresentation", obj instanceof FormItemRepresentation);
        FormItemRepresentation retval = (FormItemRepresentation) obj;
        assertEquals("retval and item should be equal", retval, item);
    }
View Full Code Here

TOP

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

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.