Examples of waitUntilEnoughUpdatesReceived()


Examples of com.opengamma.livedata.test.CollectingLiveDataListener.waitUntilEnoughUpdatesReceived()

  @Test(groups = {"bbgSubscriptionTests" }, enabled = false)
  public void testSubscribeLimit() throws Exception {
    _server.setSubscriptionLimit(0);
    CollectingLiveDataListener listener = new CollectingLiveDataListener(1, 0);
    subscribe(_liveDataClient, listener, "AAPL US Equity");
    assertTrue(listener.waitUntilEnoughUpdatesReceived(1000));
    Thread.sleep(100000);
    for (LiveDataSubscriptionResponse response : listener.getSubscriptionResponses()) {
      assertEquals(response.getSubscriptionResult(), LiveDataSubscriptionResult.INTERNAL_ERROR);
      assertTrue(response.getUserMessage().toLowerCase().contains("limit"));
    }
View Full Code Here

Examples of com.opengamma.livedata.test.CollectingLiveDataListener.waitUntilEnoughUpdatesReceived()

    subscribe(_liveDataClient, listener, "USSW5 Curncy");
    subscribe(_liveDataClient, listener, "AAPL US Equity");
    subscribe(_liveDataClient, listener, "GBP Curncy");
   
    assertTrue(listener.waitUntilEnoughUpdatesReceived(30000));
   
    for (LiveDataValueUpdate update : listener.getValueUpdates()) {
      assertEquals(1, update.getSpecification().getIdentifiers().size());
      assertNotNull(update.getSpecification().getIdentifier(ExternalSchemes.BLOOMBERG_BUID));
      assertNotNull(StandardRules.getOpenGammaRuleSetId(), update.getSpecification().getNormalizationRuleSetId());
View Full Code Here

Examples of com.opengamma.livedata.test.CollectingLiveDataListener.waitUntilEnoughUpdatesReceived()

      subscribe(_liveDataClient, listener, instruments);
      unsubscribe(_liveDataClient, listener, instruments);
      _unitTestingProvider.rejectAllfurtherRequests();
    }
   
    assertTrue(listener.waitUntilEnoughUpdatesReceived(30000));
   
    LiveDataSubscriptionResponse workingSub = null;
    LiveDataSubscriptionResponse workingStrongSub = null;
    for (LiveDataSubscriptionResponse response : listener.getSubscriptionResponses()) {
      if (response.getRequestedSpecification().getIdentifiers().contains(working)) {
View Full Code Here

Examples of com.opengamma.livedata.test.CollectingLiveDataListener.waitUntilEnoughUpdatesReceived()

   
    List<ExternalId> instruments = Lists.newArrayList(strong);
    CollectingLiveDataListener listener = new CollectingLiveDataListener(instruments.size(), 3);
   
    subscribe(_liveDataClient, listener, instruments);
    assertTrue(listener.waitUntilEnoughUpdatesReceived(60000));
    unsubscribe(_liveDataClient, listener, instruments);
    for (LiveDataSubscriptionResponse response : listener.getSubscriptionResponses()) {
      if (response.getRequestedSpecification().getIdentifiers().contains(strong)) {
        assertEquals(response.getSubscriptionResult(), LiveDataSubscriptionResult.SUCCESS);
      }
View Full Code Here

Examples of com.opengamma.livedata.test.CollectingLiveDataListener.waitUntilEnoughUpdatesReceived()

   
    List<ExternalId> instruments = Lists.newArrayList(strong, weak);
    CollectingLiveDataListener listener = new CollectingLiveDataListener(instruments.size(), 3);
   
    subscribe(_liveDataClient, listener, instruments);
    assertTrue(listener.waitUntilEnoughUpdatesReceived(30000));
    unsubscribe(_liveDataClient, listener, instruments);
   
    LiveDataSubscriptionResponse strongSub = null;
    LiveDataSubscriptionResponse weakSub = null;
    for (LiveDataSubscriptionResponse response : listener.getSubscriptionResponses()) {
View Full Code Here

Examples of com.opengamma.livedata.test.CollectingLiveDataListener.waitUntilEnoughUpdatesReceived()

   
    List<ExternalId> instruments = Lists.newArrayList(broken, working);
    CollectingLiveDataListener listener = new CollectingLiveDataListener(instruments.size(), 3);
   
    subscribe(_liveDataClient, listener, instruments);
    assertTrue(listener.waitUntilEnoughUpdatesReceived(30000));
    unsubscribe(_liveDataClient, listener, instruments);
   
    LiveDataSubscriptionResponse strongSub = null;
    LiveDataSubscriptionResponse weakSub = null;
    for (LiveDataSubscriptionResponse response : listener.getSubscriptionResponses()) {
View Full Code Here

Examples of com.opengamma.livedata.test.CollectingLiveDataListener.waitUntilEnoughUpdatesReceived()

    subscribe(_liveDataClient, listener, instruments);
   
    assertEquals(1, combinedSubs.get());
    assertEquals(combinedSubs.get(), fakeSubs.get());
    assertEquals(0, realSubs.get());
    assertTrue(listener.waitUntilEnoughUpdatesReceived(30000));
    for (int i = 0; i < 3; i++) {
      expirationManager.extendPublicationTimeout(ImmutableSet.of(getLiveDataSpec(_liveDataClient, weak)));
      Thread.sleep(period / 2);
    }
    assertEquals(1, combinedSubs.get());
View Full Code Here

Examples of com.opengamma.livedata.test.CollectingLiveDataListener.waitUntilEnoughUpdatesReceived()

    List<ExternalId> instruments = Lists.newArrayList(broken, working, workingWeak, workingStrong);
    for (int i = 0; i < 10; i++) {
      CollectingLiveDataListener listener = new CollectingLiveDataListener(instruments.size(), 3);

      subscribe(_liveDataClient, listener, instruments);
      assertTrue(listener.waitUntilEnoughUpdatesReceived(30000));
      unsubscribe(_liveDataClient, listener, instruments);
      _unitTestingProvider.rejectAllfurtherRequests();
    }
    assertFalse(_unitTestingProvider.hadToRejectRequests());
  }
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.