Package jeeves.server.context

Examples of jeeves.server.context.ServiceContext


    public void testExecAddNewUserCompatibilityModeAsAdmin() throws Exception {
        Element request = Xml.loadString(String.format(COMPAT_UPDATE_PARAMS, Params.Operation.NEWUSER), false);

        final Update update = new Update();

        ServiceContext context = createServiceContext();
        loginAsAdmin(context);
        update.serviceSpecificExec(request, context);

        assertEquals(2, _userRepo.count());
        List<User> users = _userRepo.findAllByProfile(Profile.UserAdmin);
View Full Code Here


        Element request = Xml.loadString(String.format(COMPAT_UPDATE_PARAMS, Params.Operation.FULLUPDATE), false);
        request.getChild("id").setText(""+startUser.getId());

        final Update update = new Update();

        ServiceContext context = createServiceContext();
        loginAsAdmin(context);
        update.serviceSpecificExec(request, context);

        assertEquals(2, _userRepo.count());
        User user = _userRepo.findOne(startUser.getId());
View Full Code Here

        assertEquals(2, _userRepo.count());

        final Update update = new Update();

        ServiceContext context = createServiceContext();
        loginAsAdmin(context);

        Element request = new Element("request")
                .addContent(new Element(Params.ID).setText("" + startUser.getId()))
                .addContent(new Element(Params.PASSWORD).setText("password"))
View Full Code Here

        assertEquals(2, _userRepo.count());

        final Update update = new Update();

        ServiceContext context = createServiceContext();
        final UserSession userSession = new UserSession();
        userSession.loginAs(startUser);
        context.setUserSession(userSession);

        Element request = new Element("request")
                .addContent(new Element(Params.ID).setText(""+startUser.getId()))
                .addContent(new Element(Params.PASSWORD).setText("password"))
                .addContent(new Element(Params.OPERATION).setText(Params.Operation.RESETPW));
View Full Code Here

        assertEquals(2, _userRepo.count());

        final Update update = new Update();

        ServiceContext context = createServiceContext();
        final UserSession userSession = new UserSession();
        userSession.loginAs(startUser);
        context.setUserSession(userSession);

        Element request = new Element("request")
                .addContent(new Element(Params.ID).setText(""+startUser.getId()))
                .addContent(new Element(Params.NAME).setText("firstname"))
                .addContent(new Element(Params.OPERATION).setText(Params.Operation.EDITINFO));
View Full Code Here

        ));


        final Update update = new Update();

        ServiceContext context = createServiceContext();
        final UserSession userSession = new UserSession();
        userSession.loginAs(updatingUser);
        context.setUserSession(userSession);

        Element request = new Element("request")
                .addContent(new Element(Params.ID).setText(""+toUpdateUser.getId()))
                .addContent(new Element(Params.PROFILE).setText(Profile.Administrator.name()))
                .addContent(new Element(Params.OPERATION).setText(Params.Operation.EDITINFO));
View Full Code Here

        assertEquals(2, _userRepo.count());

        final Update update = new Update();

        ServiceContext context = createServiceContext();
        final UserSession userSession = new UserSession();
        userSession.loginAs(startUser);
        context.setUserSession(userSession);

        Element request = new Element("request")
                .addContent(new Element(Params.NAME).setText("newname"))
                .addContent(new Element(Params.ID).setText(""+startUser.getId()))
                .addContent(new Element(Params.PROFILE).setText(profile.name()))
View Full Code Here

        updatingUser.setUsername("updater");
        updatingUser = _userRepo.save(updatingUser);

        final Update update = new Update();

        ServiceContext context = createServiceContext();
        final UserSession userSession = new UserSession();
        userSession.loginAs(updatingUser);
        context.setUserSession(userSession);

        Element request = new Element("request")
                .addContent(new Element(Params.PASSWORD).setText("password"))
                .addContent(new Element(Params.ID).setText("" + toUpdateUser.getId()))
                .addContent(new Element(Params.OPERATION).setText(Params.Operation.RESETPW));
View Full Code Here

                new UserGroup().setProfile(Profile.UserAdmin).setUser(updatingUser).setGroup(two)
            ));

        final Update update = new Update();

        ServiceContext context = createServiceContext();
        final UserSession userSession = new UserSession();
        userSession.loginAs(updatingUser);
        context.setUserSession(userSession);

        Element request = new Element("request")
                .addContent(new Element(Params.PASSWORD).setText("password"))
                .addContent(new Element(Params.ID).setText("" + toUpdateUser.getId()))
                .addContent(new Element(Params.OPERATION).setText(Params.Operation.RESETPW));
View Full Code Here

                new UserGroup().setProfile(Profile.UserAdmin).setUser(updatingUser).setGroup(one)
            ));

        final Update update = new Update();

        ServiceContext context = createServiceContext();
        final UserSession userSession = new UserSession();
        userSession.loginAs(updatingUser);
        context.setUserSession(userSession);

        Element request = new Element("request")
                .addContent(new Element(Params.PASSWORD).setText("password"))
                .addContent(new Element(Params.ID).setText("" + toUpdateUser.getId()))
                .addContent(new Element(Params.OPERATION).setText(Params.Operation.RESETPW));
View Full Code Here

TOP

Related Classes of jeeves.server.context.ServiceContext

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.