Package com.opengamma.master.exchange

Examples of com.opengamma.master.exchange.ExchangeMaster.search()


   */
  private void storeExchange(final ManageableExchange exchange) {
    final ExchangeMaster master = getToolContext().getExchangeMaster();
    final ExchangeSearchRequest request = new ExchangeSearchRequest();
    request.setName(exchange.getName());
    final ExchangeSearchResult result = master.search(request);
    if (result.getFirstDocument() != null) {
      //System.out.println("Updating " + exchange.getName());
      final ExchangeDocument document = result.getFirstDocument();
      document.setExchange(exchange);
      master.update(document);
View Full Code Here


    request.setVersionCorrection(VC);
   
    ExchangeSearchResult result = new ExchangeSearchResult();
    result.getDocuments().add(new ExchangeDocument(example()));
   
    when(mock.search(request)).thenReturn(result);
    MasterExchangeSource test = new MasterExchangeSource(mock, VC);
    Exchange testResult = test.getSingle(ID);
    verify(mock, times(1)).search(request);
   
    assertEquals(example(), testResult);
View Full Code Here

    request.setPagingRequest(PagingRequest.ONE);
    request.setVersionCorrection(VC);
   
    ExchangeSearchResult result = new ExchangeSearchResult();
   
    when(mock.search(request)).thenReturn(result);
    MasterExchangeSource test = new MasterExchangeSource(mock, VC);
    Exchange testResult = test.getSingle(ID);
    verify(mock, times(1)).search(request);
   
    assertEquals(null, testResult);
View Full Code Here

    request.setVersionCorrection(VC);
   
    ExchangeSearchResult result = new ExchangeSearchResult();
    result.getDocuments().add(new ExchangeDocument(example()));
   
    when(mock.search(request)).thenReturn(result);
    MasterExchangeSource test = new MasterExchangeSource(mock, VC);
    Exchange testResult = test.getSingle(BUNDLE);
    verify(mock, times(1)).search(request);
   
    assertEquals(example(), testResult);
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.