Examples of MenuService


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

    }
   
    //test response for not finding the specified item at RESTMenuService.deleteMenuItem(...)
    public void testDeleteMenuItemNotFound() throws Exception {
        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);
        Map<String, List<MenuItemDescription>> initialMenuItems = new HashMap<String, List<MenuItemDescription>>();
        List<MenuItemDescription> descriptions = new ArrayList<MenuItemDescription>();
        MenuItemDescription description = new MenuItemDescription();
        description.setName("anotherItem");
        descriptions.add(description);
        initialMenuItems.put("groupName", descriptions);
        EasyMock.expect(menuService.listMenuItems()).andReturn(initialMenuItems).once();
        restService.setMenuService(menuService);
        SaveMenuItemDTO dto = new SaveMenuItemDTO();
        List<String> allowedEvents = new ArrayList<String>();
        allowedEvents.add("onclick");
        allowedEvents.add("onfocus");
View Full Code Here

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

   
    //test response to a MenuServiceException at RESTMenuService.deleteMenuItem(...)
    public void testDeleteMenuItemServiceProblem() throws Exception {
        MenuServiceException exception = new MenuServiceException("Something going wrong deleting an item");
        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.deleteMenuItem(EasyMock.same("groupName"), EasyMock.anyObject(MenuItemDescription.class));
        EasyMock.expectLastCall().andThrow(exception).once();
        Map<String, List<MenuItemDescription>> initialMenuItems = new HashMap<String, List<MenuItemDescription>>();
        List<MenuItemDescription> descriptions = new ArrayList<MenuItemDescription>();
        MenuItemDescription description = new MenuItemDescription();
        description.setName("myItem");
        descriptions.add(description);
        initialMenuItems.put("groupName", descriptions);
        EasyMock.expect(menuService.listMenuItems()).andReturn(initialMenuItems).once();
        restService.setMenuService(menuService);
        SaveMenuItemDTO dto = new SaveMenuItemDTO();
        List<String> allowedEvents = new ArrayList<String>();
        allowedEvents.add("onclick");
        allowedEvents.add("onfocus");
View Full Code Here

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

    }
   
    //test happy path for RESTMenuService.getRepresentationMappings()
    public void testGetRepresentationMappingsOK() throws Exception {
        RESTMenuService restService = new RESTMenuService();
        MenuService menuService = EasyMock.createMock(MenuService.class);
        restService.setMenuService(menuService);
        Map<String, String> retval = new HashMap<String, String>();
        retval.put("aaa", "bbb");
        retval.put("ccc", "ddd");
        EasyMock.expect(menuService.getFormBuilderProperties()).andReturn(retval).once();
       
        EasyMock.replay(menuService);
        Response resp = restService.getRepresentationMappings();
        EasyMock.verify(menuService);
       
View Full Code Here

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

    }
   
    //test response to a MenuServiceException for RESTMenuService.getRepresentationMappings()
    public void testGetRepresentationMappingsServiceProblem() throws Exception {
        RESTMenuService restService = new RESTMenuService();
        MenuService menuService = EasyMock.createMock(MenuService.class);
        restService.setMenuService(menuService);
        MenuServiceException exception = new MenuServiceException("Something going wrong");
        EasyMock.expect(menuService.getFormBuilderProperties()).andThrow(exception).once();
       
        EasyMock.replay(menuService);
        Response resp = restService.getRepresentationMappings();
        EasyMock.verify(menuService);
       
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.