Examples of loginAs()


Examples of jeeves.server.UserSession.loginAs()

        thesaurusDir = _applicationContext.getBean(ThesaurusManager.class).getThesauriDirectory();

        if (context.getUserSession() == null) {
            UserSession session = new UserSession();
            context.setUserSession(session);
            session.loginAs(new User().setUsername("admin").setId(-1).setProfile(Profile.Administrator));
        }
        // get lastchangedate of all metadata in index
        Map<String,String> docs = searchMan.getDocsChangeDate();

        // set up results HashMap for post processing of records to be indexed
View Full Code Here

Examples of jeeves.server.UserSession.loginAs()

      this.userProfile = this.context.getUserSession().getProfile();
    }
   
    private void login() {
        UserSession session = new UserSession();
        session.loginAs(new User().setUsername(this.userName).setId(this.userId).setProfile(this.userProfile));
        this.context.setUserSession(session);
    }
   
    public HashMap<String, Exception> call() throws Exception {
      HashMap<String, Exception> exceptions = new HashMap<String, Exception>();
View Full Code Here

Examples of jeeves.server.UserSession.loginAs()

    }

    public User loginAsAdmin(ServiceContext context) {
        final User admin = _userRepo.findAllByProfile(Profile.Administrator).get(0);
        UserSession userSession = new UserSession();
        userSession.loginAs(admin);
        context.setUserSession(userSession);
        return admin;
    }

    public Element getSampleMetadataXml() throws IOException, JDOMException {
View Full Code Here

Examples of org.xwiki.test.ui.framework.elements.LoginPage.loginAs()

    @Test
    public void testLoginWithInvalidCredentials()
    {
        LoginPage loginPage = this.vp.login();
        loginPage.loginAs("Admin", "wrong password");
        Assert.assertTrue(loginPage.hasInvalidCredentialsErrorMessage());
    }

    @Test
    public void testLoginWithInvalidUsername()
View Full Code Here

Examples of org.xwiki.test.ui.framework.elements.LoginPage.loginAs()

    @Test
    public void testLoginWithInvalidUsername()
    {
        LoginPage loginPage = this.vp.login();
        loginPage.loginAs("non existent user", "admin");
        Assert.assertTrue(loginPage.hasInvalidCredentialsErrorMessage());
    }

    /**
     * Verify that the initial URL is not lost after logging in when the session has expired.
View Full Code Here

Examples of org.xwiki.test.ui.po.LoginPage.loginAs()

    @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177")
    })
    public void testLoginWithInvalidCredentials()
    {
        LoginPage loginPage = this.vp.login();
        loginPage.loginAs("Admin", "wrong password");
        Assert.assertTrue(loginPage.hasInvalidCredentialsErrorMessage());
    }

    @Test
    @IgnoreBrowsers({
View Full Code Here

Examples of org.xwiki.test.ui.po.LoginPage.loginAs()

    @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason="See http://jira.xwiki.org/browse/XE-1177")
    })
    public void testLoginWithInvalidUsername()
    {
        LoginPage loginPage = this.vp.login();
        loginPage.loginAs("non existent user", "admin");
        Assert.assertTrue(loginPage.hasInvalidCredentialsErrorMessage());
    }

    /**
     * Verify that the initial URL is not lost after logging in when the session has expired.
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.