Package com.opengamma.engine.marketdata

Examples of com.opengamma.engine.marketdata.MarketDataProvider


    }

    @Override
    public MarketDataProvider resolve(final UserPrincipal user, final MarketDataSpecification snapshotSpec) {
      final String dataSourceName = ((LiveMarketDataSpecification) snapshotSpec).getDataSource();
      final MarketDataProvider provider = _providers.get(dataSourceName);
      if (provider == null) {
        throw new IllegalArgumentException("Unknown data source name - " + dataSourceName);
      }
      return provider;
    }
View Full Code Here


    stub(factory2.create(_user)).toReturn(_provider2);
  }

  @Test
  public void createDefault() {
    MarketDataProvider provider = _factory.create(_user, new LiveMarketDataSpecification(null));
    assertEquals(_defaultProvider, provider);
  }
View Full Code Here

    assertEquals(_defaultProvider, provider);
  }

  @Test
  public void createNamed() {
    MarketDataProvider provider1 = _factory.create(_user, new LiveMarketDataSpecification("1"));
    assertEquals(provider1, _provider1);
    MarketDataProvider provider2 = _factory.create(_user, new LiveMarketDataSpecification("2"));
    assertEquals(provider2, _provider2);
  }
View Full Code Here

  @Test
  public void testWaitForMarketData() throws InterruptedException {
    final ViewProcessorTestEnvironment env = new ViewProcessorTestEnvironment();
    final InMemoryLKVMarketDataProvider underlyingProvider = new InMemoryLKVMarketDataProvider();
    final MarketDataProvider marketDataProvider = new TestLiveMarketDataProvider("source", underlyingProvider);
    env.setMarketDataProvider(marketDataProvider);
    env.init();

    final ViewProcessorImpl vp = env.getViewProcessor();
    vp.start();
View Full Code Here

  public void testSkipCycleOnNoMarketData() throws InterruptedException {
    final ViewProcessorTestEnvironment env = new ViewProcessorTestEnvironment();
    final InMemoryLKVMarketDataProvider underlyingProvider = new InMemoryLKVMarketDataProvider();
    underlyingProvider.addValue(ViewProcessorTestEnvironment.getPrimitive1(), 123d);
    underlyingProvider.addValue(ViewProcessorTestEnvironment.getPrimitive2(), 456d);
    final MarketDataProvider marketDataProvider = new TestLiveMarketDataProvider("source", underlyingProvider);
    env.setMarketDataProvider(marketDataProvider);
    env.init();

    final ViewProcessorImpl vp = env.getViewProcessor();
    vp.start();
View Full Code Here

  @Test
  public void testDoNotWaitForMarketData() throws InterruptedException {
    final ViewProcessorTestEnvironment env = new ViewProcessorTestEnvironment();
    final InMemoryLKVMarketDataProvider underlyingProvider = new InMemoryLKVMarketDataProvider();
    final MarketDataProvider marketDataProvider = new TestLiveMarketDataProvider("source", underlyingProvider);
    env.setMarketDataProvider(marketDataProvider);
    env.init();

    final ViewProcessorImpl vp = env.getViewProcessor();
    vp.start();
View Full Code Here

  }

  @Test
  public void testChangeMarketDataProviderBetweenCycles() throws InterruptedException {
    final ViewProcessorTestEnvironment env = new ViewProcessorTestEnvironment();
    final MarketDataProvider provider1 = new TestLiveMarketDataProvider(SOURCE_1_NAME, new InMemoryLKVMarketDataProvider());
    final MarketDataProvider provider2 = new TestLiveMarketDataProvider(SOURCE_2_NAME, new InMemoryLKVMarketDataProvider());
    final MarketDataProvider provider3 = new TestLiveMarketDataProvider(SOURCE_3_NAME, new InMemoryLKVMarketDataProvider(), new FixedMarketDataAvailabilityProvider());
    env.setMarketDataProviderResolver(new MockMarketDataProviderResolver(SOURCE_1_NAME, provider1, SOURCE_2_NAME, provider2, SOURCE_3_NAME, provider3));
    env.init();
    final ViewProcessorImpl vp = env.getViewProcessor();
    vp.start();
    final ViewClient client = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);
View Full Code Here

  }

  @Test
  public void testChangeMarketDataProviderBetweenCyclesWithCycleFragmentCompletedCalls() throws InterruptedException {
    final ViewProcessorTestEnvironment env = new ViewProcessorTestEnvironment();
    final MarketDataProvider provider1 = new TestLiveMarketDataProvider(SOURCE_1_NAME, new InMemoryLKVMarketDataProvider());
    final MarketDataProvider provider2 = new TestLiveMarketDataProvider(SOURCE_2_NAME, new InMemoryLKVMarketDataProvider());
    final MarketDataProvider provider3 = new TestLiveMarketDataProvider(SOURCE_3_NAME, new InMemoryLKVMarketDataProvider(), new FixedMarketDataAvailabilityProvider());
    env.setMarketDataProviderResolver(new MockMarketDataProviderResolver(SOURCE_1_NAME, provider1, SOURCE_2_NAME, provider2, SOURCE_3_NAME, provider3));
    env.init();
    final ViewProcessorImpl vp = env.getViewProcessor();
    vp.start();
    final ViewClient client = vp.createViewClient(ViewProcessorTestEnvironment.TEST_USER);
View Full Code Here

TOP

Related Classes of com.opengamma.engine.marketdata.MarketDataProvider

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.