Package at.fhj.itm.model

Examples of at.fhj.itm.model.Point


  public void testInsertTripgetJSONObjectThrowsIOException() 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);
View Full Code Here


  public void testInsertTriploadAndPersistGoogleDataThrowsSQLException() 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 testInsertTriploadAndPersistGoogleDataThrowsDAOException() 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

   * This tests should run without errors
   * @throws SQLException
   */
  @Test
  public void testGetPointsForTrip() throws SQLException {
    Point point = new Point(1,1,1,1,1,1);
    List<Point> pointList = new ArrayList<Point>();
    pointList.add(point);
    // Setup Mocks:
    mockBegin();
    EasyMock.expect(mockPointDAO.getByTrip(mockTrip4Seats, mockGetConnection())).andReturn(pointList);
View Full Code Here

   *
   * @throws SQLException
   */
  @Test
  public void testGetPointsForTripCommitFailed() throws SQLException {
    Point point = new Point(1,1,1,1,1,1);
    List<Point> pointList = new ArrayList<Point>();
    pointList.add(point);
    // Setup Mocks:
    mockBegin();
    EasyMock.expect(mockPointDAO.getByTrip(mockTrip4Seats, mockGetConnection())).andReturn(pointList);
View Full Code Here

  @Test
  public void testGetMapModelFromTrip() throws SQLException {
    //input data
   
    //setup mocks
    Point point = new Point(1,1,1,1,1,1);
    List<Point> pointList = new ArrayList<Point>();
    pointList.add(point);
    // Setup Mocks:
    mockBegin();
    EasyMock.expect(mockPointDAO.getByTrip(mockTrip4Seats, mockGetConnection())).andReturn(pointList);
View Full Code Here

  @Test
  public void testGetMapModelFromTripServiceException() throws SQLException {
    //input data
   
    //setup mocks
    Point point = new Point(1,1,1,1,1,1);
    List<Point> pointList = new ArrayList<Point>();
    pointList.add(point);
    // Setup Mocks:
    mockBegin();
    EasyMock.expect(mockPointDAO.getByTrip(mockTrip4Seats, mockGetConnection())).andThrow(new DAOException("DAOException"));
View Full Code Here

  @Test
  public void testInsertSelectByTripDeleteByTrip()
  {
    List<Point> points = new ArrayList<Point>();
    for(int i = 0; i< 10; i++){
      Point p = new Point(i+1, 10.343 * i, 8.343 * i, i*2, 1);
      points.add(p);
    }
   
    for(Point p : points){
      dao.update(p, connection);
View Full Code Here

   * Creates a single point which is persisted and again deleted
   */
  @Test
  public void testInsertDelete(){
    int count = dao.selectAll(connection).size();
    Point p = new Point(1, 1234.33, 4312.11, 100, 1);
    assertEquals(-1, p.getId());
    dao.update(p, connection);
    int countAfter = dao.selectAll(connection).size();
    assertTrue(p.getId() != -1);
    assertTrue(countAfter > count);
    Point p2 = dao.getByID(p.getId(), connection);
    assertEquals(p, p2);
   
    dao.delete(p, connection);
    int countAfterDelete = dao.selectAll(connection).size();
    assertEquals(-1, p.getId());
View Full Code Here

   * Creates and persists a point entity and tests if updates are performed
   * by the DAO
   */
  @Test
  public void testUpdate(){
    Point p = new Point(1, 42.424242, 24.242424, 1230, 1);
    dao.update(p, connection);
    assertTrue(p.getId() != -1);
  }
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.