org.onebusaway.transit_data_federation.testing
Class UnitTestingSupport

java.lang.Object
  extended by org.onebusaway.transit_data_federation.testing.UnitTestingSupport

public class UnitTestingSupport
extends Object


Constructor Summary
UnitTestingSupport()
           
 
Method Summary
static void addDates(org.onebusaway.gtfs.model.calendar.CalendarServiceData data, String sid, Date... dates)
           
static void addServiceDates(org.onebusaway.gtfs.model.calendar.CalendarServiceData data, String sid, org.onebusaway.gtfs.model.calendar.ServiceDate... serviceDates)
           
static StopTimeEntryImpl addStopTime(TripEntryImpl trip, StopTimeEntryImpl stopTime)
           
static void addTransfer(StopEntryImpl from, StopEntryImpl to)
           
static AgencyEntryImpl agency(String id)
          Entity Factory Methods
static org.onebusaway.gtfs.model.AgencyAndId aid(String id)
           
static BlockEntryImpl block(String id)
           
static BlockConfigurationEntry blockConfiguration(BlockEntry block, ServiceIdActivation serviceIds, TripEntry... trips)
           
static BlockStopTimeEntryImpl blockStopTime(StopTimeEntry stopTime, int blockSequence, BlockTripEntry trip)
           
static BlockTripEntryImpl blockTrip(BlockConfigurationEntry blockConfig, TripEntry trip)
           
static List<BlockTripIndex> blockTripIndices(BlockEntryImpl... blocks)
           
static Date date(String source)
           
static long dateAsLong(String source)
           
static BlockConfigurationEntry findBlockConfig(BlockEntry blockEntry, ServiceIdActivation serviceIds)
           
static String format(Date dateA)
           
static FrequencyEntry frequency(int startTime, int endTime, int headwaySecs)
           
static Date getTimeAsDay(Date t)
           
static Date getTimeAsDay(long t)
           
static int hourToSec(double hour)
           
static BlockConfigurationEntry linkBlockTrips(BlockEntryImpl block, List<FrequencyEntry> frequencies, TripEntryImpl... trips)
           
static BlockConfigurationEntry linkBlockTrips(BlockEntryImpl block, TripEntryImpl... trips)
           
static BlockConfigurationEntry linkBlockTrips(String blockId, TripEntryImpl... trips)
           
static org.onebusaway.gtfs.model.calendar.LocalizedServiceId lsid(String id)
           
static List<org.onebusaway.gtfs.model.calendar.LocalizedServiceId> lsids(String... ids)
           
static RouteEntryImpl route(String id)
           
static RouteCollectionEntryImpl routeCollection(String id, RouteEntry... routes)
           
static ServiceIdActivation serviceIds(List<org.onebusaway.gtfs.model.calendar.LocalizedServiceId> activeServiceIds, List<org.onebusaway.gtfs.model.calendar.LocalizedServiceId> inactiveServiceIds)
           
static ServiceIdActivation serviceIds(String... ids)
           
static org.onebusaway.gtfs.model.ShapePoint shapePoint(String id, int sequence, double lat, double lon)
           
static ShapePoints shapePoints(String id, double[] lats, double[] lons, double[] distTraveled)
           
static ShapePoints shapePointsFromLatLons(String id, double... values)
           
static StopEntryImpl stop(String id, double lat, double lon)
           
static StopTimeEntryImpl stopTime(int id, StopEntryImpl stop, TripEntryImpl trip, int time, double shapeDistTraveled)
           
static StopTimeEntryImpl stopTime(int id, StopEntryImpl stop, TripEntryImpl trip, int arrivalTime, int departureTime, double shapeDistTraveled)
           
static StopTimeEntryImpl stopTime(int id, StopEntryImpl stop, TripEntryImpl trip, int arrivalTime, int departureTime, double shapeDistTraveled, int shapeIndex)
           
static int time(int hour, int minute)
           
static int time(int hour, int minute, int seconds)
           
static TimeZone timeZone()
          Time and Date Methods
static TripEntryImpl trip(String id)
           
static TripEntryImpl trip(String id, double totalTripDistance)
           
static TripEntryImpl trip(String id, String serviceId)
           
static TripEntryImpl trip(String id, String serviceId, double totalTripDistance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnitTestingSupport

public UnitTestingSupport()
Method Detail

timeZone

public static TimeZone timeZone()
Time and Date Methods


date

public static Date date(String source)
Parameters:
source - format is "yyyy-MM-dd HH:mm"
Returns:

dateAsLong

public static long dateAsLong(String source)

format

public static String format(Date dateA)

getTimeAsDay

public static Date getTimeAsDay(Date t)

getTimeAsDay

public static Date getTimeAsDay(long t)

hourToSec

public static final int hourToSec(double hour)

time

public static int time(int hour,
                       int minute,
                       int seconds)

time

public static int time(int hour,
                       int minute)

agency

public static AgencyEntryImpl agency(String id)
Entity Factory Methods


route

public static RouteEntryImpl route(String id)

routeCollection

public static RouteCollectionEntryImpl routeCollection(String id,
                                                       RouteEntry... routes)

stop

public static StopEntryImpl stop(String id,
                                 double lat,
                                 double lon)

addTransfer

public static void addTransfer(StopEntryImpl from,
                               StopEntryImpl to)

block

public static BlockEntryImpl block(String id)

trip

public static TripEntryImpl trip(String id)

trip

public static TripEntryImpl trip(String id,
                                 String serviceId)

trip

public static TripEntryImpl trip(String id,
                                 String serviceId,
                                 double totalTripDistance)

trip

public static TripEntryImpl trip(String id,
                                 double totalTripDistance)

frequency

public static FrequencyEntry frequency(int startTime,
                                       int endTime,
                                       int headwaySecs)

linkBlockTrips

public static BlockConfigurationEntry linkBlockTrips(BlockEntryImpl block,
                                                     TripEntryImpl... trips)

linkBlockTrips

public static BlockConfigurationEntry linkBlockTrips(BlockEntryImpl block,
                                                     List<FrequencyEntry> frequencies,
                                                     TripEntryImpl... trips)

linkBlockTrips

public static BlockConfigurationEntry linkBlockTrips(String blockId,
                                                     TripEntryImpl... trips)

findBlockConfig

public static BlockConfigurationEntry findBlockConfig(BlockEntry blockEntry,
                                                      ServiceIdActivation serviceIds)

blockTripIndices

public static List<BlockTripIndex> blockTripIndices(BlockEntryImpl... blocks)

addStopTime

public static StopTimeEntryImpl addStopTime(TripEntryImpl trip,
                                            StopTimeEntryImpl stopTime)

stopTime

public static StopTimeEntryImpl stopTime(int id,
                                         StopEntryImpl stop,
                                         TripEntryImpl trip,
                                         int arrivalTime,
                                         int departureTime,
                                         double shapeDistTraveled)

stopTime

public static StopTimeEntryImpl stopTime(int id,
                                         StopEntryImpl stop,
                                         TripEntryImpl trip,
                                         int arrivalTime,
                                         int departureTime,
                                         double shapeDistTraveled,
                                         int shapeIndex)

stopTime

public static StopTimeEntryImpl stopTime(int id,
                                         StopEntryImpl stop,
                                         TripEntryImpl trip,
                                         int time,
                                         double shapeDistTraveled)

blockConfiguration

public static BlockConfigurationEntry blockConfiguration(BlockEntry block,
                                                         ServiceIdActivation serviceIds,
                                                         TripEntry... trips)

blockTrip

public static BlockTripEntryImpl blockTrip(BlockConfigurationEntry blockConfig,
                                           TripEntry trip)

blockStopTime

public static BlockStopTimeEntryImpl blockStopTime(StopTimeEntry stopTime,
                                                   int blockSequence,
                                                   BlockTripEntry trip)

lsid

public static org.onebusaway.gtfs.model.calendar.LocalizedServiceId lsid(String id)

lsids

public static List<org.onebusaway.gtfs.model.calendar.LocalizedServiceId> lsids(String... ids)

serviceIds

public static ServiceIdActivation serviceIds(String... ids)

serviceIds

public static ServiceIdActivation serviceIds(List<org.onebusaway.gtfs.model.calendar.LocalizedServiceId> activeServiceIds,
                                             List<org.onebusaway.gtfs.model.calendar.LocalizedServiceId> inactiveServiceIds)

aid

public static org.onebusaway.gtfs.model.AgencyAndId aid(String id)

shapePointsFromLatLons

public static ShapePoints shapePointsFromLatLons(String id,
                                                 double... values)

shapePoints

public static ShapePoints shapePoints(String id,
                                      double[] lats,
                                      double[] lons,
                                      double[] distTraveled)

shapePoint

public static org.onebusaway.gtfs.model.ShapePoint shapePoint(String id,
                                                              int sequence,
                                                              double lat,
                                                              double lon)

addServiceDates

public static void addServiceDates(org.onebusaway.gtfs.model.calendar.CalendarServiceData data,
                                   String sid,
                                   org.onebusaway.gtfs.model.calendar.ServiceDate... serviceDates)

addDates

public static void addDates(org.onebusaway.gtfs.model.calendar.CalendarServiceData data,
                            String sid,
                            Date... dates)


Copyright © 2011 OneBusAway. All Rights Reserved.