Package com.opengamma.master.orgs

Examples of com.opengamma.master.orgs.ManageableOrganization$Meta


  }

  @Test(expectedExceptions = DataNotFoundException.class)
  public void test_update_notFound() {
    UniqueId uniqueId = UniqueId.of("DbOrg", "0", "0");
    ManageableOrganization org = new ManageableOrganization("TestOrganization101",
                                                            "RED_code_101",
                                                            "ticker_101",
                                                            Region.AFRICA,
                                                            "CountryA",
                                                            Sector.BASICMATERIALS,
                                                            CreditRating.A,
                                                            CreditRating.A,
                                                            CreditRatingFitch.A,
                                                            CreditRatingMoodys.A,
                                                            CreditRatingStandardAndPoors.A,
                                                            false);
    org.setUniqueId(uniqueId);
    OrganizationDocument doc = new OrganizationDocument(org);
    _orgMaster.update(doc);
  }
View Full Code Here


  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_update_notLatestVersion() {
    UniqueId uniqueId = UniqueId.of("DbOrg", "201", "0");
    ManageableOrganization org = new ManageableOrganization("TestOrganization101",
                                                            "RED_code_101",
                                                            "ticker_101",
                                                            Region.AFRICA,
                                                            "CountryA",
                                                            Sector.BASICMATERIALS,
                                                            CreditRating.A,
                                                            CreditRating.A,
                                                            CreditRatingFitch.A,
                                                            CreditRatingMoodys.A,
                                                            CreditRatingStandardAndPoors.A,
                                                            false);
    org.setUniqueId(uniqueId);
    OrganizationDocument doc = new OrganizationDocument(org);
    _orgMaster.update(doc);
  }
View Full Code Here

  public void test_update_getUpdateGet() {
    Instant now = Instant.now(_orgMaster.getClock());

    UniqueId uniqueId = UniqueId.of("DbOrg", "101", "0");
    OrganizationDocument base = _orgMaster.get(uniqueId);
    ManageableOrganization org = new ManageableOrganization("TestOrganization101",
                                                            "RED_code_101",
                                                            "ticker_101",
                                                            Region.AFRICA,
                                                            "CountryA",
                                                            Sector.BASICMATERIALS,
                                                            CreditRating.A,
                                                            CreditRating.A,
                                                            CreditRatingFitch.A,
                                                            CreditRatingMoodys.A,
                                                            CreditRatingStandardAndPoors.A,
                                                            false);
    org.setUniqueId(uniqueId);
    OrganizationDocument input = new OrganizationDocument(org);

    OrganizationDocument updated = _orgMaster.update(input);
    assertEquals(false, base.getUniqueId().equals(updated.getUniqueId()));
    assertEquals(now, updated.getVersionFromInstant());
View Full Code Here

  }


  @Test
  public void test_example() throws Exception {
    ManageableOrganization org = new ManageableOrganization("TestOrganization101",
        "RED_code_101",
        "ticker_101",
        Region.AFRICA,
        "CountryA",
        Sector.BASICMATERIALS,
View Full Code Here

    assertEquals(uniqueId, test.getUniqueId());
    assertEquals(_version1Instant, test.getVersionFromInstant());
    assertEquals(now, test.getVersionToInstant());
    assertEquals(_version1Instant, test.getCorrectionFromInstant());
    assertEquals(null, test.getCorrectionToInstant());
    ManageableOrganization Organization = test.getOrganization();
    assertNotNull(Organization);
    assertEquals(uniqueId, Organization.getUniqueId());
    assertEquals("TestOrganization101", test.getOrganization().getObligor().getObligorShortName());
    assertEquals("RED_code_101", test.getOrganization().getObligor().getObligorREDCode());
    assertEquals("ticker_101", test.getOrganization().getObligor().getObligorTicker());

    assertEquals(CreditRatingFitch.A, test.getOrganization().getObligor().getFitchCreditRating());
View Full Code Here

  }

  @Test(expectedExceptions = IllegalArgumentException.class)
  public void test_correct_noOrganizationId() {
    UniqueId uniqueId = UniqueId.of("DbOrg", "101");
    ManageableOrganization org = new ManageableOrganization("TestOrganization101",
                                                            "RED_code_101",
                                                            "ticker_101",
                                                            Region.AFRICA,
                                                            "CountryA",
                                                            Sector.BASICMATERIALS,
                                                            CreditRating.A,
                                                            CreditRating.A,
                                                            CreditRatingFitch.A,
                                                            CreditRatingMoodys.A,
                                                            CreditRatingStandardAndPoors.A,
                                                            false);
    org.setUniqueId(uniqueId);
    OrganizationDocument doc = new OrganizationDocument(org);
    doc.setUniqueId(null);
    _orgMaster.correct(doc);
  }
View Full Code Here

  }

  @Test(expectedExceptions = DataNotFoundException.class)
  public void test_correct_notFound() {
    UniqueId uniqueId = UniqueId.of("DbOrg", "0", "0");
    ManageableOrganization org = new ManageableOrganization("TestOrganization101",
                                                            "RED_code_101",
                                                            "ticker_101",
                                                            Region.AFRICA,
                                                            "CountryA",
                                                            Sector.BASICMATERIALS,
                                                            CreditRating.A,
                                                            CreditRating.A,
                                                            CreditRatingFitch.A,
                                                            CreditRatingMoodys.A,
                                                            CreditRatingStandardAndPoors.A,
                                                            false);
    org.setUniqueId(uniqueId);
    OrganizationDocument doc = new OrganizationDocument(org);
    _orgMaster.correct(doc);
  }
View Full Code Here

  public void test_correct_getUpdateGet() {
    Instant now = Instant.now(_orgMaster.getClock());

    UniqueId uniqueId = UniqueId.of("DbOrg", "101", "0");
    OrganizationDocument base = _orgMaster.get(uniqueId);
    ManageableOrganization org = new ManageableOrganization("TestOrganization101",
                                                            "RED_code_101",
                                                            "ticker_101",
                                                            Region.AFRICA,
                                                            "CountryA",
                                                            Sector.BASICMATERIALS,
                                                            CreditRating.A,
                                                            CreditRating.A,
                                                            CreditRatingFitch.A,
                                                            CreditRatingMoodys.A,
                                                            CreditRatingStandardAndPoors.A,
                                                            false);
    org.setUniqueId(uniqueId);
    OrganizationDocument input = new OrganizationDocument(org);

    OrganizationDocument corrected = _orgMaster.correct(input);
    assertEquals(false, base.getUniqueId().equals(corrected.getUniqueId()));
    assertEquals(base.getVersionFromInstant(), corrected.getVersionFromInstant());
View Full Code Here

    return cloneOrganizationDocument(document);
  }

  private OrganizationDocument cloneOrganizationDocument(OrganizationDocument document) {
    OrganizationDocument clone = JodaBeanUtils.clone(document);
    ManageableOrganization organizationClone = JodaBeanUtils.clone(document.getOrganization());
    clone.setOrganization(organizationClone);
    return clone;
  }
View Full Code Here

  }

  @Override
  public ManageableOrganization getOrganization(UniqueId organizationId) {
    ArgumentChecker.notNull(organizationId, "organizationId");
    ManageableOrganization organization = _store.get(organizationId.getObjectId()).getOrganization();
    if (organization == null) {
      throw new DataNotFoundException("Organization not found: " + organizationId);
    }
    return cloneOrganization(organization);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.orgs.ManageableOrganization$Meta

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.