Package com.opengamma.id

Examples of com.opengamma.id.ObjectId


    assert221(test.getDocuments().get(1));
  }

  @Test
  public void test_searchPositionHistoric_versionsFrom_postSecond() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    request.setVersionsFromInstant(_version2Instant.plusSeconds(5));
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(1, test.getPaging().getTotalItems());
View Full Code Here


  }

  //-------------------------------------------------------------------------
  @Test
  public void test_searchPositionHistoric_versionsTo_preFirst() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    request.setVersionsToInstant(_version1Instant.minusSeconds(5));
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(0, test.getPaging().getTotalItems());
View Full Code Here

    assertEquals(0, test.getDocuments().size());
  }

  @Test
  public void test_searchPositionHistoric_versionsTo_firstToSecond() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    request.setVersionsToInstant(_version1Instant.plusSeconds(5));
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(1, test.getPaging().getTotalItems());
View Full Code Here

    assert221(test.getDocuments().get(0));
  }

  @Test
  public void test_searchPositionHistoric_versionsTo_postSecond() {
    ObjectId oid = ObjectId.of("DbPos", "221");
    PositionHistoryRequest request = new PositionHistoryRequest(oid);
    request.setVersionsToInstant(_version2Instant.plusSeconds(5));
    PositionHistoryResult test = _posMaster.history(request);
   
    assertEquals(2, test.getPaging().getTotalItems());
View Full Code Here

  }

  @GET
  @Path("currencyMatrices/{objectId}/{versionCorrection}")
  public Response getMatrixByObjectIdentifier(@PathParam("objectId") String objectIdStr, @PathParam("versionCorrection") String versionCorrectionStr) {
    final ObjectId objectId = ObjectId.parse(objectIdStr);
    final VersionCorrection versionCorrection = VersionCorrection.parse(versionCorrectionStr);
    final CurrencyMatrix result = getCurrencyMatrixSource().get(objectId, versionCorrection);
    return responseOkFudge(result);
  }
View Full Code Here

    _htsMaster.remove(uniqueId);
  }

  @Test(expectedExceptions = DataNotFoundException.class)
  public void test_removeHistoricalTimeSeries_versioned_notFoundVersion() {
    ObjectId objectId = ObjectId.of("DbHts", "6666666666");
    _htsMaster.remove(objectId);
  }
View Full Code Here

    _htsMaster.removeTimeSeriesDataPoints(ObjectId.of("DbHts", "DP101"), LocalDate.of(2011, 7, 1), LocalDate.of(2011, 3, 1));
  }

  @Test(expectedExceptions = DataNotFoundException.class)
  public void test_remove_versioned_notFoundId() {
    ObjectId oid = ObjectId.of("DbHts", "DP0");
    _htsMaster.removeTimeSeriesDataPoints(oid, LocalDate.of(2011, 7, 1), LocalDate.of(2011, 7, 1));
  }
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void test_remove_101_removeOne() {
    ObjectId oid = ObjectId.of("DbHts", "DP101");
    UniqueId uniqueId = _htsMaster.removeTimeSeriesDataPoints(oid, LocalDate.of(2011, 1, 2), LocalDate.of(2011, 1, 2));
   
    ManageableHistoricalTimeSeries testCorrected = _htsMaster.getTimeSeries(uniqueId);
    assertEquals(uniqueId, testCorrected.getUniqueId());
    LocalDateDoubleTimeSeries timeSeries = testCorrected.getTimeSeries();
View Full Code Here

    assertEquals(3.33d, timeSeries.getValueAtIndex(1), 0.001d);
  }

  @Test
  public void test_remove_101_removeRange() {
    ObjectId oid = ObjectId.of("DbHts", "DP101");
    UniqueId uniqueId = _htsMaster.removeTimeSeriesDataPoints(oid, LocalDate.of(2010, 7, 3), LocalDate.of(2011, 1, 2));
   
    ManageableHistoricalTimeSeries testCorrected = _htsMaster.getTimeSeries(uniqueId);
    assertEquals(uniqueId, testCorrected.getUniqueId());
    LocalDateDoubleTimeSeries timeSeries = testCorrected.getTimeSeries();
View Full Code Here

    assertEquals(3.33d, timeSeries.getValueAtIndex(0), 0.001d);
  }

  @Test
  public void test_remove_101_removeRangeWithNullEnd() {
    ObjectId oid = ObjectId.of("DbHts", "DP101");
    UniqueId uniqueId = _htsMaster.removeTimeSeriesDataPoints(oid, LocalDate.of(2011, 1, 2), null);
   
    ManageableHistoricalTimeSeries testCorrected = _htsMaster.getTimeSeries(uniqueId);
    assertEquals(uniqueId, testCorrected.getUniqueId());
    LocalDateDoubleTimeSeries timeSeries = testCorrected.getTimeSeries();
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.