Package at.fhj.itm.model

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


    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

      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

TOP

Related Classes of at.fhj.itm.model.Trip

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.