Package com.opengamma.master.user

Examples of com.opengamma.master.user.UserDocument


  }

  @Test
  public void test_getUser_versioned_oneUserDate() {
    UniqueId uniqueId = UniqueId.of("DbUsr", "101", "0");
    UserDocument test = _usrMaster.get(uniqueId);
    assert101(test);
  }
View Full Code Here


  }

  @Test
  public void test_getUser_versioned_twoUserDates() {
    UniqueId uniqueId = UniqueId.of("DbUsr", "102", "0");
    UserDocument test = _usrMaster.get(uniqueId);
    assert102(test);
  }
View Full Code Here

  }

  @Test
  public void test_getUser_versioned_notLatest() {
    UniqueId uniqueId = UniqueId.of("DbUsr", "201", "0");
    UserDocument test = _usrMaster.get(uniqueId);
    assert201(test);
  }
View Full Code Here

  }

  @Test
  public void test_getUser_versioned_latest() {
    UniqueId uniqueId = UniqueId.of("DbUsr", "201", "1");
    UserDocument test = _usrMaster.get(uniqueId);
    assert202(test);
  }
View Full Code Here

  }

  @Test
  public void test_getUser_unversioned() {
    UniqueId oid = UniqueId.of("DbUsr", "201");
    UserDocument test = _usrMaster.get(oid);
    assert202(test);
  }
View Full Code Here

    user.setExternalIdBundle(ExternalIdBundle.of(ExternalId.of("A", "B"), ExternalId.of("C", "D")));
    user.setPasswordHash("PASSWORD_HASH");
    user.getEntitlements().add("ENTITLEMENT-1");
    user.getEntitlements().add("ENTITLEMENT-2");
    user.getEntitlements().add("ENTITLEMENT-3");
    UserDocument addDoc = new UserDocument(user);
    UserDocument added = _userMaster.add(addDoc);
   
    UserDocument loaded = _userMaster.get(added.getUniqueId());
    assertEquals(added, loaded);
  }
View Full Code Here

    ManageableOGUser user = new ManageableOGUser("Test");
    user.setPasswordHash("PASSWORD_HASH");
    user.getEntitlements().add("ENTITLEMENT-1");
    user.getEntitlements().add("ENTITLEMENT-2");
    user.getEntitlements().add("ENTITLEMENT-3");
    UserDocument addDoc = new UserDocument(user);
    UserDocument added = _userMaster.add(addDoc);
   
    UserDocument loaded = _userMaster.get(added.getUniqueId());
    assertEquals(added, loaded);
  }
View Full Code Here

  @Test
  public void test_no_entitlements() throws Exception {
    ManageableOGUser user = new ManageableOGUser("Test");
    user.setExternalIdBundle(ExternalIdBundle.of(ExternalId.of("A", "B"), ExternalId.of("C", "D")));
    user.setPasswordHash("PASSWORD_HASH");
    UserDocument addDoc = new UserDocument(user);
    UserDocument added = _userMaster.add(addDoc);
   
    UserDocument loaded = _userMaster.get(added.getUniqueId());
    assertEquals(added, loaded);
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_multiple_users() throws Exception {
    UserDocument doc1 = addUser("user-1", "pw-1", ExternalIdBundle.of(ExternalId.of("A", "1"), ExternalId.of("B", "1")), "E-1", "E-2");
    UserDocument doc2 = addUser("user-2", "pw-1", ExternalIdBundle.of(ExternalId.of("A", "2"), ExternalId.of("B", "1")), "E-1", "E-2");
    /*UserDocument doc3 = */ addUser("user-3", "pw-1", ExternalIdBundle.of(ExternalId.of("A", "3"), ExternalId.of("B", "1")), "E-2", "E-3");
    UserDocument doc4 = addUser("user-4", "pw-1", ExternalIdBundle.of(ExternalId.of("A", "4"), ExternalId.of("B", "2")), "E-2", "E-3");
    UserDocument doc5 = addUser("user-5", "pw-1", ExternalIdBundle.of(ExternalId.of("A", "5"), ExternalId.of("B", "2")), "E-4", "E-5");
    UserDocument doc6 = addUser("user-6", "pw-1", ExternalIdBundle.of(ExternalId.of("A", "5"), ExternalId.of("B", "2")), "E-4", "E-5", "E-6", "E-7", "E-8");

    UserDocument user = _userMaster.get(UniqueId.of("DbUsr", "1006"));
    assertNotNull(user);
   
    Collection<? extends OGUser> users = findUsers(ExternalIdBundle.of(ExternalId.of("A", "1")), VersionCorrection.LATEST);
    assertNotNull(users);
    assertEquals(1, users.size());
View Full Code Here

    user.setExternalIdBundle(idBundle);
    user.setPasswordHash(passwordHash);
    for (String entitlement : entitlements) {
      user.getEntitlements().add(entitlement);
    }
    UserDocument addDoc = new UserDocument(user);
    UserDocument added = _userMaster.add(addDoc);
    return added;
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.user.UserDocument

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.