Package net.tralfamadore.admin.util

Examples of net.tralfamadore.admin.util.CurrentUser



    @Test
    public void testLocalCurrentUserInfo() {
        final String userName = "testUser";
        final CurrentUser currentUser = new CurrentUser();
        currentUser.setUser(userName);

        new NonStrictExpectations() {{
            FacesContext.getCurrentInstance(); result = facesContext;
            facesContext.getApplication(); result = application;
            facesContext.getELContext(); result = elContext;
View Full Code Here


    @Override
    public String getCurrentUser() {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ELResolver elResolver = FacesContext.getCurrentInstance().getApplication().getELResolver();
        Object o = elResolver.getValue(facesContext.getELContext(), null, "currentUser");
        CurrentUser user = (CurrentUser) o;

//        facesContext.getExternalContext().getSessionMap().get("cmfCurrentUser");

        return user == null ? null : user.getUser();
    }
View Full Code Here

TOP

Related Classes of net.tralfamadore.admin.util.CurrentUser

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.