Examples of ModifyRoleForm


Examples of org.sete.web.form.admin.ModifyRoleForm

        req.setAttribute("selectedPrivMap", selPrivMap);
        EasyMock.expectLastCall().once();
        EasyMock.replay( req );
       
        //prepare the input form
        final ModifyRoleForm mrf = new ModifyRoleForm();
        mrf.setUserRole("student");
       
        //execute the code to be tested
        mra.modifyAssignedPrivileges( am, mrf, req, res);
       
        //and check the results
        assertTrue( "student".equals(mrf.getUserRole()) );
        final String[]assignedPrivKeys = mrf.getUserRolePrivileges();
        assertTrue( 0 == assignedPrivKeys.length );       
    }
View Full Code Here

Examples of org.sete.web.form.admin.ModifyRoleForm

        req.setAttribute("selectedPrivMap", selPrivMap);
        EasyMock.expectLastCall().once();
        EasyMock.replay( req );
       
        //prepare the input form
        final ModifyRoleForm mrf = new ModifyRoleForm();
        mrf.setUserRole("student");
       
        //execute the code to be tested
        mra.modifyAssignedPrivileges( am, mrf, req, res);
       
        //and check the results
        assertTrue( "student".equals(mrf.getUserRole()) );
       
        final String[]assignedPrivKeys = mrf.getUserRolePrivileges();
        assertTrue( 1 == assignedPrivKeys.length && "projIdea".equals(assignedPrivKeys[0]) );
       
        final String[]writeAllowedPrivKeys = mrf.getPrivilegesWithWriteAllowed();
        assertTrue( 1 == writeAllowedPrivKeys.length && "projIdea".equals(writeAllowedPrivKeys[0]) );
    }
View Full Code Here

Examples of org.sete.web.form.admin.ModifyRoleForm

        req.setAttribute("selectedPrivMap", selPrivMap);
        EasyMock.expectLastCall().once();
        EasyMock.replay( req );
       
        //prepare the input form
        final ModifyRoleForm mrf = new ModifyRoleForm();
        mrf.setUserRole("student");

        //execute the code to be tested    
        mra.modifyAssignedPrivileges( am, mrf, req, res);
       
        //and check the results
        assertTrue( "student".equals(mrf.getUserRole()) );
       
        final String[]assignedPrivKeys = mrf.getUserRolePrivileges();
        assertTrue( 2 == assignedPrivKeys.length &&
                    "projIdea".equals(assignedPrivKeys[0]) &&
                    "projDoc".equals(assignedPrivKeys[1]) );
       
        final String[]writeAllowedPrivKeys = mrf.getPrivilegesWithWriteAllowed();
        assertTrue( 2 == writeAllowedPrivKeys.length &&
                    "projIdea".equals(writeAllowedPrivKeys[0]) &&
                    null == writeAllowedPrivKeys[1] );
    }
View Full Code Here

Examples of org.sete.web.form.admin.ModifyRoleForm

        EasyMock.reset( req );
        EasyMock.expect( req.getSession() ).andReturn( ses ).anyTimes();
        EasyMock.replay( req );
       
        //prepare the input form: set as selected an invalid user role
        final ModifyRoleForm mrf = new ModifyRoleForm();
        mrf.setUserRole("xStudent");
       
        //execute the code to be tested and check the results
        try
        {
            mra.modifyAssignedPrivileges( am, mrf, req, res);
View Full Code Here

Examples of org.sete.web.form.admin.ModifyRoleForm

        req.setAttribute("selectedRole", "Student");
        EasyMock.expectLastCall().once();
        EasyMock.replay( req );
       
        //prepare the test!!!
        final ModifyRoleForm mrf = new ModifyRoleForm();
        mrf.setUserRole("student");
        mrf.setUserRoleLabel("Student");
           
        //record the UserRoleVo that is expected (no privileges assigned!)
        final UserRoleVo urVo = new UserRoleVo();
        {
            urVo.setUserRole("student");
View Full Code Here

Examples of org.sete.web.form.admin.ModifyRoleForm

        req.setAttribute("selectedRole", "Student");
        EasyMock.expectLastCall().once();
        EasyMock.replay( req );
       
        //prepare the test!!!
        final ModifyRoleForm mrf = new ModifyRoleForm();
        mrf.setUserRole("student");
        mrf.setUserRoleLabel("Student");
                //put in the form one privilege assignment with r/w action
        mrf.setUserRolePrivileges(new String[]{"projIdea"});
        mrf.setPrivilegesWithWriteAllowed(new String[]{"projIdea"});

        //record the UserRoleVo that is expected (one privilege with r/w assigned!)
        final UserRoleVo urVo = new UserRoleVo();
        {
            urVo.setUserRole("student");
View Full Code Here

Examples of org.sete.web.form.admin.ModifyRoleForm

        req.setAttribute("selectedRole", "Student");
        EasyMock.expectLastCall().once();
        EasyMock.replay( req );
       
        //prepare the test!!!
        final ModifyRoleForm mrf = new ModifyRoleForm();
        mrf.setUserRole("student");
        mrf.setUserRoleLabel("Student");
                //put in the form one privilege assignment with r/w action and another one with r/o action
        mrf.setUserRolePrivileges(new String[]{"projIdea", "projDoc"});
        mrf.setPrivilegesWithWriteAllowed(new String[]{"projIdea"});

        //record the UserRoleVo that is expected (one privilege with r/w assigned!)
        final UserRoleVo urVo = new UserRoleVo();
        {
            urVo.setUserRole("student");
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.