Examples of Car


Examples of net.sf.jwan.tutorial.data.ejb.Car

  @PostConstruct
    public void init()
    { 
    value = new ArrayList<Car>();
    Car p1 = new Car();p1.setName("p1");
    Car p2 = new Car();p2.setName("p2");
    value.add(p1);
    value.add(p2);
   
    slist = new ArrayList<String>();
    slist.add("sl1");
View Full Code Here

Examples of net.sf.laja.example.car.behaviour.Car

     *    defined in BusStateTemplate, are marked as optional and is not part of the mandatory attributes
     *    in the chained constructor but can by populated by the builder method 'withWeightInKilograms'.
     */
    public static void main(String... args) {
        // Use the chained constructor to create the car.
        Car volvo = Car.lengthInCentimeters(479).name("Volvo").owner(Owner.ssn(197506071234L).name("Bill")).color(RED).asCar();

        // Use the builder to create the car.
        Car saab = Car.build().withLengthInCentimeters(434).withName("Saab").withColor("Blue").withOwner(
                Owner.build().withSsn("197707071122").withName("Bull")).asCar();

        // Name and lengthInCentimeters are mandatory, weightInKilograms is optional.
        Bus bus = Bus.name("Some").lengthInCentimeters(5100).withWeightInKilograms(3200).asBus();

View Full Code Here

Examples of net.shadewind.racetrack.Car

       
    List<Vector2i> startPositions = map.getStartPositions();
    int position = 0;
    cars.clear();
    for (Client c : clients) {
      Car car = new Car();
      car.pushPosition(startPositions.get(position));
      cars.put(c, car);
      position = (position + 1) % startPositions.size();
    }
   
    for (Client c : clients) {
      c.gameStarted(map, collisionsEnabled);
      for (Client carClient : clients) {
        Car car = cars.get(carClient);
        c.carReset(carClient.getId(), car.getPosition());
      }
    }
   
    state = GameState.STARTED;
    turnPointer = -1;
View Full Code Here

Examples of org.apache.aries.jpa.container.advanced.itest.bundle.entities.Car

   
    EntityManager em = emf.createEntityManager();
   
    em.getTransaction().begin();
   
    Car c = new Car();
   
    c.setColour("Blue");
    c.setNumberPlate("AB11CDE");
    c.setNumberOfSeats(7);
    c.setEngineSize(1900);
   
    em.persist(c);
   
    em.getTransaction().commit();
   
View Full Code Here

Examples of org.apache.aries.jpa.container.itest.entities.Car

      q.executeUpdate();
     
      q = managedEm.createQuery("SELECT Count(c) from Car c");
      assertEquals(0l, q.getSingleResult());
     
      Car car = new Car();
      car.setNumberOfSeats(5);
      car.setEngineSize(1200);
      car.setColour("blue");
      car.setNumberPlate("A1AAA");
      managedEm.persist(car);
    } catch (Exception e) {
      e.printStackTrace();
    }finally {
      ut.commit();
    }
   
    Car c = managedEm.find(Car.class, "A1AAA");
   
    assertEquals(5, c.getNumberOfSeats());
    assertEquals(1200, c.getEngineSize());
    assertEquals("blue", c.getColour());
   
    ut.begin();
    try {
      Car car = managedEm.find(Car.class, "A1AAA");
      car.setNumberOfSeats(2);
      car.setEngineSize(2000);
      car.setColour("red");
    } finally {
      ut.commit();
    }
   
    c = managedEm.find(Car.class, "A1AAA");
View Full Code Here

Examples of org.apache.aries.jpa.container.itest.entities.Car

    Query countQuery = managedEm.createQuery("SELECT Count(c) from Car c");
    assertEquals(0l, countQuery.getSingleResult());
   
    ut.begin();
    try {
      Car car = new Car();
      car.setNumberOfSeats(5);
      car.setEngineSize(1200);
      car.setColour("blue");
      car.setNumberPlate("A1AAA");
      managedEm.persist(car);
     
      car = new Car();
      car.setNumberOfSeats(7);
      car.setEngineSize(1800);
      car.setColour("green");
      car.setNumberPlate("B2BBB");
      managedEm.persist(car);
    } finally {
      ut.commit();
    }
   
    assertEquals(2l, countQuery.getSingleResult());
   
    TypedQuery<Car> carQuery = managedEm.
             createQuery("Select c from Car c ORDER by c.engineSize", Car.class);
   
    List<Car> list = carQuery.getResultList();
    assertEquals(2l, list.size());
   
    assertEquals(5, list.get(0).getNumberOfSeats());
    assertEquals(1200, list.get(0).getEngineSize());
    assertEquals("blue", list.get(0).getColour());
    assertEquals("A1AAA", list.get(0).getNumberPlate());
   
    assertEquals(7, list.get(1).getNumberOfSeats());
    assertEquals(1800, list.get(1).getEngineSize());
    assertEquals("green", list.get(1).getColour());
    assertEquals("B2BBB", list.get(1).getNumberPlate());
   
    ut.begin();
    try {
      Car car = managedEm.find(Car.class, "A1AAA");
      car.setNumberOfSeats(2);
      car.setEngineSize(2000);
      car.setColour("red");
     
      car = managedEm.find(Car.class, "B2BBB");
      managedEm.remove(car);
     
      car = new Car();
      car.setNumberOfSeats(2);
      car.setEngineSize(800);
      car.setColour("black");
      car.setNumberPlate("C3CCC");
      managedEm.persist(car);
     
    } finally {
      ut.commit();
    }
View Full Code Here

Examples of org.apache.aries.jpa.container.itest.entities.Car

   
    EntityManager em = emf.createEntityManager();
   
    em.getTransaction().begin();
   
    Car c = new Car();
    c.setNumberPlate("123456");
    c.setColour("blue");
    em.persist(c);
   
    em.getTransaction().commit();
   
    em.close();
View Full Code Here

Examples of org.apache.aries.jpa.container.itest.entities.Car

    //Use a JTA tran to show integration
    UserTransaction ut = context().getService(UserTransaction.class);
   
    ut.begin();
    em.joinTransaction();
    Car c = new Car();
    c.setNumberPlate("123456");
    c.setColour("blue");
    em.persist(c);
   
    ut.commit();
     
    em.close();
View Full Code Here

Examples of org.apache.camel.dataformat.bindy.model.car.Car

        assertMockEndpointsSatisfied();

        Map map1 = (Map) mock.getReceivedExchanges().get(0).getIn().getBody(List.class).get(0);

        Car rec1 = (Car) map1.values().iterator().next();

        assertEquals("SS552", rec1.getStockid());
        assertEquals("TOYOTA", rec1.getMake());
        assertEquals("KLUGER", rec1.getModel());
        assertEquals(2005, rec1.getYear());
        assertEquals(Double.valueOf("155000.0"), rec1.getKlms(), 0.0001);
        assertEquals("EZR05I", rec1.getNvic());
        assertEquals("Used", rec1.getStatus());
    }
View Full Code Here

Examples of org.apache.deltaspike.cdise.tck.beans.Car

        CarRepair carRepair = (CarRepair)
            beanManager.getReference(bean, CarRepair.class, beanManager.createCreationalContext(bean));

        Assert.assertNotNull(carRepair);

        Car car = carRepair.getCar();

        Assert.assertNotNull(car);
        Assert.assertNotNull(car.getUser());


        carRepair.getCar().getUser().setName("tester");
        Assert.assertEquals("tester", car.getUser().getName());

        Assert.assertFalse(CarRepair.isPreDestroyCalled());
        Assert.assertFalse(Car.isPreDestroyCalled());
        Assert.assertFalse(TestUser.isPreDestroyCalled());

        cdiContainer.getContextControl().stopContexts();

        Assert.assertTrue(CarRepair.isPreDestroyCalled());
        Assert.assertTrue(Car.isPreDestroyCalled());
        Assert.assertTrue(TestUser.isPreDestroyCalled());

        try
        {
            car.getUser();

            // accessing the car should have triggered a ContextNotActiveException
            Assert.fail();
        }
        catch (ContextNotActiveException e)
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.