Package org.jbpm.formapi.server.form

Examples of org.jbpm.formapi.server.form.FormRepresentationEncoderImpl


            fail(builder.toString());
        }
    }
   
    public void testRepresentationEncoderImpl() throws Exception {
        FormRepresentationEncoderImpl encoder = new FormRepresentationEncoderImpl();
        FormRepresentationDecoderImpl decoder = new FormRepresentationDecoderImpl();
        FormEncodingFactory.register(encoder, decoder);
       
        assertNull("result should be null", encoder.fromMap(null));
        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.server.form.FormRepresentationEncoderImpl

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.