Package com.opengamma.engine.marketdata.spec

Examples of com.opengamma.engine.marketdata.spec.MarketDataSpecification


      List<MarketDataSpecification> specifications = defaultExecutionOptions.getMarketDataSpecifications();
      if (!specifications.isEmpty()) {
        specifications = new ArrayList<>(specifications);
        boolean changed = false;
        for (int i = 0; i < specifications.size(); i++) {
          final MarketDataSpecification specification = specifications.get(i);
          if (specification instanceof LiveMarketDataSpecification) {
            final String dataSource = ((LiveMarketDataSpecification) specification).getDataSource();
            if (dataSource != null && getNamedMarketDataSpecificationRepository() != null) {
              final MarketDataSpecification namedSpec = getNamedMarketDataSpecificationRepository().getSpecification(dataSource);
              if (namedSpec != null && !namedSpec.equals(specification)) {
                s_logger.info("Replacing live data {} with named spec {}", dataSource, namedSpec);
                specifications.set(i, namedSpec);
                changed = true;
              }
            }
View Full Code Here


    MarketDataSpecificationParser.parse("foo:bar");
  }

  @Test
  public void liveValid() {
    MarketDataSpecification spec = MarketDataSpecificationParser.parse("live:sourceName");
    assertEquals(new LiveMarketDataSpecification("sourceName"), spec);
  }
View Full Code Here

    MarketDataSpecificationParser.parse("live:");
  }

  @Test
  public void snapshotValid() {
    MarketDataSpecification spec = MarketDataSpecificationParser.parse("snapshot:scheme~value~version");
    assertEquals(new UserMarketDataSpecification(UniqueId.of("scheme", "value", "version")), spec);
  }
View Full Code Here

    MarketDataSpecificationParser.parse("snapshot:invalidIdFormat");
  }

  @Test
  public void fixedHistoricalValid() {
    MarketDataSpecification specNoRating = MarketDataSpecificationParser.parse("fixedhistorical:2011-03-08");
    LocalDate date = LocalDate.of(2011, 3, 8);
    assertEquals(new FixedHistoricalMarketDataSpecification(date), specNoRating);
    MarketDataSpecification specWithRating =
        MarketDataSpecificationParser.parse("fixedhistorical:2011-03-08,RATING_NAME");
    assertEquals(new FixedHistoricalMarketDataSpecification("RATING_NAME", date), specWithRating);
  }
View Full Code Here

    MarketDataSpecificationParser.parse("fixedhistorical:123456,RATING_NAME");
  }

  @Test
  public void latestHistoricalValid() {
    MarketDataSpecification specNoRating = MarketDataSpecificationParser.parse("latesthistorical");
    assertEquals(new LatestHistoricalMarketDataSpecification(), specNoRating);
    MarketDataSpecification specWithRating = MarketDataSpecificationParser.parse("latesthistorical:RATING_NAME");
    assertEquals(new LatestHistoricalMarketDataSpecification("RATING_NAME"), specWithRating);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.engine.marketdata.spec.MarketDataSpecification

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.