Package com.opengamma.id

Examples of com.opengamma.id.ObjectId


  public void test_ReplaceVersions() {
    Clock origClock = _cfgMaster.getClock();
    try {
      Instant now = Instant.now();

      ObjectId baseOid = setupTestData(now);
      _cfgMaster.setClock(Clock.fixed(now.plus(2, HOURS), ZoneOffset.UTC));
      ConfigDocument latestDoc = _cfgMaster.get(baseOid, VersionCorrection.LATEST);
      Instant latestFrom = latestDoc.getVersionFromInstant();

View Full Code Here


  public void test_ReplaceVersions2() {
    Clock origClock = _cfgMaster.getClock();
    try {
      Instant now = Instant.now();

      ObjectId baseOid = setupTestData(now);
      _cfgMaster.setClock(Clock.fixed(now.plus(2, HOURS), ZoneOffset.UTC));
      ConfigDocument latestDoc = _cfgMaster.get(baseOid, VersionCorrection.LATEST);
      Instant latestFrom = latestDoc.getVersionFromInstant();

View Full Code Here

  public void test_ReplaceVersion_notInTimeBounds() {
    Clock origClock = _cfgMaster.getClock();
    try {
      Instant now = Instant.now();

      ObjectId baseOid = setupTestData(now);
      _cfgMaster.setClock(Clock.fixed(now.plus(2, HOURS), ZoneOffset.UTC));
      @SuppressWarnings("unused")
      ConfigDocument latestDoc = _cfgMaster.get(baseOid, VersionCorrection.LATEST);
     
      List<ConfigDocument> replacement = newArrayList();
View Full Code Here

  public void test_ReplaceVersion_inTimeBounds() {
    Clock origClock = _cfgMaster.getClock();
    try {
      Instant now = Instant.now();

      ObjectId baseOid = setupTestData(now);
      _cfgMaster.setClock(Clock.fixed(now.plus(2, HOURS), ZoneOffset.UTC));
      @SuppressWarnings("unused")
      ConfigDocument latestDoc = _cfgMaster.get(baseOid, VersionCorrection.LATEST);

      List<ConfigDocument> replacement = newArrayList();
View Full Code Here

    });
  }

  @Test(expectedExceptions = DataNotFoundException.class)
  public void deleteNonExisting() {
    final ObjectId runId = ObjectId.of("---", "000");

    _batchMaster.getDbConnector().getTransactionTemplate().execute(new TransactionCallback<Void>() {
      @Override
      public Void doInTransaction(final TransactionStatus status) {
        assertNull(_batchWriter.getRiskRun(runId));
View Full Code Here

  public void test_ReplaceVersion_atTimeBounds() {
    Clock origClock = _cfgMaster.getClock();
    try {
      Instant now = Instant.now();

      ObjectId baseOid = setupTestData(now);
      _cfgMaster.setClock(Clock.fixed(now.plus(2, HOURS), ZoneOffset.UTC));


      List<ConfigDocument> replacement = newArrayList();
      for (int i = 0; i <= 2; i++) {
View Full Code Here

  public void test_ReplaceVersion_atTimeBounds2() {
    Clock origClock = _cfgMaster.getClock();
    try {
      Instant now = Instant.now();

      ObjectId baseOid = setupTestData(now);
      _cfgMaster.setClock(Clock.fixed(now.plus(2, HOURS), ZoneOffset.UTC));


      List<ConfigDocument> replacement = newArrayList();
      for (int i = 0; i <= 2; i++) {
View Full Code Here

  public void test_ReplaceVersion_noUid() {
    Clock origClock = _cfgMaster.getClock();
    try {
      Instant now = Instant.now();

      ObjectId baseOid = setupTestData(now);
      _cfgMaster.setClock(Clock.fixed(now.plus(2, HOURS), ZoneOffset.UTC));


      List<ConfigDocument> replacement = newArrayList();
      for (int i = 0; i <= 2; i++) {
        String val = "replace_" + i;
        ConfigDocument doc = new ConfigDocument(ConfigItem.of(val));
        doc.setVersionFromInstant(now.plus(1, MINUTES).plus(i * 20, SECONDS));
        replacement.add(doc);
      }

      _cfgMaster.replaceVersion(baseOid.atVersion("no such uid"), replacement);
    } finally {
      _cfgMaster.setClock(origClock);
    }
  }
View Full Code Here

    assertNotNull(_batchMaster.getRiskRun(ObjectId.of(DbBatchMaster.BATCH_IDENTIFIER_SCHEME, "1")));
  }
 
  @Test(expectedExceptions = DataNotFoundException.class)
  public void testDeleteBatchByUID() {
    ObjectId id = ObjectId.of(DbBatchMaster.BATCH_IDENTIFIER_SCHEME, "1");
    assertNotNull(_batchMaster.getRiskRun(id));
    _batchMaster.deleteRiskRun(id);
    _batchMaster.getRiskRun(id);
    fail("we should not reach this point due to exception");
 
View Full Code Here

  }


  @Test
  public void test_history_documents() {
    ObjectId oid = ObjectId.of("DbOrg", "201");
    OrganizationHistoryRequest request = new OrganizationHistoryRequest(oid);
    OrganizationHistoryResult test = _orgMaster.history(request);

    assertEquals(2, test.getDocuments().size());
    assert202(test.getDocuments().get(0));
View Full Code Here

TOP

Related Classes of com.opengamma.id.ObjectId

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.