Package com.opengamma.master.marketdatasnapshot

Examples of com.opengamma.master.marketdatasnapshot.MarketDataSnapshotMaster.search()


  private static MarketDataSnapshotListResource createResource(MarketDataSnapshotDocument... docs) {
    MarketDataSnapshotMaster snapshotMaster = mock(MarketDataSnapshotMaster.class);
    List<MarketDataSnapshotDocument> documents = Arrays.asList(docs);
    MarketDataSnapshotSearchResult result = new MarketDataSnapshotSearchResult(documents);
    when(snapshotMaster.search(any(MarketDataSnapshotSearchRequest.class))).thenReturn(result);
    return new MarketDataSnapshotListResource(snapshotMaster);
  }

  @Test
  public void getJson() throws JSONException {
View Full Code Here


      if (snapshotMaster == null) {
        throw new OpenGammaRuntimeException("MarketDataSnapshotMaster is missing from given Toolcontext");
      }
      MarketDataSnapshotSearchRequest request = new MarketDataSnapshotSearchRequest();
      request.setName(snapshotOption);
      MarketDataSnapshotSearchResult searchResult = snapshotMaster.search(request);
      if (searchResult.getDocuments().isEmpty()) {
        throw new OpenGammaRuntimeException("No matching snapshot for given name [" + marketDataOption + "]");
      }
      return new UserMarketDataSpecification(searchResult.getFirstDocument().getUniqueId());
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.