Examples of decodeMenuItemsMap()


Examples of org.jbpm.formapi.shared.form.FormRepresentationDecoder.decodeMenuItemsMap()

    public void testListItemsEncodingProblem() throws Exception {
        GuvnorMenuService service = createMockedService(null);
        FormRepresentationDecoder decoder = EasyMock.createMock(FormRepresentationDecoder.class);
        FormEncodingFactory.register(FormEncodingFactory.getEncoder(), decoder);
        FormEncodingException exception = new FormEncodingException("Something going wrong");
        EasyMock.expect(decoder.decodeMenuItemsMap(EasyMock.anyObject(String.class))).andThrow(exception).once();
       
        EasyMock.replay(decoder);
        try {
            service.listMenuItems();
            fail("listOptions shouldn't succeed");
View Full Code Here

Examples of org.jbpm.formapi.shared.form.FormRepresentationDecoder.decodeMenuItemsMap()

    public void testSaveMenuItemOK() throws Exception {
        GuvnorMenuService service = new GuvnorMenuService();
        FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
        File dbFile = new File(getClass().getResource("/menuItems.json").getFile());
        String jsonInitial = FileUtils.readFileToString(dbFile);
        Map<String, List<MenuItemDescription>> descsInitial = decoder.decodeMenuItemsMap(jsonInitial);
        MenuItemDescription desc = new MenuItemDescription();
        desc.setClassName(CustomMenuItem.class.getName());
        List<FormEffectDescription> effects = new ArrayList<FormEffectDescription>();
        FormEffectDescription effDesc1 = new FormEffectDescription();
        effDesc1.setClassName(RemoveEffect.class.getName());
View Full Code Here

Examples of org.jbpm.formapi.shared.form.FormRepresentationDecoder.decodeMenuItemsMap()

        String groupName = "Test Components";
        service.saveMenuItem(groupName, desc);
       
        String jsonResult = FileUtils.readFileToString(dbFile);
       
        Map<String, List<MenuItemDescription>> descsResult = decoder.decodeMenuItemsMap(jsonResult);
        assertNotNull("saved menu items shouldn't be null", descsResult);
        assertNotNull("saved menu items should contain a list of " + groupName, descsResult.get(groupName));
        assertFalse(groupName + " list should not be empty", descsResult.get(groupName).isEmpty());
        assertFalse("descsInitial and descsResult should not be the same", descsInitial.equals(descsResult));
       
View Full Code Here

Examples of org.jbpm.formapi.shared.form.FormRepresentationDecoder.decodeMenuItemsMap()

        assertFalse("descsInitial and descsResult should not be the same", descsInitial.equals(descsResult));
       
        service.deleteMenuItem(groupName, desc);
       
        String jsonFinal = FileUtils.readFileToString(dbFile);
        Map<String, List<MenuItemDescription>> descsFinal = decoder.decodeMenuItemsMap(jsonFinal);
       
        assertEquals("descsInitial and descsFinal should be the same", descsInitial.entrySet(), descsFinal.entrySet());
    }
   
    public void testGetFormBuilderProperties() throws Exception {
View Full Code Here

Examples of org.jbpm.formapi.shared.form.FormRepresentationDecoder.decodeMenuItemsMap()

        Map<String, List<MenuItemDescription>> retval = null;
        try {
            FormRepresentationDecoder decoder = FormEncodingFactory.getDecoder();
            URL url = asURL("/menuItems.json");
            String json = readURL(url);
            retval = decoder.decodeMenuItemsMap(json);
        } catch (FormEncodingException e) {
            throw new MenuServiceException("Problem parsing menu items json file", e);
        } catch (URISyntaxException e) {
            throw new MenuServiceException("Problem finding menu items json file", e);
        } catch (FileNotFoundException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.