Examples of MenuServiceException


Examples of org.jbpm.formbuilder.shared.menu.MenuServiceException

        try {
            FormItemRepresentation item = decoder.decodeItem(json);
            menuItem.setItemRepresentation(item);
        } catch (FormEncodingException e) {
            if (strict) {
                throw new MenuServiceException("Couldn't load formRepresentation from dto", e);
            }
            menuItem.setItemRepresentation(null);
        }
        menuItem.setClassName(CustomMenuItem.class.getName());
        menuItem.setName(dto.getName());
View Full Code Here

Examples of org.jbpm.formbuilder.shared.menu.MenuServiceException

        List<MenuOptionDescription> retval = null;
        try {
            URL url = asURL("/menuOptions.json");
            retval = gson.fromJson(createReader(url), new TypeToken<List<MenuOptionDescription>>(){}.getType());
        } catch (URISyntaxException e) {
            throw new MenuServiceException("Problem finding menu options json file", e);
        } catch (FileNotFoundException e) {
            throw new MenuServiceException("No menu options json file found", e);
        } catch (Exception e) {
            throw new MenuServiceException("Unexpected error", e);
        }
        return retval;
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.menu.MenuServiceException

            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) {
            throw new MenuServiceException("No menu items json file found", e);
        } catch (IOException e) {
            throw new MenuServiceException("Problem reading menu items json file", e);
        } catch (Exception e) {
            throw new MenuServiceException("Unexpected error", e);
        }
        return retval;
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.menu.MenuServiceException

        List<ValidationDescription> retval = null;
        try {
            URL url = asURL("/validations.json");
            retval = gson.fromJson(createReader(url), new TypeToken<List<ValidationDescription>>(){}.getType());
        } catch (URISyntaxException e) {
            throw new MenuServiceException("Problem finding validations json file", e);
        } catch (FileNotFoundException e) {
            throw new MenuServiceException("No validations json file found", e);
        } catch (Exception e) {
            throw new MenuServiceException("Unexpected error", e);
        }
        return retval;
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.menu.MenuServiceException

        InputStream input = getClass().getResourceAsStream("/FormBuilder.properties");
        Properties props = new Properties();
        try {
            props.load(input);
        } catch (IOException e) {
            throw new MenuServiceException("Couldn't read FormBuilder.properties", e);
        }
        Map<String, String> retval = new HashMap<String, String>();
        for (Map.Entry<Object, Object> entry : props.entrySet()) {
            retval.put(entry.getKey().toString(), entry.getValue().toString());
        }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.menu.MenuServiceException

            FormRepresentationEncoder encoder = FormEncodingFactory.getEncoder();
            String json = encoder.encodeMenuItemsMap(items);
            URL url = asURL("/menuItems.json");
            writeToURL(url, json);
        } catch (FormEncodingException e) {
            throw new MenuServiceException("Problem transforming menu items to json", e);
        } catch (URISyntaxException e) {
            throw new MenuServiceException("Problem finding menu items json file", e);
        } catch (FileNotFoundException e) {
            throw new MenuServiceException("No menu items json file found", e);
        } catch (IOException e) {
            throw new MenuServiceException("Problem writing menu items json file", e);
        } catch (Exception e) {
            throw new MenuServiceException("Unexpected error", e);
        }
    }
View Full Code Here

Examples of org.jbpm.formbuilder.shared.menu.MenuServiceException

   
    //test response to a MenuServiceException on RESTMenuService.listMenuItems()
    public void testListMenuItemsServiceProblem() throws Exception {
        RESTMenuService restService = new RESTMenuService();
        MenuService menuService = EasyMock.createMock(MenuService.class);
        MenuServiceException exception = new MenuServiceException("Something going wrong");
        EasyMock.expect(menuService.listMenuItems()).andThrow(exception).once();
        restService.setMenuService(menuService);
       
        EasyMock.replay(menuService);
        Response resp = restService.listMenuItems();
View Full Code Here

Examples of org.jbpm.formbuilder.shared.menu.MenuServiceException

   
    //test response to a MenuServiceException on RESTMenuService.listMenuOptions()
    public void testListMenuOptionsServiceProblem() throws Exception {
        RESTMenuService restService = new RESTMenuService();
        MenuService menuService = EasyMock.createMock(MenuService.class);
        MenuServiceException exception = new MenuServiceException("Something going wrong");
        EasyMock.expect(menuService.listOptions()).andThrow(exception).once();
        restService.setMenuService(menuService);
       
        EasyMock.replay(menuService);
        Response resp = restService.listMenuOptions();
View Full Code Here

Examples of org.jbpm.formbuilder.shared.menu.MenuServiceException

    }
   
    public void testGetValidationsServiceProblem() throws Exception {
        RESTMenuService restService = new RESTMenuService();
        MenuService menuService = EasyMock.createMock(MenuService.class);
        MenuServiceException exception = new MenuServiceException("Something going wrong");
        EasyMock.expect(menuService.listValidations()).andThrow(exception).once();
        restService.setMenuService(menuService);
       
        EasyMock.replay(menuService);
        Response resp = restService.getValidations();
View Full Code Here

Examples of org.jbpm.formbuilder.shared.menu.MenuServiceException

        RESTMenuService restService = new RESTMenuService();
        MenuService menuService = EasyMock.createMock(MenuService.class);
        HttpServletRequest mockRequest = EasyMock.createMock(HttpServletRequest.class);
        EasyMock.expect(mockRequest.isUserInRole(EasyMock.anyObject(String.class))).andReturn(true).times(3);
        menuService.saveMenuItem(EasyMock.same("groupName"), EasyMock.anyObject(MenuItemDescription.class));
        MenuServiceException exception = new MenuServiceException("Something went wrong");
        EasyMock.expectLastCall().andThrow(exception).once();
        restService.setMenuService(menuService);
        SaveMenuItemDTO dto = new SaveMenuItemDTO();
        List<String> allowedEvents = new ArrayList<String>();
        allowedEvents.add("onclick");
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.