Examples of AnonymousUser


Examples of com.serotonin.m2m2.vo.AnonymousUser

        if (view.getAnonymousAccess() != ShareUser.ACCESS_SET)
            throw new PermissionException("Point is not anonymously settable", null);

        // Allow the set.
        setPointImpl(view.findDataPoint(viewComponentId), valueStr, new AnonymousUser());

        return viewComponentId;
    }
View Full Code Here

Examples of javango.core.AnonymousUser

      path = request.getContext() + "/" + path + "/";
      return new HttpResponseRedirect(path);
    }
   
    if (request.getUser() == null) {
      request.setUser(new AnonymousUser());
    }
    return super.processRequest(request);
  }
View Full Code Here

Examples of javango.core.AnonymousUser

        request.setFiles(null);
      }
     
      if (servletRequest.getUserPrincipal() == null) {
        // TODO this user should not necessarly change from request to request (maybe).  only works if the user has cookies,  see how django handles.
        request.setUser(new AnonymousUser());
      } else {
        request.setUser(new PrincipalUser(servletRequest));
      }
     
      HttpResponse response = requestProcessor.service(request);
View Full Code Here

Examples of javango.core.AnonymousUser

    this.context = context;
  }

  public User getUser() {
    if (user == null) {
      user = new AnonymousUser();
    }
    return user;
  }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.AnonymousUser

     */
    @Override
    public JCUser getCurrentUser() {
        JCUser currentUser = userReader.getCurrentUser();
        if (currentUser.isAnonymous()) {
            return new AnonymousUser();
        } else {
            return JCUser.copyUser(currentUser);
        }
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.AnonymousUser

        verify(userService).getCurrentUser();
    }

    @Test
    public void testLoginUserNotLogged() {
        when(userService.getCurrentUser()).thenReturn(new AnonymousUser());

        ModelAndView mav = userController.loginPage(request);

        assertEquals(mav.getViewName(), UserController.LOGIN);
        verify(userService).getCurrentUser();
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.AnonymousUser

     */
    @Override
    public JCUser getCurrentUser() {
        String name = securityService.getCurrentUserUsername();
        if (name == null) {
            return new AnonymousUser();
        } else {
            return this.getDao().getByUsername(name);
        }

    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.AnonymousUser

    }

    @Test
    public void testCurrentUserIsAnonymous() {
        when(sessionRegistry.getAllPrincipals()).thenReturn(list);
        when(userService.getCurrentUser()).thenReturn(new AnonymousUser());

        locationService.getUsersViewing(topic);
    }
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.AnonymousUser

        locationService.clearUserLocation();
    }
   
    @Test
    public void testClearUserLocationForAnonymous() {
        when(userService.getCurrentUser()).thenReturn(new AnonymousUser());
       
      locationService.clearUserLocation();
      @SuppressWarnings("unchecked")
    Map<JCUser, String> registerUserMap = mock(Map.class);
      verify(registerUserMap, Mockito.never()).remove(Mockito.any());
View Full Code Here

Examples of org.jtalks.jcommune.model.entity.AnonymousUser

    }

    @Test
    public void resolveLocaleShouldReturnRequestLocaleIfUserAnonymous() {
        JcLocaleResolver localeResolver = new JcLocaleResolver(userService);
        AnonymousUser user = new AnonymousUser();
        user.setLanguage(Language.SPANISH);
        Locale defaultLocale = Language.ENGLISH.getLocale();
        when(userService.getCurrentUser()).thenReturn(user);
        when(request.getLocale()).thenReturn(defaultLocale);

        Locale result = localeResolver.resolveLocale(request);
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.