Examples of StructuredMarketDataSnapshot


Examples of com.opengamma.core.marketdatasnapshot.StructuredMarketDataSnapshot

  }

  //-------------------------------------------------------------------------
  @Test
  public void testGetSnapshotByUid() {
    final StructuredMarketDataSnapshot target = new ManageableMarketDataSnapshot();
   
    when(_underlying.get(eq(UID))).thenReturn(target);
   
    Response test = _resource.get(OID.toString(), UID.getVersion());
    assertEquals(Status.OK.getStatusCode(), test.getStatus());
View Full Code Here

Examples of com.opengamma.core.marketdatasnapshot.StructuredMarketDataSnapshot

  @Path("snapshots/{snapshotId}")
  public Response get(
      @PathParam("snapshotId") String idStr,
      @QueryParam("version") String version) {
    final ObjectId objectId = ObjectId.parse(idStr);
    final StructuredMarketDataSnapshot result = getMarketDataSnapshotSource().get(objectId.atVersion(version));
    return responseOkFudge(result);
  }
View Full Code Here

Examples of com.opengamma.core.marketdatasnapshot.StructuredMarketDataSnapshot

   
    if (viewDefinitions.size() > 1) {
      endWithError("Multiple view definitions resolved when searching for string '%s': %s", viewDefinitionName, viewDefinitions);
    }
    ConfigItem<?> value = Iterables.get(viewDefinitions, 0).getValue();
    StructuredMarketDataSnapshot snapshot = makeSnapshot(marketDataSnapshotter, viewProcessor, (ViewDefinition) value.getValue(), viewExecutionOptions);
   
    final ManageableMarketDataSnapshot manageableMarketDataSnapshot = new ManageableMarketDataSnapshot(snapshot);
    manageableMarketDataSnapshot.setName(snapshot.getBasisViewName() + "/" + valuationInstant);
    marketDataSnapshotMaster.add(new MarketDataSnapshotDocument(manageableMarketDataSnapshot));
  }
View Full Code Here

Examples of com.opengamma.core.marketdatasnapshot.StructuredMarketDataSnapshot

    EngineResourceReference<? extends ViewCycle> cycleReference = client.createCycleReference(viewCycleId);
    if (cycleReference == null) {
      throw new IllegalArgumentException("Cycle is not available");
    }
    try {
      StructuredMarketDataSnapshot result = _snapshotter.createSnapshot(client, cycleReference.get());
      return responseOkFudge(result);
    } finally {
      cycleReference.release();
    }
  }
View Full Code Here

Examples of com.opengamma.core.marketdatasnapshot.StructuredMarketDataSnapshot

    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

Examples of com.opengamma.core.marketdatasnapshot.StructuredMarketDataSnapshot

    if (snapshot != null) {
      return snapshot;
    }
    synchronized (_initSnapshotLock) {
      if (_snapshot == null) {
        StructuredMarketDataSnapshot structuredSnapshot = getSnapshotSource().get(getSnapshotId());
        snapshot = new UserMarketDataSnapshot(structuredSnapshot);
        snapshot.init();
        _snapshot = snapshot;
      }
      return _snapshot;
View Full Code Here

Examples of com.opengamma.core.marketdatasnapshot.StructuredMarketDataSnapshot

    values.putValue(testValueId, MarketDataRequirementNames.MARKET_VALUE, new ValueSnapshot(marketValue));
    return values;
  }

  private UserMarketDataSnapshot createSnapshot() {
    final StructuredMarketDataSnapshot snapshot = mock(StructuredMarketDataSnapshot.class);
    final UniqueId snapshotId = UniqueId.of("TestSnapshot", "1");
    final ExternalId testValueId = ExternalId.of("TestScheme", "Value1");
    when(snapshot.getUniqueId()).thenReturn(snapshotId);
    when(snapshot.getGlobalValues()).thenReturn(generateUnstructured(testValueId, 234d));
    final UserMarketDataSnapshot userSnapshot = new UserMarketDataSnapshot(snapshot);
    userSnapshot.init();
    final YieldCurveSnapshot yieldCurveSnapshot = mock(YieldCurveSnapshot.class);
    when(yieldCurveSnapshot.getValues()).thenReturn(generateUnstructured(testValueId, 123d));
    final Map<YieldCurveKey, YieldCurveSnapshot> yieldCurveMap = ImmutableMap.of(new YieldCurveKey(Currency.USD, "testCurve"), yieldCurveSnapshot);
    when(snapshot.getYieldCurves()).thenReturn(yieldCurveMap);
    return userSnapshot;
  }
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.