Package com.opengamma.master.position

Examples of com.opengamma.master.position.PositionSearchResult$Meta


  @Test
  public void test_search_positionProviderKey_found() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setPositionProviderId(ExternalId.of("A", "121"));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(1, test.getDocuments().size());
    assert121(test.getDocuments().get(0));
  }
View Full Code Here


  //-------------------------------------------------------------------------
  @Test
  public void test_search_tradeProviderKey_noMatch() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setTradeProviderId(ExternalId.of("B", "999"));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

  @Test
  public void test_search_tradeProviderKey_found() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setTradeProviderId(ExternalId.of("B", "401"));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(1, test.getDocuments().size());
    assert121(test.getDocuments().get(0));
  }
View Full Code Here

  //-------------------------------------------------------------------------
  @Test
  public void test_search_minQuantity_below() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setMinQuantity(BigDecimal.valueOf(50));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(6, test.getDocuments().size());
    assert100(test.getDocuments().get(0));
    assert120(test.getDocuments().get(1));
    assert121(test.getDocuments().get(2));
    assert122(test.getDocuments().get(3));
    assert123(test.getDocuments().get(4));
    assert222(test.getDocuments().get(5));
  }
View Full Code Here

  @Test
  public void test_search_minQuantity_mid() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setMinQuantity(BigDecimal.valueOf(150));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(1, test.getDocuments().size());
    assert222(test.getDocuments().get(0));
  }
View Full Code Here

  @Test
  public void test_search_minQuantity_above() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setMinQuantity(BigDecimal.valueOf(450));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

  //-------------------------------------------------------------------------
  @Test
  public void test_search_maxQuantity_below() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setMaxQuantity(BigDecimal.valueOf(50));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(0, test.getDocuments().size());
  }
View Full Code Here

  @Test
  public void test_search_maxQuantity_mid() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setMaxQuantity(BigDecimal.valueOf(150));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(5, test.getDocuments().size());
    assert100(test.getDocuments().get(0));
    assert120(test.getDocuments().get(1));
    assert121(test.getDocuments().get(2));
    assert122(test.getDocuments().get(3));
    assert123(test.getDocuments().get(4));
  }
View Full Code Here

  @Test
  public void test_search_maxQuantity_above() {
    PositionSearchRequest request = new PositionSearchRequest();
    request.setMaxQuantity(BigDecimal.valueOf(450));
    PositionSearchResult test = _posMaster.search(request);
   
    assertEquals(6, test.getDocuments().size());
    assert100(test.getDocuments().get(0));
    assert120(test.getDocuments().get(1));
    assert121(test.getDocuments().get(2));
    assert122(test.getDocuments().get(3));
    assert123(test.getDocuments().get(4));
    assert222(test.getDocuments().get(5));
  }
View Full Code Here

    return WebResourceTestUtils.loadJson("com/opengamma/web/position/tradesJson.txt").toString();
  }

  protected void assertPositionWithNoTrades() {
    final PositionSearchRequest request = new PositionSearchRequest();
    final PositionSearchResult searchResult = _positionMaster.search(request);
    assertNotNull(searchResult);
    final List<PositionDocument> docs = searchResult.getDocuments();
    assertNotNull(docs);
    assertEquals(1, docs.size());
    final ManageablePosition position = docs.get(0).getPosition();
    assertEquals(BigDecimal.TEN, position.getQuantity());
    assertEquals(SECURITY_LINK, position.getSecurityLink());
View Full Code Here

TOP

Related Classes of com.opengamma.master.position.PositionSearchResult$Meta

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.