Package com.opengamma.core.region

Examples of com.opengamma.core.region.Region


    }

    @Override
    public Region getHighestLevelRegion(final ExternalId externalId) {
      _count.getAndIncrement();
      Region result = null;
      if (_testRegion.getExternalIdBundle().contains(externalId)) {
        result = _testRegion;
      }
      return result;
    }
View Full Code Here


    }

    @Override
    public Region get(final ObjectId objectId, final VersionCorrection versionCorrection) {
      _count.getAndIncrement();
      Region result = null;
      if (_testRegion.getUniqueId().getObjectId().equals(objectId) && versionCorrection.equals(VersionCorrection.LATEST)) {
        result = _testRegion;
      }
      return result;
    }
View Full Code Here

    }

    @Override
    public Region get(final UniqueId uniqueId) {
      _count.getAndIncrement();
      Region result = null;
      if (_testRegion.getUniqueId().equals(uniqueId)) {
        result = _testRegion;
      }
      return result;
    }
View Full Code Here

    }

    @Override
    public Region getHighestLevelRegion(final ExternalIdBundle bundle) {
      _count.getAndIncrement();
      Region result = null;
      if (_testRegion.getExternalIdBundle().equals(bundle)) {
        result = _testRegion;
      }
      return result;
    }
View Full Code Here

    }

    @Override
    public Region getHighestLevelRegion(final ExternalId externalId) {
      _count.getAndIncrement();
      Region result = null;
      if (_testRegion.getExternalIdBundle().contains(externalId)) {
        result = _testRegion;
      }
      return result;
    }
View Full Code Here

    RegionMaster mock = mock(RegionMaster.class);
   
    RegionDocument doc = new RegionDocument(example());
    when(mock.get(UID)).thenReturn(doc);
    MasterRegionSource test = new MasterRegionSource(mock);
    Region testResult = test.get(UID);
    verify(mock, times(1)).get(UID);
   
    assertEquals(example(), testResult);
  }
View Full Code Here

    RegionMaster mock = mock(RegionMaster.class);
   
    RegionDocument doc = new RegionDocument(example());
    when(mock.get(OID, VC)).thenReturn(doc);
    MasterRegionSource test = new MasterRegionSource(mock, VC);
    Region testResult = test.get(UID);
    verify(mock, times(1)).get(OID, VC);
   
    assertEquals(example(), testResult);
  }
View Full Code Here

    RegionMaster mock = mock(RegionMaster.class);
   
    RegionDocument doc = new RegionDocument(example());
    when(mock.get(OID, VC)).thenReturn(doc);
    MasterRegionSource test = new MasterRegionSource(mock, VC);
    Region testResult = test.get(OID, VC);
    verify(mock, times(1)).get(OID, VC);
   
    assertEquals(example(), testResult);
  }
View Full Code Here

    RegionSearchResult result = new RegionSearchResult();
    result.getDocuments().add(new RegionDocument(example()));
   
    when(mock.search(request)).thenReturn(result);
    MasterRegionSource test = new MasterRegionSource(mock, VC);
    Region testResult = test.getHighestLevelRegion(ID);
    verify(mock, times(1)).search(request);
   
    assertEquals(example(), testResult);
  }
View Full Code Here

   
    RegionSearchResult result = new RegionSearchResult();
   
    when(mock.search(request)).thenReturn(result);
    MasterRegionSource test = new MasterRegionSource(mock, VC);
    Region testResult = test.getHighestLevelRegion(ID);
    verify(mock, times(1)).search(request);
   
    assertEquals(null, testResult);
  }
View Full Code Here

TOP

Related Classes of com.opengamma.core.region.Region

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.