Examples of Car


Examples of org.dozer.vo.Car

  }

  public DehydrateTestObject getExpectedTestHydrateAndMoreDehydrateTestObject() {
    DehydrateTestObject custom = newInstance(DehydrateTestObject.class);
    Car car = newInstance(Car.class);
    car.setName("name");

    AppleComputer apple1 = newInstance(AppleComputer.class);
    apple1.setName("name");
    AppleComputer apple2 = newInstance(AppleComputer.class);
    apple2.setName("name");
View Full Code Here

Examples of org.drools.examples.carinsurance.domain.Car

    @Test
    public void approvePolicyRequest() throws IOException {
        SimulationFluent simulationFluent = new DefaultSimulationFluent();

        Driver john = new Driver("John", "Smith", new LocalDate(1970, 1, 1));
        Car mini = new Car("MINI-01", CarType.SMALL, false, new BigDecimal("10000.00"));
        PolicyRequest johnMiniPolicyRequest = new PolicyRequest(john, mini);
        johnMiniPolicyRequest.addCoverageRequest(new CoverageRequest(CoverageType.COLLISION));
        johnMiniPolicyRequest.addCoverageRequest(new CoverageRequest(CoverageType.COMPREHENSIVE));

        String rules = readInputStreamReaderAsString( new InputStreamReader( getClass().getResourceAsStream( "policyRequestApprovalRules.drl" ) ) );
View Full Code Here

Examples of org.hibernate.validator.referenceguide.chapter02.typeargument.Car

    assertEquals( "may not be null", constraintViolations.iterator().next().getMessage() );
  }

  @Test
  public void validateListTypeArgumentConstraint() {
    Car car = new Car();
    car.addPart( "Wheel" );
    car.addPart( null );

    Set<ConstraintViolation<Car>> constraintViolations = validator.validate( car );

    assertEquals( 1, constraintViolations.size() );
    assertEquals(
View Full Code Here

Examples of org.infinispan.demo.carmart.model.Car

    public void startup() {
      RemoteCache<String, Object> cars = provider.getCacheContainer().getCache(CarManager.CACHE_NAME);
        List<String> carNumbers = new ArrayList<String>();

        try {
            Car c = new Car("Ford Focus", 1.6, CarType.COMBI, "white", "FML 23-25", Country.CHN);
            carNumbers.add(c.getNumberPlate());
            cars.put(CarManager.encode(c.getNumberPlate()), c);
            c = new Car("BMW X3", 2.0, CarType.SEDAN, "gray", "1P3 2632", Country.CHN);
            carNumbers.add(c.getNumberPlate());
            cars.put(CarManager.encode(c.getNumberPlate()), c);
            c = new Car("Ford Mondeo", 2.2, CarType.COMBI, "blue", "1B2 1111", Country.USA);
            carNumbers.add(c.getNumberPlate());
            cars.put(CarManager.encode(c.getNumberPlate()), c);
            c = new Car("Mazda MX-5", 1.8, CarType.CABRIO, "red", "6T4 2526", Country.USA);
            carNumbers.add(c.getNumberPlate());
            cars.put(CarManager.encode(c.getNumberPlate()), c);
            c = new Car("VW Golf", 1.6, CarType.HATCHBACK, "yellow", "2B2 4946", Country.GERMANY);
            carNumbers.add(c.getNumberPlate());
            cars.put(CarManager.encode(c.getNumberPlate()), c);
            // insert a list of cars' number plates
            cars.put(CarManager.CAR_NUMBERS_KEY, carNumbers);
        } catch (Exception e) {
            log.warning("An exception occured while populating the database!");
        }
View Full Code Here

Examples of org.infinispan.demo.carmart.model.Car

        utx = getUserTransactionFromJNDI();

        try {
            utx.begin();
            Car c = new Car("Ford Focus", 1.6, CarType.COMBI, "white", "FML 23-25", Country.CHN);
            carNumbers.add(c.getNumberPlate());
            cars.put(CarManager.encode(c.getNumberPlate()), c);
            c = new Car("BMW X3", 2.0, CarType.SEDAN, "gray", "1P3 2632", Country.CHN);
            carNumbers.add(c.getNumberPlate());
            cars.put(CarManager.encode(c.getNumberPlate()), c);
            c = new Car("Ford Mondeo", 2.2, CarType.COMBI, "blue", "1B2 1111", Country.USA);
            carNumbers.add(c.getNumberPlate());
            cars.put(CarManager.encode(c.getNumberPlate()), c);
            c = new Car("Mazda MX-5", 1.8, CarType.CABRIO, "red", "6T4 2526", Country.USA);
            carNumbers.add(c.getNumberPlate());
            cars.put(CarManager.encode(c.getNumberPlate()), c);
            c = new Car("VW Golf", 1.6, CarType.HATCHBACK, "yellow", "2B2 4946", Country.GERMANY);
            carNumbers.add(c.getNumberPlate());
            cars.put(CarManager.encode(c.getNumberPlate()), c);
            // insert a list of cars' number plates
            cars.put(CarManager.CAR_NUMBERS_KEY, carNumbers);
            utx.commit();
            log.info("Successfully imported data!");
        } catch (Exception e) {
View Full Code Here

Examples of org.infinispan.demo.carmart.model.Car

    public void startup() {

    try {
      EntityManager em = provider.getEntityManagerFactory().createEntityManager();
            Car c = new Car("Ford Focus", 1.6, CarType.COMBI, "white", "FML 23-25", Country.CHN);
            em.persist(c);
            c = new Car("BMW X3", 2.0, CarType.SEDAN, "gray", "1P3 2632", Country.CHN);
            em.persist(c);
            c = new Car("Ford Mondeo", 2.2, CarType.COMBI, "blue", "1B2 1111", Country.USA);
            em.persist(c);
            c = new Car("Mazda MX-5", 1.8, CarType.CABRIO, "red", "6T4 2526", Country.USA);
            em.persist(c);
            c = new Car("VW Golf", 1.6, CarType.HATCHBACK, "yellow", "2B2 4946", Country.GERMANY);
            em.persist(c);
            em.close();
            log.info("Successfully imported data!");
        } catch (Exception e) {
            log.warning("An exception occured while populating the database " + e.getMessage());
View Full Code Here

Examples of org.infinispan.demo.carmart.model.Car

    }

    public String removeCar(String numberPlate) {
        try {
          EntityManager em = provider.getEntityManagerFactory().createEntityManager();
          Car car = em.find(Car.class, numberPlate);
          em.remove(car);
          em.close();
            log.info("remote car " + numberPlate);
        } catch (Exception e) {
          log.warning("error whiling remote car " + numberPlate);
View Full Code Here

Examples of org.infinispan.demo.carmart.model.Car

    removeCar("FML 23-25");
  }
 
  private void removeCar(String numberPlate) {
    EntityManager em = factory.createEntityManager();
    Car car = em.find(Car.class, numberPlate);
    em.remove(car);
    em.close();
    System.out.println("Remove Car " + numberPlate);
  }
View Full Code Here

Examples of org.infinispan.demo.carmart.model.Car

        System.out.println("Get Car list " + result);
  }

  private void showCarDetails(String numberPlate) {
    EntityManager em = factory.createEntityManager();
    Car car = em.find(Car.class, numberPlate);
    em.close();
    System.out.println("Show Car Details " + car);
    }
View Full Code Here

Examples of org.infinispan.demo.carmart.model.Car

    System.out.println("Show Car Details " + car);
    }

  private void addNewCar() {
    EntityManager em = factory.createEntityManager();
    Car c = new Car("Ford Focus", 1.6, CarType.COMBI, "white", "FML 23-25", Country.CHN);
        em.persist(c);
        em.close();
        System.out.println("Add a new car " + c);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.