Package com.opengamma.master.security

Examples of com.opengamma.master.security.SecurityMaster


    assertEquals(example(), testResult);
  }

  @Test(expectedExceptions = DataNotFoundException.class)
  public void test_getSecurity_ObjectId_notFound() throws Exception {
    SecurityMaster mock = mock(SecurityMaster.class);
   
    when(mock.get(OID, VC)).thenThrow(new DataNotFoundException(""));
    MasterSecuritySource test = new MasterSecuritySource(mock, VC);
    try {
      test.get(OID, VC);
    } finally {
      verify(mock, times(1)).get(OID, VC);
View Full Code Here


    }
  }

  //-------------------------------------------------------------------------
  public void test_getSecuritiesByExternalIdBundle() throws Exception {
    SecurityMaster mock = mock(SecurityMaster.class);
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalId(ID1);
    request.addExternalId(ID2);
    request.setVersionCorrection(VC);
    ManageableSecurity security = example();
    SecuritySearchResult result = new SecuritySearchResult();
    result.getDocuments().add(new SecurityDocument(security));
   
    when(mock.search(request)).thenReturn(result);
    MasterSecuritySource test = new MasterSecuritySource(mock, VC);
    Collection<Security> testResult = test.get(BUNDLE);
    verify(mock, times(1)).search(request);
   
    assertEquals(UID, testResult.iterator().next().getUniqueId());
View Full Code Here

    assertEquals("Test", testResult.iterator().next().getName());
  }

  //-------------------------------------------------------------------------
  public void test_getSecurity_ExternalId() throws Exception {
    SecurityMaster mock = mock(SecurityMaster.class);
    SecuritySearchRequest request = new SecuritySearchRequest();
    request.addExternalId(ID1);
    request.addExternalId(ID2);
    request.setVersionCorrection(VC);
    ManageableSecurity security = example();
    SecuritySearchResult result = new SecuritySearchResult();
    result.getDocuments().add(new SecurityDocument(security));
   
    when(mock.search(request)).thenReturn(result);
    MasterSecuritySource test = new MasterSecuritySource(mock, VC);
    Security testResult = test.getSingle(BUNDLE);
    verify(mock, times(1)).search(request);
   
    assertEquals(UID, testResult.getUniqueId());
View Full Code Here

  public void testCsvToMastersToCsv() throws Exception {
   
    PortfolioCopier portfolioCopier = new SimplePortfolioCopier();

    PositionMaster positionMaster = new InMemoryPositionMaster();
    SecurityMaster securityMaster = new InMemorySecurityMaster();
    SecuritySource securitySource = new MasterSecuritySource(securityMaster);
   
    // Set up mock portfolio master
    PortfolioMaster portfolioMaster = mock(PortfolioMaster.class);
    PortfolioSearchRequest portSearchRequest = new PortfolioSearchRequest();
View Full Code Here

TOP

Related Classes of com.opengamma.master.security.SecurityMaster

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.