Examples of Waypoint


Examples of at.fhj.itm.model.Waypoint

        return;
      }

      setSelectedTrip(this);

      Waypoint wp = getUserWaypoint();
      getTripService().bookWaypointForTrip(wp, trip);

      // update this
      tripsWaypoints.add(trip.getWaypoint());
View Full Code Here

Examples of at.fhj.itm.model.Waypoint

     */
    public Waypoint getUserWaypoint() {
      if (!isLoggedIn())
        return null;
      if (userWaypoint == null) {
        userWaypoint = new Waypoint(new Location(trip.getWaypoint()
            .getFromLocation()), new Location(trip.getWaypoint()
            .getToLocation()), getLoggedInUser(), "", false);
      }
      return userWaypoint;
    }
View Full Code Here

Examples of at.fhj.itm.model.Waypoint

    int userId = set.getInt("user_id");
    int waypoint = set.getInt("waypoint");
    String copyright = set.getString("copyright");

    User user = userDao.getByID(userId, connection);
    Waypoint wp = waypointDAO.getByID(waypoint, connection);

    return new Trip(id, user, departureDate, seats, wp, copyright);
  }
View Full Code Here

Examples of at.fhj.itm.model.Waypoint

  public void setUp() throws Exception {
    departure = new Date();
    mockTripCreator = new User("Trip","Creator","","","","",null,null, "");
    fromLocation = new Location(1,1000,"City1");
    toLocation = new Location(2,2000,"City2");
    mockTripWaypoint = new Waypoint(1,fromLocation,toLocation,mockTripCreator,"",true);
    mockTrip4Seats = new Trip(1,mockTripCreator,departure,4,mockTripWaypoint,"");
    mockTripBooker = new User("Trip", "Booker", "", "", "", "", null, null, "");
    mockBookerWaypointInactive = new Waypoint(fromLocation,toLocation,mockTripBooker,"",false);
    mockJsfUtil = EasyMock.createMock(JsfUtil.class);
    mockGoogleUtil = EasyMock.createMock(GoogleUtil.class);
    mockTripDAO = EasyMock.createMock(TripDAO.class);
    mockWaypointDAO = EasyMock.createMock(WaypointDAO.class);
    mockPointDAO = EasyMock.createMock(PointDAO.class);
View Full Code Here

Examples of at.fhj.itm.model.Waypoint

   */
  private Waypoint createTestWaypoint(){
    User u = userDAO.getByID(1,connection);
    Location from = new Location(8190, "Birkfeld");
    Location to = new Location(8010, "Graz");
    Waypoint wp = new Waypoint(from, to, u, "Unit Test", true);
    return wp;
  }
View Full Code Here

Examples of at.fhj.itm.model.Waypoint

   * @throws IOException
   * @throws JSONException
   */
  @Test
  public void testInsertTrip() throws SQLException, IOException, JSONException {
    Waypoint waypoint = new Waypoint(fromLocation, toLocation, mockTripCreator, null, true);
    Trip newTrip = new Trip(mockTripCreator,departure,4,waypoint, "");
    Trip tripWithPoint = newTrip;
    List<Point> points = new ArrayList<Point>();
    points.add(new Point(0, 0.0, 0.0, 0, newTrip.getId()));
    tripWithPoint.setPoints(points);
View Full Code Here

Examples of at.fhj.itm.model.Waypoint

    Location location = new Location(1234, "Unit City");
    User user = new User("Unit", "Test", "UnitTest", "1234", "Unit@Test.com", "123456",
        location, new Date(), UUID.randomUUID().toString().replace("-", ""));
    Location from = new Location(8190, "Birkfeld");
    Location to = new Location(8010, "Graz");
    Waypoint wp = new Waypoint(from, to, user, "", true);
    Trip t = new Trip(user, new Date(), 4, wp, "Copyright (C) Google");
   
    return t;
  }
View Full Code Here

Examples of at.fhj.itm.model.Waypoint

   * @throws IOException
   * @throws JSONException
   */
  @Test
  public void testInsertTripException() throws SQLException, IOException, JSONException {
    Waypoint waypoint = new Waypoint(fromLocation, toLocation, mockTripCreator, null, true);
    Trip newTrip = new Trip(mockTripCreator,departure,4,waypoint, "");
    Trip tripWithPoint = newTrip;
    List<Point> points = new ArrayList<Point>();
    points.add(new Point(0, 0.0, 0.0, 0, newTrip.getId()));
    tripWithPoint.setPoints(points);
View Full Code Here

Examples of at.fhj.itm.model.Waypoint

  /**
   * Creates a new waypoint which is persisted and afterwards deleted.
   */
  @Test
  public void testCreateDelete(){
    Waypoint wp = createTestWaypoint();
    int before = dao.selectAll(connection).size();
    dao.update(wp,connection);
    assertTrue(wp.getId() != -1);
    assertTrue(wp.getToLocation().getId() != -1);
    assertTrue(wp.getFromLocation().getId() != -1);
    int after = dao.selectAll(connection).size();
    assertTrue(after > before);
    dao.delete(wp, connection);
    int afterDelete = dao.selectAll(connection).size();
    assertEquals(before, afterDelete);
    assertTrue(wp.getId() == -1);
    assertTrue(wp.getToLocation().getId() == -1);
    assertTrue(wp.getFromLocation().getId() == -1);
  }
View Full Code Here

Examples of at.fhj.itm.model.Waypoint

   * @throws SQLException
   * @throws IOException
   */
  @Test
  public void testInsertTripNoConnection() throws SQLException, IOException {
    Waypoint waypoint = new Waypoint(fromLocation, toLocation, mockTripCreator, null, true);
    Trip newTrip = new Trip(mockTripCreator,departure,4,waypoint, "");
    Trip tripWithPoint = newTrip;
    List<Point> points = new ArrayList<Point>();
    points.add(new Point(0, 0.0, 0.0, 0, newTrip.getId()));
    tripWithPoint.setPoints(points);
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.