Examples of BlockEntryImpl


Examples of org.onebusaway.transit_data_federation.impl.transit_graph.BlockEntryImpl

public class BlockLocationRecordCollectionTest {

  @Test
  public void test01() {

    BlockEntryImpl block = block("blockA");
    TripEntryImpl trip = trip("tripA", "serviceId");
    stopTime(0, null, trip, time(9, 00), 0);
    BlockConfigurationEntry blockConfig = linkBlockTrips(block, trip);
    BlockInstance blockInstance = new BlockInstance(blockConfig,
        System.currentTimeMillis());
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.BlockEntryImpl

    StopEntryImpl stopA = stop("a", 47.5, -122.5);
    StopEntryImpl stopB = stop("b", 47.6, -122.4);
    StopEntryImpl stopC = stop("c", 47.5, -122.3);

    BlockEntryImpl block = block("block");

    TripEntryImpl tripA = trip("tripA", "serviceId");
    TripEntryImpl tripB = trip("tripB", "serviceId");

    stopTime(0, stopA, tripA, 30, 90, 0);
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.BlockEntryImpl

    ServiceIdActivation ids_A_and_B = serviceIds(lsids("sidA", "sidB"), lsids());

    StopEntryImpl stopA = stop("stopA", 0.0, 0.0);
    StopEntryImpl stopB = stop("stopB", 0.0, 0.0);

    BlockEntryImpl blockA = block("blockA");
    TripEntryImpl tripA = trip("tripA", "sidA");
    TripEntryImpl tripB = trip("tripB", "sidB");

    stopTime(0, stopA, tripA, time(9, 00), time(9, 00), 0);
    stopTime(1, stopB, tripA, time(9, 30), time(9, 30), 100);
    stopTime(2, stopB, tripB, time(10, 00), time(10, 00), 200);
    stopTime(3, stopA, tripB, time(10, 30), time(10, 30), 300);

    linkBlockTrips(ids_A_not_B, blockA, tripA);
    linkBlockTrips(ids_A_and_B, blockA, tripA, tripB);
    linkBlockTrips(ids_B_not_A, blockA, tripB);

    BlockConfigurationEntry bcA_A_B = findBlockConfig(blockA, ids_A_not_B);
    BlockConfigurationEntry bcA_B_A = findBlockConfig(blockA, ids_B_not_A);
    BlockConfigurationEntry bcA_AB = findBlockConfig(blockA, ids_A_and_B);

    BlockEntryImpl blockB = block("blockB");
    TripEntryImpl tripC = trip("tripC", "sidA");
    TripEntryImpl tripD = trip("tripD", "sidB");
    TripEntryImpl tripE = trip("tripE", "sidA");

    stopTime(4, stopA, tripC, time(10, 00), time(10, 00), 0);
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.BlockEntryImpl

    ServiceIdActivation serviceIds = serviceIds(lsids("sA"), lsids("sB"));

    StopEntryImpl stopA = stop("stopA", 47.0, -122.0);
    StopEntryImpl stopB = stop("stopB", 47.1, -122.0);

    BlockEntryImpl block = block("blockA");

    TripEntryImpl tripA = trip("tripA", 1000);
    TripEntryImpl tripB = trip("tripB", 2000);
    TripEntryImpl tripC = trip("tripB", 1500);
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.BlockEntryImpl

  }

  @Test
  public void testSingleTripWithFrequencies() {

    BlockEntryImpl block = block("block");
    TripEntryImpl tripEntryA = trip("trip").setRoute(_routeEntry).setServiceId(
        _lsid).setBlock(block).setDirectionId("0");
    _graph.putTripEntry(tripEntryA);
    addStopTime(tripEntryA, stopTime().setStop(_stopA).setTime(time(7, 00)));

    BlockConfigurationEntry blockConfig = blockConfiguration(block,
        serviceIds("serviceId"), tripEntryA);

    Trip trip = new Trip();
    trip.setId(tripEntryA.getId());

    Frequency freqA = new Frequency();
    freqA.setTrip(trip);
    freqA.setStartTime(time(8, 00));
    freqA.setEndTime(time(10, 00));
    freqA.setHeadwaySecs(10 * 60);

    Frequency freqB = new Frequency();
    freqB.setTrip(trip);
    freqB.setStartTime(time(10, 00));
    freqB.setEndTime(time(12, 00));
    freqB.setHeadwaySecs(10 * 60);

    Mockito.when(_dao.getAllFrequencies()).thenReturn(
        Arrays.asList(freqA, freqB));

    _graph.initialize();

    _factory.processFrequencies(_graph);

    blockConfig = block.getConfigurations().get(0);

    List<FrequencyEntry> frequencies = blockConfig.getFrequencies();
    assertEquals(2, frequencies.size());
    FrequencyEntry frequency = frequencies.get(0);
    assertEquals(freqA.getStartTime(), frequency.getStartTime());
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.BlockEntryImpl

    _factory.processBlocks(_graph);

    List<BlockEntryImpl> blocks = _graph.getBlocks();
    assertEquals(2, blocks.size());

    BlockEntryImpl block = blocks.get(0);
    assertEquals(aid("blockB"), block.getId());
    assertSame(block, tripEntryC.getBlock());
    Mockito.verify(_blockConfigFactory).processBlockConfigurations(block,
        Arrays.asList(tripEntryC));

    block = blocks.get(1);
    assertEquals(aid("blockA"), block.getId());
    assertSame(block, tripEntryA.getBlock());
    assertSame(block, tripEntryB.getBlock());
    Mockito.verify(_blockConfigFactory).processBlockConfigurations(block,
        Arrays.asList(tripEntryA, tripEntryB));
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.BlockEntryImpl

    /****
     * Actual Test
     ****/

    BlockEntryImpl block = new BlockEntryImpl();
    List<TripEntryImpl> tripsInBlock = Arrays.asList(tripA, tripB, tripC, tripD);

    _factory.processBlockConfigurations(block, tripsInBlock);

    List<BlockConfigurationEntry> configurations = block.getConfigurations();
    assertEquals(3, configurations.size());

    /****
     * Order of the configurations matter. See
     * {@link BlockEntry#getConfigurations()} for details.
View Full Code Here

Examples of org.onebusaway.transit_data_federation.impl.transit_graph.BlockEntryImpl

public class BlockTripInstanceLibraryTest {

  @Test
  public void test() {
    BlockEntryImpl block = UnitTestingSupport.block("block");
    TripEntryImpl tripA = UnitTestingSupport.trip("tripA");
    TripEntryImpl tripB = UnitTestingSupport.trip("tripB");
    UnitTestingSupport.stopTime(0, null, tripA, 0, 0);
    UnitTestingSupport.stopTime(0, null, tripB, 0, 0);
    ServiceIdActivation serviceIds = UnitTestingSupport.serviceIds("sid");
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.