Examples of Trip


Examples of at.fhj.itm.model.Trip

   * Tries to delete a non persisted trip which should throw an
   * DAOException
   */
  @Test(expected=DAOException.class)
  public void deleteNonPersisted(){
    Trip t = createTestTrip();
    dao.delete(t, connection);
  }
View Full Code Here

Examples of at.fhj.itm.model.Trip

    Waypoint ba = new Waypoint(b, a, u, "", true);
    Waypoint bc = new Waypoint(b, c, v, "", true);
    Waypoint ac = new Waypoint(a, c, v, "", true);
    Waypoint cd = new Waypoint(c, d, v, "", true);

    Trip trip0 = new Trip(v, new Date(), 5, ab, "");
    Trip trip1 = new Trip(v, new Date(), 4, bc, "");
    Trip trip2 = new Trip(v, new Date(), 4, ac, "");
    Trip trip3 = new Trip(v, new Date(), 5, cd, "");
    Trip trip4 = new Trip(u, new Date(), 5, ba, "");
    mockTrips = Arrays.asList(trip0, trip1, trip2, trip3, trip4);
    mockUser = u;
   
  }
View Full Code Here

Examples of at.fhj.itm.model.Trip

      Location toLocation, Location... stops) throws ServiceException {

    User user = jsfUtil.getLoggedInUser();
    if (user == null)
      throw new UnauthorizedAccessException("No user logged in!");
    Trip newTrip;
    try {
      begin();
      List<Waypoint> stopovers = null;

      if (stops.length > 0) {

        stopovers = new ArrayList<Waypoint>();
        for (Location l : stops) {

          stopovers.add(new Waypoint(fromLocation, l, user, null,
              true));

          stopovers
              .add(new Waypoint(l, toLocation, user, null, true));
        }
      }
      Waypoint waypoint = new Waypoint(fromLocation, toLocation, user,
          null, true);
      newTrip = new Trip(user, departure, seats, waypoint, "");

      // insert the trip to DAO
      getTripDAO().update(newTrip, getConnection());

      if (stopovers != null) {
View Full Code Here

Examples of com.avaje.tests.model.basic.Trip

      address1.setLine1(line1);
      address1.setLine2(line2);
      address1.setCity(city);
      Ebean.save(address1);

      Trip trip = new Trip();
      trip.setVehicleDriver(driver);
      trip.setAddress(address1);
      trip.setCretime(new Timestamp(new Date().getTime()));
      Ebean.save(trip);
    }

    Ebean.beginTransaction();
View Full Code Here

Examples of com.cychop.til.enums.Trip

   *             if the structure of the file seems inappropriate.
   */
  public static Duration fromCita(String line) throws DataValueException,
      DataStructureException {
    // Declaring the variables
    Trip trip;
    short duration = 0;

    // initializing the trip
    // the trip ID is contained at beginning of line, between "&" and "A"
    try {
View Full Code Here

Examples of it.cdq.model.Trip

    }

    for (Option option : optionsList) {
      for (Trip tripDate : tripDates) {
        if (option.isCandidate()) {
          Trip trip = new Trip();
          trip.setDepartureDate(tripDate.getDepartureDate());
          trip.setArrivalDate(tripDate.getArrivalDate());
          trip.setDestination(option.getDestination());
          trip.setDestinationLabel(option.getDestinationLabel());
          trip.setOperator(option.getOperator());
          trip.setOrigin(option.getOrigin());
          trip.setOriginLabel(option.getOriginLabel());
          trips.add(trip);
        }
      }
    }
    logger.info(" Trips size [" + trips.size() + "]");
View Full Code Here

Examples of it.cdq.model.Trip

  private static void addTrip(List<Trip> list, Calendar calendar, int i) {
    Calendar clone = (Calendar) calendar.clone();
    clone.add(Calendar.DAY_OF_YEAR, i);
    Date departureDate = calendar.getTime();
    Date arrivalDate = clone.getTime();
    Trip trip = new Trip();
    trip.setDepartureDate(departureDate);
    trip.setArrivalDate(arrivalDate);
    list.add(trip);

  }
View Full Code Here

Examples of it.cdq.model.db.Trip

      baseurl = getBaseurl();

      start(baseurl);

      while (true) {
        Trip trip = service.getNextElement(getOperator());

        if (trip == null)
          break;// continue:

        if (existElement(trip)) {
View Full Code Here

Examples of it.cdq.model.db.Trip

    airportRepository.add(a);

    Flight f = new Flight();
    flightRepository.add(f);

    Trip t = new Trip();
    tripRepository.add(t);

    Assert.assertTrue(airportRepository.list().size() == 1);
    Assert.assertTrue(flightRepository.list().size() == 1);
    Assert.assertTrue(tripRepository.list().size() == 1);

    f.setDestination(a);
    f.setOrigin(a);
    f.setDate(new Date());
    t.setArrival(f);
    t.setDeparture(f);
    tripRepository.add(t);

    Assert.assertTrue(tripRepository.list().size() == 1);
  }
View Full Code Here

Examples of it.cdq.model.db.Trip

  @Transactional
  public void takeTripTest() {
    List<Trip> list = new ArrayList<Trip>();

    for (int i = 0; i < ITERATION; i++) {
      Trip trip = new Trip();
      trip.setArrival(mockFight("a", "b", i));
      trip.setDeparture(mockFight("b", "a", i));
      trip.setCreationTripDate(new Date());
      list.add(trip);
    }

    for (Trip trip : list)
      tripRepository.takeTrip(trip);
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.