Examples of FederatedServiceCollection


Examples of org.onebusaway.federations.FederatedServiceCollection

 
  @Test
  public void testSimple() throws Exception {

    SimpleFederatedService mockService = Mockito.mock(SimpleFederatedService.class);
    FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
    Mockito.when(mockCollection.getServiceForLocation(0.0,1.0)).thenReturn(mockService);
   
    Method method = SimpleFederatedService.class.getDeclaredMethod("getValueForLocation", Double.TYPE,Double.TYPE);
    Object[] args = {0.0,1.0};

    FederatedServiceMethodInvocationHandler handler = new FederatedByLocationMethodInvocationHandlerImpl(0,1);
View Full Code Here

Examples of org.onebusaway.federations.FederatedServiceCollection

  public void test01() throws Exception {
   
    CoordinateBounds bounds = new CoordinateBounds(0,1,2,3);

    SimpleFederatedService mockService = Mockito.mock(SimpleFederatedService.class);
    FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
    Mockito.when(mockCollection.getServiceForBounds(bounds)).thenReturn(mockService);
   
    Method method = SimpleFederatedService.class.getDeclaredMethod("getValueForCoordinateBounds", CoordinateBounds.class);
    Object[] args = {bounds};

    FederatedServiceMethodInvocationHandler handler = new FederatedByCoordinateBoundsMethodInvocationHandlerImpl(method,0,"");
View Full Code Here

Examples of org.onebusaway.federations.FederatedServiceCollection

    CoordinateBounds bounds = new CoordinateBounds(0,1,2,3);
    CoordinateBoundsTestBean bean = new CoordinateBoundsTestBean();
    bean.setBounds(bounds);
   
    SimpleFederatedService mockService = Mockito.mock(SimpleFederatedService.class);
    FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
    Mockito.when(mockCollection.getServiceForBounds(bounds)).thenReturn(mockService);
   
    Method method = SimpleFederatedService.class.getDeclaredMethod("getValueForCoordinateBoundsTestBean", CoordinateBoundsTestBean.class);
    Object[] args = {bean};

    FederatedServiceMethodInvocationHandler handler = new FederatedByCoordinateBoundsMethodInvocationHandlerImpl(method,0,"bounds");
View Full Code Here

Examples of org.onebusaway.federations.FederatedServiceCollection

  @Test
  public void testSimple() throws Exception {

    SimpleFederatedService mockService = Mockito.mock(SimpleFederatedService.class);
    FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
    Mockito.when(mockCollection.getServiceForAgencyId("agency")).thenReturn(
        mockService);

    Method method = SimpleFederatedService.class.getDeclaredMethod(
        "getValueForId", String.class);
    Object[] args = {"agency_entity"};
View Full Code Here

Examples of org.onebusaway.federations.FederatedServiceCollection

  @Test
  public void testArgumentIndex() throws Exception {

    SimpleFederatedService mockService = Mockito.mock(SimpleFederatedService.class);
    FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
    Mockito.when(mockCollection.getServiceForAgencyId("agency")).thenReturn(
        mockService);

    Method method = SimpleFederatedService.class.getDeclaredMethod(
        "getValueForValueAndId", String.class, String.class);
    Object[] args = {"value", "agency_entity"};
View Full Code Here

Examples of org.onebusaway.federations.FederatedServiceCollection

  @Test
  public void testPropertyExpression() throws Exception {

    SimpleFederatedService mockService = Mockito.mock(SimpleFederatedService.class);
    FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
    Mockito.when(mockCollection.getServiceForAgencyId("agency")).thenReturn(
        mockService);

    Method method = SimpleFederatedService.class.getDeclaredMethod(
        "getValueForValueBean", EntityIdTestBean.class);
View Full Code Here

Examples of org.onebusaway.federations.FederatedServiceCollection

    Set<String> ids = new HashSet<String>();
    ids.add("agency_entity");

    SimpleFederatedService mockService = Mockito.mock(SimpleFederatedService.class);
    FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
    Mockito.when(mockCollection.getServiceForAgencyIds(agencyIds)).thenReturn(mockService);

    Method method = SimpleFederatedService.class.getDeclaredMethod("getValueForIds", Set.class);
    Object[] args = {ids};

    FederatedServiceMethodInvocationHandler handler = new FederatedByEntityIdsMethodInvocationHandlerImpl(0);
View Full Code Here

Examples of org.onebusaway.federations.FederatedServiceCollection

    Set<String> ids = new HashSet<String>();
    ids.add("agency_entity");

    SimpleFederatedService mockService = Mockito.mock(SimpleFederatedService.class);
    FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
    Mockito.when(mockCollection.getServiceForAgencyIds(agencyIds)).thenReturn(mockService);

    Method method = SimpleFederatedService.class.getDeclaredMethod("getValueForValueAndIds", String.class, Set.class);
    Object[] args = {"value",ids};

    FederatedServiceMethodInvocationHandler handler = new FederatedByEntityIdsMethodInvocationHandlerImpl(1);
View Full Code Here

Examples of org.onebusaway.federations.FederatedServiceCollection

   
    Set<FederatedService> services = new HashSet<FederatedService>();
    services.add(mockServiceA);
    services.add(mockServiceB);
   
    FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
    Mockito.when(mockCollection.getAllServices()).thenReturn(services);

    Method method = SimpleFederatedService.class.getDeclaredMethod("getValuesAsList");

    FederatedServiceMethodInvocationHandler handler = new FederatedByAggregateMethodInvocationHandlerImpl(EMethodAggregationType.LIST);
    List<String> results = (List<String>) handler.invoke(mockCollection, method, new Object[] {});
View Full Code Here

Examples of org.onebusaway.federations.FederatedServiceCollection

   
    Set<FederatedService> services = new HashSet<FederatedService>();
    services.add(mockServiceA);
    services.add(mockServiceB);
   
    FederatedServiceCollection mockCollection = Mockito.mock(FederatedServiceCollectionImpl.class);
    Mockito.when(mockCollection.getAllServices()).thenReturn(services);

    Method method = SimpleFederatedService.class.getDeclaredMethod("getValuesAsMap");

    FederatedServiceMethodInvocationHandler handler = new FederatedByAggregateMethodInvocationHandlerImpl(EMethodAggregationType.MAP);
    Map<String,String> results = (Map<String,String>) handler.invoke(mockCollection, method, new Object[] {});
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.