Package com.opengamma.master.marketdatasnapshot

Examples of com.opengamma.master.marketdatasnapshot.MarketDataSnapshotMaster


    repo.registerComponent(infoSource, source);
    repo.getRestComponents().publish(infoSource, new DataSecuritySourceResource(source));
  }

  protected void initSnapshots(final ComponentRepository repo) {
    final MarketDataSnapshotMaster master = new InMemorySnapshotMaster();
    final MarketDataSnapshotSource source = new MasterSnapshotSource(master);

    final ComponentInfo infoMaster = new ComponentInfo(MarketDataSnapshotMaster.class, "test");
    repo.registerComponent(infoMaster, master);
    repo.getRestComponents().publish(infoMaster, new DataMarketDataSnapshotMasterResource(master));
View Full Code Here


  //-------------------------------------------------------------------------
  @Override
  public void init(ComponentRepository repo, LinkedHashMap<String, String> marketdatasnapshoturation) {

    MarketDataSnapshotMaster master = new EHCachingMarketDataSnapshotMaster(getClassifier(),
                                                      getUnderlying(),
                                                      getCacheManager());

    // register
    ComponentInfo info = new ComponentInfo(MarketDataSnapshotMaster.class, getClassifier());
View Full Code Here

    search(results, callback);
  }

  @Override
  public MarketDataSnapshotHistoryResult history(final MarketDataSnapshotHistoryRequest request) {
    final MarketDataSnapshotMaster master = getMasterByScheme(request.getObjectId().getScheme());
    if (master != null) {
      return master.history(request);
    }
    return (new Try<MarketDataSnapshotHistoryResult>() {
      @Override
      public MarketDataSnapshotHistoryResult tryMaster(final MarketDataSnapshotMaster master) {
        return master.history(request);
      }
    }).each(request.getObjectId().getScheme());
 
View Full Code Here

    new MasterSnapshotSource(null);
  }

  //-------------------------------------------------------------------------
  public void test_getSnapshot_noOverride_found() throws Exception {
    MarketDataSnapshotMaster mock = mock(MarketDataSnapshotMaster.class);

    MarketDataSnapshotDocument doc = new MarketDataSnapshotDocument(example());
    when(mock.get(UID)).thenReturn(doc);
    MasterSnapshotSource test = new MasterSnapshotSource(mock);
    StructuredMarketDataSnapshot testResult = test.get(UID);
    verify(mock, times(1)).get(UID);

    assertEquals(example(), testResult);
View Full Code Here

  }

  //-------------------------------------------------------------------------
  @Test(expectedExceptions = DataNotFoundException.class, expectedExceptionsMessageRegExp = "Some message")
  public void test_getSnapshot_noOverride_notFound() throws Exception {
    MarketDataSnapshotMaster mock = mock(MarketDataSnapshotMaster.class);
   
    new MarketDataSnapshotDocument(example());
    when(mock.get(UID)).thenThrow(new DataNotFoundException("Some message"));
    MasterSnapshotSource test = new MasterSnapshotSource(mock);
    test.get(UID);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.master.marketdatasnapshot.MarketDataSnapshotMaster

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.