Package se.plushogskolan.jetbroker.plane.domain

Examples of se.plushogskolan.jetbroker.plane.domain.Airport


    DateTime now = new DateTime();
    DateTime dateMinus1 = now.minusHours(1);
    DateTime dateMinus2 = now.minusHours(2);

    Airport airport = TestFixture.getValidAirport();
    airport.setId(0);
    airport.setLastUpdated(now);
    long id1 = repo.persist(airport);

    Airport airport2 = TestFixture.getValidAirport();
    airport2.setId(0);
    airport2.setLastUpdated(dateMinus2);
    repo.persist(airport2);

    assertEquals("All airports", 2, repo.getAllAirports().size());

    int noOfDeletes = repo.deleteAirportsOlderThan(dateMinus1);
View Full Code Here


  @Test(expected = Exception.class)
  public void testValidation() {

    // Create airport with empty code. ID must be 0 for integrations tests
    // using JPA.
    Airport airport = TestFixture.getValidAirport(0, "", "Gothenburg");
    repo.persist(airport);
  }
View Full Code Here

public class TestFixture {

  private static Logger log = Logger.getLogger(TestFixture.class.getName());

  public static Airport getValidAirport(long id, String code, String name) {
    Airport airport = new Airport();
    airport.setId(id);
    airport.setCode(code);
    airport.setName(name);
    airport.setLatitude(10);
    airport.setLongitude(20);
    return airport;
  }
View Full Code Here

public class TestFixture {

  private static Logger log = Logger.getLogger(TestFixture.class.getName());

  public static Airport getValidAirport(long id, String code, String name) {
    Airport airport = new Airport();
    airport.setId(id);
    airport.setCode(code);
    airport.setName(name);
    airport.setLatitude(10);
    airport.setLongitude(20);
    return airport;
  }
View Full Code Here

    log.fine("Edit airport, id=" + id);

    EditAirportBean bean = new EditAirportBean();

    if (id > 0) {
      Airport airport = getAirportService().getAirport(id);
      bean.copyAirportValuesToBean(airport);
    }

    ModelAndView mav = new ModelAndView("editAirport");
    mav.addObject("editAirportBean", bean);
View Full Code Here

      mav.addObject("editAirportBean", bean);
      return mav;
    }

    if (bean.getId() > 0) {
      Airport airport = getAirportService().getAirport(bean.getId());
      bean.copyBeanValuesToAirport(airport);
      getAirportService().updateAirport(airport);
    } else {
      Airport airport = new Airport();
      bean.copyBeanValuesToAirport(airport);
      getAirportService().createAirport(airport);
    }

    return new ModelAndView("redirect:/index.html");
View Full Code Here

    DateTime now = new DateTime();
    DateTime dateMinus1 = now.minusHours(1);
    DateTime dateMinus2 = now.minusHours(2);

    Airport airport = TestFixture.getValidAirport(0);
    airport.setLastUpdated(now);
    long id1 = repo.persist(airport);

    Airport airport2 = TestFixture.getValidAirport(0);
    airport2.setLastUpdated(dateMinus2);
    repo.persist(airport2);

    assertEquals("All airports", 2, repo.getAllAirports().size());

    int noOfDeletes = repo.deleteAirportsOlderThan(dateMinus1);
View Full Code Here

  @Test(expected = Exception.class)
  public void testValidation() {

    // Create airport with empty code. ID must be 0 for integrations tests
    // using JPA.
    Airport airport = TestFixture.getValidAirport(0, "", "Gothenburg");
    repo.persist(airport);
  }
View Full Code Here

TOP

Related Classes of se.plushogskolan.jetbroker.plane.domain.Airport

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.