Package it.cdq.model.db

Examples of it.cdq.model.db.Flight


  @Transactional
  public void multiAddTest() {
    Airport a = new Airport();
    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


    Assert.assertTrue(flightRepository.list().size() == ITERATION);
  }

  private Flight mockFight(String origin, String destination, int i) {
    Flight flight = new Flight();
    flight.setCandidate(true);
    flight.setDate(new Date());
    flight.setOperator("xxx");
    flight.setOrigin(mockAirport(origin, i));
    flight.setDestination(mockAirport(destination, i));
    return flight;
  }
View Full Code Here

          Airport b = new Airport();
          b.setAirportname(option.getDestinationLabel());
          b.setIataCode(option.getDestination());

          Flight arrival = clone.getArrival();
          arrival.setOrigin(a);
          arrival.setDestination(b);
          arrival.setCandidate(true);
          arrival.setModificationDate(new Date());
          arrival.setOperator(option.getOperator());

          Flight departure = clone.getDeparture();
          departure.setOrigin(b);
          departure.setDestination(a);
          departure.setCandidate(true);
          departure.setModificationDate(new Date());
          departure.setOperator(option.getOperator());

          logger.info(clone);
          trips.add(clone);
        }
      }
View Full Code Here

    Calendar clone = (Calendar) calendar.clone();
    clone.add(Calendar.DAY_OF_YEAR, i);
    Date departureDate = calendar.getTime();
    Date arrivalDate = clone.getTime();

    Flight arrival = new Flight();
    arrival.setDate(arrivalDate);

    Flight departure = new Flight();
    departure.setDate(departureDate);

    Trip trip = new Trip();
    trip.setArrival(arrival);
    trip.setDeparture(departure);
    list.add(trip);
View Full Code Here

  public static final String QUALIFIER = "flightRepository";

  public Flight takeFlight(Flight sample) {

    Flight result = searchFlight(sample);
    if (result != null) {
      logger.info("Flight [" + counter.get() + "] alredy present : " + sample);
      return result;
    }
View Full Code Here

TOP

Related Classes of it.cdq.model.db.Flight

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.