Package se.plushogskolan.cdi.model

Examples of se.plushogskolan.cdi.model.Car


  public MockCarRepository() {
  }
 
  public Car getNormalCar() {
    return new Car("Mocked normal car");
  }
View Full Code Here


  public Car getNormalCar() {
    return new Car("Mocked normal car");
  }

  public Car getSportsCar() {
    return new Car("Mocked sports car");
  }
View Full Code Here

  public DbCarRepository() {
  }

  public Car getNormalCar() {
    return new Car("DB normal car");
  }
View Full Code Here

  public Car getNormalCar() {
    return new Car("DB normal car");
  }

  public Car getSportsCar() {
    return new Car("DB sports car");
  }
View Full Code Here

  @Test
  public void testNormalCarService() {
    CarService carService = app.normalCarService;
    assertNotNull("NormalCarService is injected", carService);

    Car car = carService.getCar();
    assertEquals("Car is corrrect", "Mocked normal car", car.getName());
    assertEquals("Car owner is correct", "Hans Olsson", car.getOwner()
        .getName());
  }
View Full Code Here

  @Test
  public void testSportCarService() {
    CarService carService = app.sportCarService;
    assertNotNull("SportCarService is injected", carService);

    Car car = carService.getCar();
    assertNotNull("Car is retrieved", car);
    assertEquals("Car owner is correct", "Hans von Sparre", car.getOwner()
        .getName());
  }
View Full Code Here

  }

  @Test
  public void testSaveCar() {
    Car car = new Car("New car");

    // NormalCarService uses mock
    app.normalCarService.saveCar(car);
    assertEquals("No updated car for mock", 0, app.carUpdatedCount);
View Full Code Here

  }

  @Test
  public void testDecoratedSportsCar() {

    Car car = app.sportCarService.getCar();
    assertEquals("Decorated sports car name",
        "DB sports car with some decorated wrom wrom", car.getName());
  }
View Full Code Here

  CarService carService;

  public Car getCar() {
    System.out.println("SportCarDecorator.getCar() is invoked");
    Car car = carService.getCar();
    car.setName(car.getName() + " with some decorated wrom wrom");
    return car;
  }
View Full Code Here

  Owner owner;

  private CarRepository carRepository;

  public Car getCar() {
    Car car = carRepository.getSportsCar();
    car.setOwner(owner);
    return car;
  }
View Full Code Here

TOP

Related Classes of se.plushogskolan.cdi.model.Car

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.