Package org.onebusaway.transit_data_federation.services.service_alerts.ServiceAlerts

Examples of org.onebusaway.transit_data_federation.services.service_alerts.ServiceAlerts.TimeRange


    Builder timeRangeBuilder = TimeRange.newBuilder();
    if (start != 0)
      timeRangeBuilder.setStart(start);
    if (end != 0)
      timeRangeBuilder.setEnd(end);
    TimeRange timeRange = timeRangeBuilder.build();
    return timeRange;
  }
View Full Code Here


     * Verify that the conversion of the ServiceAlertBean into a
     * ServiceAlert.Builder looks right
     */
    builder = captor.getValue();
    assertEquals(1, builder.getActiveWindowCount());
    TimeRange range = builder.getActiveWindow(0);
    assertEquals(30L, range.getStart());
    assertEquals(40L, range.getEnd());
    assertEquals(1, builder.getAffectsCount());
    Affects affects = builder.getAffects(0);
    assertEquals("1", affects.getAgencyId());
    assertEquals("key", affects.getApplicationId());
    assertEquals("0", affects.getDirectionId());
    assertEquals("route", affects.getRouteId().getId());
    assertEquals("trip", affects.getTripId().getId());
    assertEquals("stop", affects.getStopId().getId());
    assertEquals(Cause.ACCIDENT, builder.getCause());
    assertEquals(1, builder.getConsequenceCount());
    Consequence consequence = builder.getConsequence(0);
    assertEquals(Effect.DETOUR, consequence.getEffect());
    assertEquals("path", consequence.getDetourPath());
    assertEquals(1, consequence.getDetourStopIdsCount());
    assertEquals("stop", consequence.getDetourStopIds(0).getId());
    assertEquals(5, builder.getCreationTime());
    assertTrue(builder.hasDescription());
    TranslatedString descs = builder.getDescription();
    assertEquals(1, descs.getTranslationCount());
    Translation desc = descs.getTranslation(0);
    assertEquals("en", desc.getLanguage());
    assertEquals("description", desc.getText());
    assertEquals("ignore_this", builder.getId().getId());
    assertEquals(1, builder.getPublicationWindowCount());
    range = builder.getPublicationWindow(0);
    assertEquals(20L, range.getStart());
    assertEquals(40L, range.getEnd());
    assertEquals(Severity.VERY_SEVERE, builder.getSeverity());
    TranslatedString summaries = builder.getSummary();
    assertEquals(1, summaries.getTranslationCount());
    Translation summary = summaries.getTranslation(0);
    assertEquals("en", summary.getLanguage());
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.services.service_alerts.ServiceAlerts.TimeRange

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.