Package at.fhj.itm.model

Examples of at.fhj.itm.model.Point


    double lng = set.getDouble("lng");
    double lat = set.getDouble("lat");
    int duration = set.getInt("duration");
    int tripId = set.getInt("trip_id");

    return new Point(id, order, lng, lat, duration, tripId);
  }
View Full Code Here


  private List<Point> getPointsFromResultSet(ResultSet set)
      throws SQLException {
    List<Point> points = new ArrayList<Point>();
    while (set.next()) {
      Point p = getFromResultSet(set);
      points.add(p);
    }

    return Collections.unmodifiableList(points);
  }
View Full Code Here

      stmt.setInt(1, id);

      ResultSet set = stmt.executeQuery();
      set.next();

      Point p = getFromResultSet(set);
      set.close();
      stmt.close();
      return p;
    } catch (SQLException e) {
View Full Code Here

    PreparedStatement insertStmt = null;
    try {
      if (useBatchUpdate) {
        insertStmt = connection.prepareStatement(INSERT_POINT);
        for (int i = 0; i < entities.size(); i++) {
          Point entity = entities.get(i);
          insertStmt = this.setUpStatement(insertStmt, entity, false);

          if ((i + 1) % 1000 == 0) {
            insertStmt.executeBatch(); // Execute every 1000 items.
                          // some DB-systems have a
View Full Code Here

  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);
    JSONObject jsonObject = null;
   
   
    // Setup Mocks:
View Full Code Here

  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);
   
    // Setup Mocks:
    EasyMock.expect(mockJsfUtil.getLoggedInUser()).andReturn(mockTripCreator);
    mockBegin();
View Full Code Here

  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);
   
    // Setup Mocks:
    EasyMock.expect(mockJsfUtil.getLoggedInUser()).andReturn(mockTripCreator);
    mockBeginNoConnection();
View Full Code Here

  public void testInsertTripCommitFailed() 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);
   
   
    // Setup Mocks:
    EasyMock.expect(mockJsfUtil.getLoggedInUser()).andReturn(mockTripCreator);
View Full Code Here

  public void testInsertTriploadGoogleDataThrowsIOException() 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);
    JSONObject jsonObject = null;
   
   
    // Setup Mocks:
View Full Code Here

  public void testInsertTriploadGoogleDataThrowsJSONException() 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);
    JSONObject jsonObject = null;
   
   
    // Setup Mocks:
View Full Code Here

TOP

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

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.