Package org.olat.core.id

Examples of org.olat.core.id.User


    assertTrue("Wrong equals implementation, same users are NOT recognized as equals ",user1.equals(user1_2));
  }
 
  public void testHashCode() {
    UserManager um = UserManager.getInstance();
    User user1 = um.findUserByEmail("judihui@id.uzh.ch");
    User user2 = um.findUserByEmail("migros@id.migros.uzh.ch");
    User user1_2 = um.findUserByEmail("judihui@id.uzh.ch");

    assertTrue("Wrong hashCode implementation, same users have NOT same hash-code ",user1.hashCode() == user1.hashCode());
    assertFalse("Wrong hashCode implementation, different users have same hash-code",user1.hashCode() == user2.hashCode());
    assertTrue("Wrong hashCode implementation, same users have NOT same hash-code ",user1.hashCode() == user1_2.hashCode());
  }
View Full Code Here


        gender = "m";
      } else {
        institution = "yourinst";
        gender = "f";
      }
      User user = um.createUser(username + "first", username + "last", username + "@test.test");
      user.setProperty(UserConstants.GENDER, gender);
      user.setProperty(UserConstants.BIRTHDAY, "24.07.3007");
      user.setProperty(UserConstants.STREET, "Zähringerstrasse 26");
      user.setProperty(UserConstants.EXTENDEDADDRESS, null);
      user.setProperty(UserConstants.POBOX, null);
      user.setProperty(UserConstants.CITY, "Zürich");
      user.setProperty(UserConstants.COUNTRY, "Switzerland");
      user.setProperty(UserConstants.TELMOBILE, "123456789");
      user.setProperty(UserConstants.TELOFFICE, "123456789");
      user.setProperty(UserConstants.TELPRIVATE, "123456789");
      user.setProperty(UserConstants.INSTITUTIONALEMAIL, username + "@" + institution);
      user.setProperty(UserConstants.INSTITUTIONALNAME, institution);
      user.setProperty(UserConstants.INSTITUTIONALUSERIDENTIFIER, username + "-" + institution);
      AuthHelper.createAndPersistIdentityAndUserWithUserGroup(username, "hokuspokus", user);

      if (i % 10 == 0) {
        // flush now to obtimize performance
        DBFactory.getInstance().closeSession();
View Full Code Here

  }
 
  public void testGetIdentitiesByPowerSearch() {
    Manager ma = ManagerFactory.getManager();
    ma.init();
    User user2 = UserManager.getInstance().createUser("yo", "man", "yoman@lustig.com");
    user2.setProperty(UserConstants.INSTITUTIONALNAME, "unizh");
    user2.setProperty(UserConstants.INSTITUTIONALUSERIDENTIFIER, "12-345-678-908");
    Identity ident2 = ma.createAndPersistIdentityAndUser("extremegroovy", user2, OLATAuthenticationController.PROVIDER_OLAT, "extremegroovy", Encoder.encrypt("ppp"));

    User deletedLike2 = UserManager.getInstance().createUser("yo", "man", "yoman@lustig.com");
    deletedLike2.setProperty(UserConstants.INSTITUTIONALNAME,"unizh");
    deletedLike2.setProperty(UserConstants.INSTITUTIONALUSERIDENTIFIER,"12-345-678-908");
    Identity deletedIdentLike2 = ma.createAndPersistIdentityAndUser("deleted", deletedLike2, OLATAuthenticationController.PROVIDER_OLAT, "deleted", Encoder.encrypt("ppp"));

    // add some stats
    ma.saveIdentityStatus(ident, Identity.STATUS_ACTIV);
    ma.saveIdentityStatus(ident2, Identity.STATUS_ACTIV);
View Full Code Here

 
  public void testGetIdentitiesByPowerSearchWithUserPropertiesAndIntersectionOption() {
    Manager ma = ManagerFactory.getManager();
    ma.init();
    // create two test users
    User onePropUser = UserManager.getInstance().createUser("onepropuser", "onepropuser", "onepropuser@lustig.com");
    onePropUser.setProperty(UserConstants.FIRSTNAME, "One");   
    Identity onePropeIdentity = ma.createAndPersistIdentityAndUser("onePropUser", onePropUser, OLATAuthenticationController.PROVIDER_OLAT, "onepropuser", Encoder.encrypt("ppp"));
   
    User twoPropUser = UserManager.getInstance().createUser("twopropuser", "twopropuser", "twopropuser@lustig.com");
    twoPropUser.setProperty(UserConstants.FIRSTNAME, "Two");
    twoPropUser.setProperty(UserConstants.LASTNAME, "Prop");

    Identity twoPropeIdentity = ma.createAndPersistIdentityAndUser("twopropuser", twoPropUser, OLATAuthenticationController.PROVIDER_OLAT, "twopropuser", Encoder.encrypt("ppp"));
    // commit
    DBFactory.getInstance().closeSession();
View Full Code Here

 
  public void testMultipleUserPropertiesSearches() {
    Manager ma = ManagerFactory.getManager();
    ma.init();
    // create two test users
    User multiPropUser = UserManager.getInstance().createUser("multipropuser", "multipropuser", "multipropuser@lustig.com");
    multiPropUser.setProperty(UserConstants.FIRSTNAME, "Multi");   
    multiPropUser.setProperty(UserConstants.LASTNAME, "Prop");   
    multiPropUser.setProperty(UserConstants.INSTITUTIONALNAME, "MultiInst");   
    multiPropUser.setProperty(UserConstants.INSTITUTIONALEMAIL, "MultiInst@lustig.com");   
    multiPropUser.setProperty(UserConstants.INSTITUTIONALUSERIDENTIFIER, "MultiInst");   
    multiPropUser.setProperty(UserConstants.CITY, "Züri");   
    Identity onePropeIdentity = ma.createAndPersistIdentityAndUser("multiPropUser", multiPropUser, OLATAuthenticationController.PROVIDER_OLAT, "multipropuser", Encoder.encrypt("ppp"));

    // commit
    DBFactory.getInstance().closeSession();
View Full Code Here

    if (NotificationsManagerTest.isInitialized == false) {
      try {
        nm = NotificationsManager.getInstance();
        DBFactory.getJunitInstance().clearDatabase();
        // identity with null User should be ok for test case
        User u1 = UserManager.getInstance().createAndPersistUser("fi1", "la1", "user1@bla.com");
        identity = ManagerFactory.getManager().createAndPersistIdentity("foo", u1, OLATAuthenticationController.PROVIDER_OLAT, "foo", Encoder.encrypt("hashipassi"));
        User u2 = UserManager.getInstance().createAndPersistUser("fi2", "la2", "user2@bla.com");
        identity2 = ManagerFactory.getManager().createAndPersistIdentity("foo2", u2, OLATAuthenticationController.PROVIDER_OLAT, "foo2", Encoder.encrypt("hashipassi2"));
        User u3 = UserManager.getInstance().createAndPersistUser("fi3", "la3", "user3@bla.com");
        identity3 = ManagerFactory.getManager().createAndPersistIdentity("foo3", u3, OLATAuthenticationController.PROVIDER_OLAT, "foo3", Encoder.encrypt("hashipassi3"));
       
        // Setup for code-points
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");
        ActiveMQQueue queue = new ActiveMQQueue("olat/codepoints");
View Full Code Here

    this.userCommentDisplayVC = createVelocityContainer("userCommentDisplay");
    this.userCommentDisplayVC.contextPut("formatter", Formatter.getInstance(getLocale()));
    this.userCommentDisplayVC.contextPut("securityCallback", securityCallback);
    this.userCommentDisplayVC.contextPut("comment", userComment);
    // Creator information
    User user = userComment.getCreator().getUser();
    TextComponent creator = TextFactory.createTextComponentFromI18nKey("creator", null, null, null, true, userCommentDisplayVC);
    creator.setText(translate("comments.comment.creator", new String[]{user.getProperty(UserConstants.FIRSTNAME, null), user.getProperty(UserConstants.LASTNAME, null)}));
    // Portrait
    if (CoreSpringFactory.containsBean(UserAvatarDisplayControllerCreator.class.getName())) {
      UserAvatarDisplayControllerCreator avatarControllerCreator = (UserAvatarDisplayControllerCreator) CoreSpringFactory.getBean(UserAvatarDisplayControllerCreator.class);
      Controller avatarCtr = avatarControllerCreator.createController(ureq, getWindowControl(), userComment.getCreator(), false, true);
      listenTo(avatarCtr);
View Full Code Here

        gender = "m";
      } else {
        institution = "yourinst";
        gender = "f";
      }
      User user = UserManager.getInstance().createUser(username + "first", username + "last", username + "@test.test");
      user.setProperty(UserConstants.GENDER, gender);
      user.setProperty(UserConstants.BIRTHDAY, "24.07.3007");
      user.setProperty(UserConstants.STREET, "Zähringerstrasse 26");
      user.setProperty(UserConstants.EXTENDEDADDRESS, null);
      user.setProperty(UserConstants.POBOX, null);
      user.setProperty(UserConstants.CITY, "Zürich");
      user.setProperty(UserConstants.COUNTRY, "Switzerland");
      user.setProperty(UserConstants.TELMOBILE, "123456789");
      user.setProperty(UserConstants.TELOFFICE, "123456789");
      user.setProperty(UserConstants.TELPRIVATE, "123456789");
      user.setProperty(UserConstants.INSTITUTIONALEMAIL, username + "@" + institution);
      user.setProperty(UserConstants.INSTITUTIONALNAME, institution);
      user.setProperty(UserConstants.INSTITUTIONALUSERIDENTIFIER, username + "-" + institution);
      AuthHelper.createAndPersistIdentityAndUserWithUserGroup(username, "hokuspokus", user);

      if (i % 10 == 0) {
        // flush now to obtimize performance
        DBFactory.getInstance().closeSession();
View Full Code Here

  protected void event(UserRequest ureq, Component source, Event event) {
    if (source == replyLink) {
      // Init reply workflow
      replyCommentFormCtr = new UserCommentFormController(ureq, getWindowControl(), userComment, null, commentManager);
      listenTo(replyCommentFormCtr);
      User parentUser = userComment.getCreator().getUser();
      String title = translate("comments.coment.reply.title", new String[]{parentUser.getProperty(UserConstants.FIRSTNAME, null), parentUser.getProperty(UserConstants.LASTNAME, null)});
      TitleInfo titleInfo = new TitleInfo(null, title);
      replyTitledWrapperCtr = new TitledWrapperController(ureq, getWindowControl(), replyCommentFormCtr, null, titleInfo);
      listenTo(replyTitledWrapperCtr);
      replyCmc = new CloseableModalController(getWindowControl(), "close", replyTitledWrapperCtr.getInitialComponent());
      replyCmc.activate();     
View Full Code Here

    String PACKAGE = Util.getPackageName(BusinessGroupManagerImplTest.class);
    testTranslator = new PackageTranslator(PACKAGE, new Locale("de"));

    // Identities
    User UserWg1 = UserManager.getInstance().createAndPersistUser("FirstName_wg1", "LastName_wg1", "wg1_junittest@olat.unizh.ch");
    wg1 = ManagerFactory.getManager().createAndPersistIdentity("wg1", UserWg1, OLATAuthenticationController.PROVIDER_OLAT, "wg1",
        Encoder.encrypt("wg1"));
    User UserWg2 = UserManager.getInstance().createAndPersistUser("FirstName_wg2", "LastName_wg2", "wg2_junittest@olat.unizh.ch");
    wg2 = ManagerFactory.getManager().createAndPersistIdentity("wg2", UserWg2, OLATAuthenticationController.PROVIDER_OLAT, "wg2",
        Encoder.encrypt("wg2"));
    User UserWg3 = UserManager.getInstance().createAndPersistUser("FirstName_wg3", "LastName_wg3", "wg3_junittest@olat.unizh.ch");
    wg3 = ManagerFactory.getManager().createAndPersistIdentity("wg3", UserWg3, OLATAuthenticationController.PROVIDER_OLAT, "wg3",
        Encoder.encrypt("wg3"));
    User UserWg4 = UserManager.getInstance().createAndPersistUser("FirstName_wg4", "LastName_wg4", "wg4_junittest@olat.unizh.ch");
    wg4 = ManagerFactory.getManager().createAndPersistIdentity("wg4", UserWg4, OLATAuthenticationController.PROVIDER_OLAT, "wg4",
        Encoder.encrypt("wg4"));

  }
View Full Code Here

TOP

Related Classes of org.olat.core.id.User

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.