Package com.opengamma.livedata

Examples of com.opengamma.livedata.LiveDataSpecification


  }

  public void simpleDistribution() {
    ValueDistributor distributor = new ValueDistributor();
    CollectingLiveDataListener listener1 = new CollectingLiveDataListener();
    LiveDataSpecification spec1 = new LiveDataSpecification("foo", ExternalId.of("bar", "baz"));
   
    distributor.addListener(spec1, listener1);
   
    long sequenceNumber = 12345;
    distributor.notifyListeners(new LiveDataValueUpdateBean(sequenceNumber, spec1, _fudgeContext.newMessage()));
View Full Code Here


public class SubscriptionHandleTest {

  private final UserPrincipal _user = new UserPrincipal("kirk", "127.0.0.1");

  public void equalsDifferentRequestedSpecification() {
    LiveDataSpecification requestedSpecification =
      new LiveDataSpecification(
          "NormalizationId1",
          ExternalId.of("Domain1", "Value1"));
    CollectingLiveDataListener listener = new CollectingLiveDataListener();
    SubscriptionHandle handle1 = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, requestedSpecification, listener);
    SubscriptionHandle handle2 = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, requestedSpecification,  listener);
View Full Code Here

    SubscriptionHandle handle2 = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, requestedSpecification,  listener);
    assertFalse(handle1.equals(handle2));
  }

  public void hashCodeDifferentRequestedSpecification() {
    LiveDataSpecification requestedSpecification =
      new LiveDataSpecification(
          "NormalizationId1",
          ExternalId.of("Domain1", "Value1"));
    CollectingLiveDataListener listener = new CollectingLiveDataListener();
    SubscriptionHandle handle1 = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, requestedSpecification, listener);
    SubscriptionHandle handle2 = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, requestedSpecification, listener);
View Full Code Here

    SubscriptionHandle handle2 = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, requestedSpecification, listener);
    assertFalse(handle1.hashCode() == handle2.hashCode());
  }

  public void releaseTicks() {
    LiveDataSpecification spec =
      new LiveDataSpecification(
          "NormalizationId1",
          ExternalId.of("Domain1", "Value1"));
    CollectingLiveDataListener listener = new CollectingLiveDataListener();
    SubscriptionHandle handle = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, spec, listener);
   
View Full Code Here

    assertEquals(501, listener.getValueUpdates().get(0).getSequenceNumber());
    assertEquals(502, listener.getValueUpdates().get(1).getSequenceNumber());
  }

  public void releaseTicksServerRestart() {
    LiveDataSpecification spec =
      new LiveDataSpecification(
          "NormalizationId1",
          ExternalId.of("Domain1", "Value1"));
    CollectingLiveDataListener listener = new CollectingLiveDataListener();
    SubscriptionHandle handle = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, spec, listener);
   
View Full Code Here

    assertEquals(0, listener.getValueUpdates().get(0).getSequenceNumber());
    assertEquals(1, listener.getValueUpdates().get(1).getSequenceNumber());
  }

  public void releaseTicksMultipleServerRestarts() {
    LiveDataSpecification spec =
      new LiveDataSpecification(
          "NormalizationId1",
          ExternalId.of("Domain1", "Value1"));
    CollectingLiveDataListener listener = new CollectingLiveDataListener();
    SubscriptionHandle handle = new SubscriptionHandle(_user, SubscriptionType.NON_PERSISTENT, spec, listener);
   
View Full Code Here

    InMemoryByteArrayRequestConduit inMemoryByteArrayRequestConduit = new InMemoryByteArrayRequestConduit(fudgeRequestDispatcher);
    ByteArrayFudgeRequestSender fudgeRequestSender = new ByteArrayFudgeRequestSender(inMemoryByteArrayRequestConduit);
   
    DistributedSpecificationResolver client = new DistributedSpecificationResolver(fudgeRequestSender);
   
    LiveDataSpecification testSpec = new LiveDataSpecification("test1", ExternalId.of("test1", "test1"));
    LiveDataSpecification resolvedSpec = client.resolve(testSpec);
    assertEquals(resolvedSpec, testSpec);
  }
View Full Code Here

  }

  public void multipleSnapshots() {
    _server.start();
   
    LiveDataSpecification spec1 = new LiveDataSpecification(StandardRules.getNoNormalization().getId(),
        ExternalId.of(TEST_IDENTIFICATION_SCHEME, TEST_ID_1));
    LiveDataSpecification spec2 = new LiveDataSpecification(StandardRules.getNoNormalization().getId(),
        ExternalId.of(TEST_IDENTIFICATION_SCHEME, TEST_ID_2));
   
    Collection<LiveDataSubscriptionResponse> responses = _client.snapshot(TEST_USER, Sets.newHashSet(spec1, spec2), 1000);
    assertNotNull(responses);
    assertEquals(2, responses.size());
View Full Code Here

  }

  public void multipleSubscribes() {
    _server.start();
   
    LiveDataSpecification spec1 = new LiveDataSpecification(StandardRules.getNoNormalization().getId(),
        ExternalId.of(TEST_IDENTIFICATION_SCHEME, TEST_ID_1));
    LiveDataSpecification spec2 = new LiveDataSpecification(StandardRules.getNoNormalization().getId(),
        ExternalId.of(TEST_IDENTIFICATION_SCHEME, TEST_ID_2));
   
    CollectingLiveDataListener listener = new CollectingLiveDataListener();
   
    _client.subscribe(TEST_USER, Sets.newHashSet(spec1, spec2), listener);
View Full Code Here

    assertEquals(1, splitShouldFake.second.size());
  }
  private Collection<LiveDataSpecification> getSpecs(Collection<String> queries) {
    Set<LiveDataSpecification> specs = new HashSet<LiveDataSpecification>();
    for (String query : queries) {
      specs.add(new LiveDataSpecification("No Normalization", ExternalIdBundle.of(ExternalId.of(ExternalSchemes.BLOOMBERG_TICKER, query))));
    }
    return specs;
  }
View Full Code Here

TOP

Related Classes of com.opengamma.livedata.LiveDataSpecification

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.