Package com.opengamma.engine.marketdata.manipulator

Examples of com.opengamma.engine.marketdata.manipulator.MarketDataSelector


    _marketDataSpecRepo = marketDataSpecificationRepository;
    List<MarketDataSpecification> requestedMarketDataSpecs = viewRequest.getMarketDataSpecs();
    List<MarketDataSpecification> actualMarketDataSpecs = fixMarketDataSpecs(requestedMarketDataSpecs);

    // TODO - At this point we need to pick up a shift specification from the UI - for now we'll add the NoOp
    MarketDataSelector marketDataSelector = NoOpMarketDataSelector.getInstance();

    ViewCycleExecutionOptions defaultOptions =
        ViewCycleExecutionOptions
            .builder()
            .setValuationTime(viewRequest.getValuationTime())
View Full Code Here


  /** if no criteria are specified the selector should match any curve */
  @Test
  public void noCriteria() {
    YieldCurveSelector.Builder curve = new YieldCurveSelector.Builder(SCENARIO);
    MarketDataSelector selector = curve.getSelector();
    assertEquals(selector, selector.findMatchingSelector(structureId("curveName1"), CALC_CONFIG_NAME, _resolver));
    assertEquals(selector, selector.findMatchingSelector(structureId("curveName2"), CALC_CONFIG_NAME, _resolver));
  }
View Full Code Here

  public void singleName() {
    String curveName = "curveName";
    String calcConfigName = "calcConfigName";
    YieldCurveSelector.Builder curve = new YieldCurveSelector.Builder(SCENARIO);
    curve.named(curveName);
    MarketDataSelector selector = curve.getSelector();
    assertEquals(selector, selector.findMatchingSelector(structureId(curveName), calcConfigName, _resolver));
    assertNull(selector.findMatchingSelector(structureId("otherName"), calcConfigName, _resolver));
  }
View Full Code Here

  public void multipleNames() {
    String curveName1 = "curveName1";
    String curveName2 = "curveName2";
    YieldCurveSelector.Builder curve = new YieldCurveSelector.Builder(SCENARIO);
    curve.named(curveName1, curveName2);
    MarketDataSelector selector = curve.getSelector();
    assertEquals(selector, selector.findMatchingSelector(structureId(curveName1), CALC_CONFIG_NAME, _resolver));
    assertEquals(selector, selector.findMatchingSelector(structureId(curveName2), CALC_CONFIG_NAME, _resolver));
    assertNull(selector.findMatchingSelector(structureId("otherName"), CALC_CONFIG_NAME, _resolver));
  }
View Full Code Here

  /** don't match if the calc config name doesn't match */
  @Test
  public void calcConfigName() {
    YieldCurveSelector.Builder curve = new YieldCurveSelector.Builder(new Scenario("foo").calculationConfigurations(CALC_CONFIG_NAME));
    MarketDataSelector selector = curve.getSelector();
    assertNull(selector.findMatchingSelector(structureId("curveName"), "otherCalcConfigName", _resolver));
  }
View Full Code Here

  public void nameMatches() {
    String curve3M = "curve3M";
    String curve6M = "curve6M";
    YieldCurveSelector.Builder curve = new YieldCurveSelector.Builder(SCENARIO);
    curve.nameMatches(".*3M");
    MarketDataSelector selector = curve.getSelector();
    assertEquals(selector, selector.findMatchingSelector(structureId(curve3M), CALC_CONFIG_NAME, _resolver));
    assertNull(selector.findMatchingSelector(structureId(curve6M), CALC_CONFIG_NAME, _resolver));
  }
View Full Code Here

    String curve3M = "curve3M";
    String curve6M = "curve6M";

    YieldCurveSelector.Builder curve1 = new YieldCurveSelector.Builder(SCENARIO);
    curve1.nameLike("*3M");
    MarketDataSelector selector1 = curve1.getSelector();
    assertEquals(selector1, selector1.findMatchingSelector(structureId(curve3M), CALC_CONFIG_NAME, _resolver));
    assertNull(selector1.findMatchingSelector(structureId(curve6M), CALC_CONFIG_NAME, _resolver));

    YieldCurveSelector.Builder curve2 = new YieldCurveSelector.Builder(SCENARIO);
    curve2.nameLike("curve?M");
    MarketDataSelector selector2 = curve2.getSelector();
    assertEquals(selector2, selector2.findMatchingSelector(structureId(curve3M), CALC_CONFIG_NAME, _resolver));
    assertEquals(selector2, selector2.findMatchingSelector(structureId(curve6M), CALC_CONFIG_NAME, _resolver));
  }
View Full Code Here

  /** match if the curve currency is specified */
  @Test
  public void singleCurrency() {
    YieldCurveSelector.Builder curve = new YieldCurveSelector.Builder(SCENARIO);
    curve.currencies("GBP");
    MarketDataSelector selector = curve.getSelector();
    String curveName = "curveName";
    StructureIdentifier structure1 = StructureIdentifier.of(new YieldCurveKey(Currency.GBP, curveName));
    StructureIdentifier structure2 = StructureIdentifier.of(new YieldCurveKey(Currency.USD, curveName));
    assertEquals(selector, selector.findMatchingSelector(structure1, CALC_CONFIG_NAME, _resolver));
    assertNull(selector.findMatchingSelector(structure2, CALC_CONFIG_NAME, _resolver));
  }
View Full Code Here

  /** match if the curve currency matches any of the specified currency codes */
  @Test
  public void multipleCurrencies() {
    YieldCurveSelector.Builder curve = new YieldCurveSelector.Builder(SCENARIO);
    curve.currencies("GBP", "USD");
    MarketDataSelector selector = curve.getSelector();
    String curveName = "curveName";
    StructureIdentifier structure1 = StructureIdentifier.of(new YieldCurveKey(Currency.GBP, curveName));
    StructureIdentifier structure2 = StructureIdentifier.of(new YieldCurveKey(Currency.USD, curveName));
    StructureIdentifier structure3 = StructureIdentifier.of(new YieldCurveKey(Currency.AUD, curveName));
    assertEquals(selector, selector.findMatchingSelector(structure1, CALC_CONFIG_NAME, _resolver));
    assertEquals(selector, selector.findMatchingSelector(structure2, CALC_CONFIG_NAME, _resolver));
    assertNull(selector.findMatchingSelector(structure3, CALC_CONFIG_NAME, _resolver));
  }
View Full Code Here

    YieldCurveSelector.Builder curve = new YieldCurveSelector.Builder(SCENARIO);
    String curveName1 = "curveName1";
    String curveName2 = "curveName2";
    String curveName3 = "curveName3";
    curve.named(curveName1, curveName2).currencies("USD", "GBP");
    MarketDataSelector selector = curve.getSelector();
    StructureIdentifier structure1 = StructureIdentifier.of(new YieldCurveKey(Currency.GBP, curveName1));
    StructureIdentifier structure2 = StructureIdentifier.of(new YieldCurveKey(Currency.USD, curveName2));
    StructureIdentifier structure3 = StructureIdentifier.of(new YieldCurveKey(Currency.AUD, curveName1));
    StructureIdentifier structure4 = StructureIdentifier.of(new YieldCurveKey(Currency.USD, curveName3));
    assertEquals(selector, selector.findMatchingSelector(structure1, CALC_CONFIG_NAME, _resolver));
    assertEquals(selector, selector.findMatchingSelector(structure2, CALC_CONFIG_NAME, _resolver));
    assertNull(selector.findMatchingSelector(structure3, CALC_CONFIG_NAME, _resolver));
    assertNull(selector.findMatchingSelector(structure4, CALC_CONFIG_NAME, _resolver));
  }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.marketdata.manipulator.MarketDataSelector

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.