Package com.google.transit.realtime.GtfsRealtime

Examples of com.google.transit.realtime.GtfsRealtime.TimeRange


    {
      FeedEntity entity = feed.getEntity(0);
      assertEquals("1", entity.getId());
      Alert alert = entity.getAlert();
      assertEquals(1, alert.getActivePeriodCount());
      TimeRange range = alert.getActivePeriod(0);
      assertEquals(1234, range.getStart());
      assertEquals(5678, range.getEnd());
      assertEquals(2, alert.getInformedEntityCount());
      {
        EntitySelector affects = alert.getInformedEntity(0);
        assertEquals("1", affects.getAgencyId());
        assertEquals("r0", affects.getRouteId());
        assertEquals("t0", affects.getTrip().getTripId());
        assertEquals("s0", affects.getStopId());
      }
      {
        EntitySelector affects = alert.getInformedEntity(1);
        assertEquals("2", affects.getAgencyId());
      }
      TranslatedString header = alert.getHeaderText();
      assertEquals(2, header.getTranslationCount());
      {
        Translation translation = header.getTranslation(0);
        assertEquals("Name", translation.getText());
        assertEquals("en", translation.getLanguage());
      }
      {
        Translation translation = header.getTranslation(1);
        assertEquals("Nombre", translation.getText());
        assertEquals("es", translation.getLanguage());
      }
      TranslatedString description = alert.getDescriptionText();
      assertEquals(2, description.getTranslationCount());
      {
        Translation translation = description.getTranslation(0);
        assertEquals("Description", translation.getText());
        assertEquals("en", translation.getLanguage());
      }
      {
        Translation translation = description.getTranslation(1);
        assertEquals("Descripción", translation.getText());
        assertEquals("es", translation.getLanguage());
      }
    }
    {
      FeedEntity entity = feed.getEntity(1);
      assertEquals("2", entity.getId());
      Alert alert = entity.getAlert();
      assertEquals(1, alert.getActivePeriodCount());
      TimeRange range = alert.getActivePeriod(0);
      assertEquals(5678, range.getStart());
      assertEquals(1234, range.getEnd());
      assertEquals(1, alert.getInformedEntityCount());
      {
        EntitySelector affects = alert.getInformedEntity(0);
        assertEquals("2", affects.getAgencyId());
        assertEquals("r1", affects.getRouteId());
View Full Code Here

TOP

Related Classes of com.google.transit.realtime.GtfsRealtime.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.