Package no.ugland.utransprod.service

Examples of no.ugland.utransprod.service.ApplicationUserManager


  @Before
  public void setUp() throws Exception {
    FailOnThreadViolationRepaintManager.install();
    MockitoAnnotations.initMocks(this);

    ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
        .getBean("applicationUserManager");
    final ConstructionTypeManager constructionTypeManager = (ConstructionTypeManager) ModelUtil
        .getBean(ConstructionTypeManager.MANAGER_NAME);
    when(managerRepository.getConstructionTypeManager()).thenReturn(
        constructionTypeManager);

    ApplicationUser user;

    user = applicationUserManager.login("admin", "admin");
    applicationUserManager.lazyLoad(user, new LazyLoadEnum[][] { {
        LazyLoadEnum.USER_ROLES, LazyLoadEnum.NONE } });
    UserType userType = user.getUserRoles().iterator().next().getUserType();

    Login login = new LoginImpl(user, userType);
View Full Code Here


        login.login();
        if(login.getApplicationUser()==null){
            System.exit(0);
        }

        ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
                .getBean(ApplicationUserManager.MANAGER_NAME);
        applicationUserManager
                .lazyLoad(
                        login.getApplicationUser(),
                        new LazyLoadEnum[][] {{LazyLoadEnum.USER_ROLES,LazyLoadEnum.NONE}});
        Set<UserRole> roles = login.getApplicationUser().getUserRoles();
        UserType userType;
View Full Code Here

     * @param userName
     * @param password
     * @return true dersom bruker ble autorisert
     */
    private ApplicationUser checkLogin(String userName, String password) {
        ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
                .getBean("applicationUserManager");
        return applicationUserManager.login(userName, password);
    }
View Full Code Here

    final ProductAreaManager productAreaManager = (ProductAreaManager) ModelUtil
        .getBean(ProductAreaManager.MANAGER_NAME);

    deviationManager = (DeviationManager) ModelUtil
        .getBean("deviationManager");
    final ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
        .getBean("applicationUserManager");
    ApplicationUser user;
    user = applicationUserManager.login("avviktransport", "avviktransport");
    applicationUserManager.lazyLoad(user, new LazyLoadEnum[][] { {
        LazyLoadEnum.USER_ROLES, LazyLoadEnum.NONE } });
    JobFunctionManager jobFunctionManager = (JobFunctionManager) ModelUtil
        .getBean("jobFunctionManager");
    if (user == null) {

      UserTypeManager userTypeManager = (UserTypeManager) ModelUtil
          .getBean("userTypeManager");
      JobFunction jobFunction = new JobFunction();
      jobFunction.setJobFunctionName("Transport");
      List<JobFunction> jobFunctions = jobFunctionManager
          .findByObject(jobFunction);
      jobFunction = jobFunctions.get(0);

      user = new ApplicationUser(null, "avviktransport",
          "avviktransport", "avviktransport", "avviktransport", null,
          "Nei", jobFunction, productArea, null);
      applicationUserManager.saveObject(user);

      UserType userType = new UserType();
      userType.setDescription("Avvik");
      List<UserType> userTypes = userTypeManager.findByObject(userType);
      userType = userTypes.get(0);

      Set<UserRole> userRoles = new HashSet<UserRole>();
      UserRole userRole = new UserRole(null, userType, user);
      userRoles.add(userRole);
      user.setUserRoles(userRoles);

      applicationUserManager.saveObject(user);
    }

    JobFunction jobFunction = user.getJobFunction();

    if (!jobFunction.getManager().equals(user)) {
View Full Code Here

        productAreaManager);
    DeviationStatusManager deviationStatusManager = (DeviationStatusManager) ModelUtil
        .getBean(DeviationStatusManager.MANAGER_NAME);
    when(managerRepository.getDeviationStatusManager()).thenReturn(
        deviationStatusManager);
    ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
        .getBean(ApplicationUserManager.MANAGER_NAME);
    when(managerRepository.getApplicationUserManager()).thenReturn(
        applicationUserManager);
    TransportSumVManager transportSumVManager = (TransportSumVManager) ModelUtil
        .getBean(TransportSumVManager.MANAGER_NAME);
    when(managerRepository.getTransportSumVManager()).thenReturn(
        transportSumVManager);
    BudgetManager budgetManager = (BudgetManager) ModelUtil
        .getBean(BudgetManager.MANAGER_NAME);
    when(managerRepository.getBudgetManager()).thenReturn(budgetManager);
    OrderManager orderManager = (OrderManager) ModelUtil
        .getBean(OrderManager.MANAGER_NAME);
    when(managerRepository.getOrderManager()).thenReturn(orderManager);
    ArticleTypeManager articleTypeManager = (ArticleTypeManager) ModelUtil
        .getBean(ArticleTypeManager.MANAGER_NAME);
    when(managerRepository.getArticleTypeManager()).thenReturn(
        articleTypeManager);
    SupplierManager supplierManager = (SupplierManager) ModelUtil
        .getBean(SupplierManager.MANAGER_NAME);
    when(managerRepository.getSupplierManager())
        .thenReturn(supplierManager);
    TransportManager transportManager = (TransportManager) ModelUtil
        .getBean(TransportManager.MANAGER_NAME);
    when(managerRepository.getTransportManager()).thenReturn(
        transportManager);
    ColliManager colliManager = (ColliManager) ModelUtil
        .getBean(ColliManager.MANAGER_NAME);
    when(managerRepository.getColliManager()).thenReturn(colliManager);
    DeviationManager deviationManager = (DeviationManager) ModelUtil
        .getBean(DeviationManager.MANAGER_NAME);
    when(managerRepository.getDeviationManager()).thenReturn(
        deviationManager);
    OrdlnManager ordlnManager = (OrdlnManager) ModelUtil
        .getBean(OrdlnManager.MANAGER_NAME);
    when(managerRepository.getOrdlnManager()).thenReturn(ordlnManager);
    TakstolPackageVManager takstolPackageVManager = (TakstolPackageVManager) ModelUtil
        .getBean(TakstolPackageVManager.MANAGER_NAME);
    when(managerRepository.getTakstolPackageVManager()).thenReturn(
        takstolPackageVManager);
    TakstolProductionVManager takstolProductionVManager = (TakstolProductionVManager) ModelUtil
        .getBean(TakstolProductionVManager.MANAGER_NAME);
    when(managerRepository.getTakstolProductionVManager()).thenReturn(
        takstolProductionVManager);
    TakstolInfoVManager takstolInfoVManager = (TakstolInfoVManager) ModelUtil
        .getBean(TakstolInfoVManager.MANAGER_NAME);
    when(managerRepository.getTakstolInfoVManager()).thenReturn(
        takstolInfoVManager);

    ApplicationUser applicationUser = new ApplicationUser();
    applicationUser.setUserName("admin");
    applicationUser = applicationUserManager.findByObject(applicationUser)
        .get(0);
    ProductArea productArea = new ProductArea();
    ProductAreaGroupManager productAreaGroupManager = (ProductAreaGroupManager) ModelUtil
        .getBean(ProductAreaGroupManager.MANAGER_NAME);
    ProductAreaGroup productAreaGroup = productAreaGroupManager
View Full Code Here

    DeviationStatusManager deviationStatusManager = (DeviationStatusManager) ModelUtil
        .getBean(DeviationStatusManager.MANAGER_NAME);
    when(managerRepository.getDeviationStatusManager()).thenReturn(
        deviationStatusManager);

    ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
        .getBean(ApplicationUserManager.MANAGER_NAME);
    when(managerRepository.getApplicationUserManager()).thenReturn(
        applicationUserManager);
    ArticleTypeManager articleTypeManager = (ArticleTypeManager) ModelUtil
        .getBean(ArticleTypeManager.MANAGER_NAME);
View Full Code Here

    }
    public static UserType getUserType(){
        return userType!=null?userType:initUserType();
    }
    private static ApplicationUser initUser(String userName,String password){
        ApplicationUserManager applicationUserManager=(ApplicationUserManager)ModelUtil.getBean(ApplicationUserManager.MANAGER_NAME);
        return applicationUserManager.login(userName, password);
    }
View Full Code Here

    private static ApplicationUser initUser(String userName,String password){
        ApplicationUserManager applicationUserManager=(ApplicationUserManager)ModelUtil.getBean(ApplicationUserManager.MANAGER_NAME);
        return applicationUserManager.login(userName, password);
    }
    private static UserType initUserType(){
        ApplicationUserManager applicationUserManager=(ApplicationUserManager)ModelUtil.getBean(ApplicationUserManager.MANAGER_NAME);
        ApplicationUser user=getUser();
        applicationUserManager.lazyLoad(user, new LazyLoadEnum[][]{{LazyLoadEnum.USER_ROLES,LazyLoadEnum.NONE}});
        return user.getUserRoles().iterator().next().getUserType();
    }
View Full Code Here

        applicationUserManager.lazyLoad(user, new LazyLoadEnum[][]{{LazyLoadEnum.USER_ROLES,LazyLoadEnum.NONE}});
        return user.getUserRoles().iterator().next().getUserType();
    }
  public static List<String> getUserList() {
    if(userNameList==null){
      ApplicationUserManager applicationUserManager=(ApplicationUserManager)ModelUtil.getBean(ApplicationUserManager.MANAGER_NAME);
      userNameList=applicationUserManager.findAllNamesNotGroup();
    }
    return userNameList;
  }
View Full Code Here

        .getBean(SupplierManager.MANAGER_NAME);
    when(managerRepository.getSupplierManager()).thenReturn(supplierManager);
    final DeviationStatusManager deviationStatusManager = (DeviationStatusManager) ModelUtil
        .getBean(DeviationStatusManager.MANAGER_NAME);
    when(managerRepository.getDeviationStatusManager()).thenReturn(deviationStatusManager);
    final ApplicationUserManager applicationUserManager = (ApplicationUserManager) ModelUtil
        .getBean(ApplicationUserManager.MANAGER_NAME);
    when(managerRepository.getApplicationUserManager()).thenReturn(applicationUserManager);
    final DeviationManager deviationManager = (DeviationManager) ModelUtil
        .getBean(DeviationManager.MANAGER_NAME);
    when(managerRepository.getDeviationManager()).thenReturn(deviationManager);
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.service.ApplicationUserManager

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.