Package com.opengamma.master.historicaltimeseries

Examples of com.opengamma.master.historicaltimeseries.ManageableHistoricalTimeSeriesInfo


    assertEquals(uniqueId, test.getUniqueId());
    assertEquals(_version2Instant, test.getVersionFromInstant());
    assertEquals(null, test.getVersionToInstant());
    assertEquals(_version2Instant, test.getCorrectionFromInstant());
    assertEquals(_version3Instant, test.getCorrectionToInstant());
    ManageableHistoricalTimeSeriesInfo info = test.getInfo();
    assertNotNull(info);
    assertEquals(uniqueId, info.getUniqueId());
    assertEquals("N202", info.getName());
    assertEquals("DF11", info.getDataField());
    assertEquals("DS21", info.getDataSource());
    assertEquals("DP31", info.getDataProvider());
    assertEquals("OT42", info.getObservationTime());
    ExternalIdBundleWithDates key = info.getExternalIdBundle();
    assertNotNull(key);
    assertEquals(2, key.size());
    assertEquals(true, key.getExternalIds().contains(
        ExternalIdWithDates.of(ExternalId.of("TICKER", "V505"), null, null)));
    assertEquals(true, key.getExternalIds().contains(
View Full Code Here


    assertEquals(uniqueId, test.getUniqueId());
    assertEquals(_version2Instant, test.getVersionFromInstant());
    assertEquals(null, test.getVersionToInstant());
    assertEquals(_version3Instant, test.getCorrectionFromInstant());
    assertEquals(null, test.getCorrectionToInstant());
    ManageableHistoricalTimeSeriesInfo info = test.getInfo();
    assertNotNull(info);
    assertEquals(uniqueId, info.getUniqueId());
    assertEquals("N203", info.getName());
    assertEquals("DF11", info.getDataField());
    assertEquals("DS21", info.getDataSource());
    assertEquals("DP31", info.getDataProvider());
    assertEquals("OT42", info.getObservationTime());
    ExternalIdBundleWithDates key = info.getExternalIdBundle();
    assertNotNull(key);
    assertEquals(2, key.size());
    assertEquals(true, key.getExternalIds().contains(
        ExternalIdWithDates.of(ExternalId.of("TICKER", "V505"), null, null)));
    assertEquals(true, key.getExternalIds().contains(
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test
  public void testAddHistoricalTimeSeries() {
    final ManageableHistoricalTimeSeriesInfo target = new ManageableHistoricalTimeSeriesInfo();
    target.setDataField("DF");
    target.setDataProvider("DP");
    target.setDataSource("DS");
    final HistoricalTimeSeriesInfoDocument request = new HistoricalTimeSeriesInfoDocument(target);
   
    final HistoricalTimeSeriesInfoDocument result = new HistoricalTimeSeriesInfoDocument(target);
    result.setUniqueId(UID);
    when(_underlying.add(same(request))).thenReturn(result);
View Full Code Here

  public void getHistoricalTimeSeriesByExternalIdWithoutMetaData() throws Exception {
    ManageableHistoricalTimeSeries hts = new ManageableHistoricalTimeSeries();
    hts.setUniqueId(UID);
    hts.setTimeSeries(randomTimeSeries());
    when(_mockMaster.getTimeSeries(UID, HistoricalTimeSeriesGetFilter.ofRange(null, null))).thenReturn(hts);
    ManageableHistoricalTimeSeriesInfo tsInfo = new ManageableHistoricalTimeSeriesInfo();
    tsInfo.setUniqueId(UID);
    when(_mockResolver.resolve(IDENTIFIERS, LocalDate.now(), null, null, CLOSE_DATA_FIELD, TEST_CONFIG)).thenReturn(new HistoricalTimeSeriesResolutionResult(tsInfo));
   
    HistoricalTimeSeries test = _tsSource.getHistoricalTimeSeries(CLOSE_DATA_FIELD, IDENTIFIERS, TEST_CONFIG);
    verify(_mockMaster, times(1)).getTimeSeries(UID, HistoricalTimeSeriesGetFilter.ofRange(null, null));
   
View Full Code Here

  public void testResolve() {
    final MockResolver mock = new MockResolver();
    final HistoricalTimeSeriesResolver client = mockConnection(mock);
    mock.setIdentifierBundle(ExternalId.of("Test", "Foo").toBundle());
    mock.setDataField("PX_LAST");
    mock.setResult(new HistoricalTimeSeriesResolutionResult(new ManageableHistoricalTimeSeriesInfo()));
    assertNotNull(client.resolve(ExternalId.of("Test", "Foo").toBundle(), null, null, null, "PX_LAST", null), null);
  }
View Full Code Here

    final MockResolver mock = new MockResolver();
    final HistoricalTimeSeriesResolver client = mockConnection(mock);
    mock.setIdentifierBundle(ExternalId.of("Test", "Foo").toBundle());
    mock.setIdentifierValidityDate(now);
    mock.setDataField("PX_LAST");
    mock.setResult(new HistoricalTimeSeriesResolutionResult(new ManageableHistoricalTimeSeriesInfo()));
    assertNotNull(client.resolve(ExternalId.of("Test", "Foo").toBundle(), now, null, null, "PX_LAST", null), null);
  }
View Full Code Here

    final HistoricalTimeSeriesResolver client = mockConnection(mock);
    mock.setIdentifierBundle(ExternalId.of("Test", "Foo").toBundle());
    mock.setDataSource("datasource");
    mock.setDataProvider("dataprovider");
    mock.setDataField("PX_LAST");
    mock.setResult(new HistoricalTimeSeriesResolutionResult(new ManageableHistoricalTimeSeriesInfo()));
    assertNotNull(client.resolve(ExternalId.of("Test", "Foo").toBundle(), null, "datasource", "dataprovider", "PX_LAST", null), null);
  }
View Full Code Here

    final MockResolver mock = new MockResolver();
    final HistoricalTimeSeriesResolver client = mockConnection(mock);
    mock.setIdentifierBundle(ExternalId.of("Test", "Foo").toBundle());
    mock.setDataField("PX_LAST");
    mock.setResolutionKey("resolutionkey");
    mock.setResult(new HistoricalTimeSeriesResolutionResult(new ManageableHistoricalTimeSeriesInfo()));
    assertNotNull(client.resolve(ExternalId.of("Test", "Foo").toBundle(), null, null, null, "PX_LAST", "resolutionkey"), null);
  }
View Full Code Here

    resolver.setIdentifierBundle(ExternalIdBundle.of(ExternalId.of("Test1", "Foo"), ExternalId.of("Test2", "Foo")));
    resolver.setDataField("PX_LAST");
    final MockAdjuster adjuster = new MockAdjuster();
    adjuster.setIdentifierBundle(ExternalIdBundle.of(ExternalId.of("Test1", "Foo"), ExternalId.of("Test2", "Foo")));
    adjuster.setResult(new HistoricalTimeSeriesAdjustment.DivideBy(100d));
    resolver.setResult(new HistoricalTimeSeriesResolutionResult(new ManageableHistoricalTimeSeriesInfo(), adjuster));
    final HistoricalTimeSeriesResolutionResult result = client.resolve(ExternalIdBundle.of(ExternalId.of("Test1", "Foo"), ExternalId.of("Test2", "Foo")), null, null, null, "PX_LAST", null);
    assertNotNull(result);
    adjuster.setIdentifierBundle(ExternalIdBundle.of(ExternalId.of("Test1", "Foo")));
    adjuster.setResult(HistoricalTimeSeriesAdjustment.NoOp.INSTANCE);
    HistoricalTimeSeriesAdjustment adjustment = result.getAdjuster().getAdjustment(ExternalIdBundle.of(ExternalId.of("Test1", "Foo"), ExternalId.of("Test2", "Foo")));
View Full Code Here

  @BeforeMethod
  public void setUp() {
    testEmpty = new InMemoryHistoricalTimeSeriesMaster(new ObjectIdSupplier("Test"));
    testPopulated = new InMemoryHistoricalTimeSeriesMaster(new ObjectIdSupplier("Test"));
    info1 = new ManageableHistoricalTimeSeriesInfo();
    info1.setName("Name1");
    info1.setDataField("DF1");
    info1.setDataSource("DS1");
    info1.setDataProvider("DP1");
    info1.setObservationTime("OT1");
    info1.setExternalIdBundle(ExternalIdBundleWithDates.of(BUNDLE1));
    doc1 = new HistoricalTimeSeriesInfoDocument();
    doc1.setInfo(info1);
    doc1 = testPopulated.add(doc1);
    info2 = new ManageableHistoricalTimeSeriesInfo();
    info2.setName("Name2");
    info2.setDataField("DF2");
    info2.setDataSource("DS2");
    info2.setDataProvider("DP2");
    info2.setObservationTime("OT2");
View Full Code Here

TOP

Related Classes of com.opengamma.master.historicaltimeseries.ManageableHistoricalTimeSeriesInfo

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.