Examples of Wheel


Examples of items.Wheel

  /**
   * Returns the Wheel object in the Inventory if it exists, if not returns null
   * @return Wheel or null depending on the presence of a Wheel object in inventory
   */
  public Wheel getWheel(){
    if(itemInventory[8].equals(new Wheel()))
      return (Wheel) itemInventory[8];
   
    for (int f=0; f<length; f++){
      if (itemInventory[f].equals(new Wheel())){
        return (Wheel) itemInventory[f];
      }
    }
    return null;
  }
View Full Code Here

Examples of org.hibernate.examples.mapping.associations.onetoone.unidirectionalOneToOne.Wheel

    public void unidirectionalOneToOne() throws Exception {

        Vehicle vehicle = new Vehicle();
        vehicle.setBrand("Mercedes");

        Wheel wheel = new Wheel();
        wheel.setVehicle(vehicle);

        em.persist(vehicle);
        em.persist(wheel);
        em.flush();
        em.clear();

        log.debug("Wheel=[{}]", wheel);

        wheel = em.find(Wheel.class, wheel.getId());
        assertThat(wheel).isNotNull();

        vehicle = wheel.getVehicle();
        assertThat(vehicle).isNotNull();

        em.remove(wheel);
        em.remove(vehicle);
        em.flush();
View Full Code Here

Examples of org.switchyard.serial.jackson.JacksonSerializationData.Wheel

    }

    @Test
    public void testPolymorphicArray() throws Exception {
        Car car = new Car();
        car.setCheapParts(new Part[] {new Wheel(), new CustomPart(true)});
        car = serDeser(car, Car.class);
        Assert.assertEquals(2, car.getCheapParts().length);
        Assert.assertEquals(true, car.getCheapParts()[1].isReplaceable());
    }
View Full Code Here

Examples of org.switchyard.serial.jackson.JacksonSerializationData.Wheel

    @Test
    public void testPolymorphicCollection() throws Exception {
        Car car = new Car();
        Collection<Part> ep = new ArrayList<Part>();
        for (int i=0; i < 4; i++) {
            ep.add(new Wheel());
        }
        ep.add(new CustomPart(false));
        car.setExpensiveParts(ep);
        car = serDeser(car, Car.class);
        Assert.assertEquals(5, car.getExpensiveParts().size());
View Full Code Here

Examples of org.switchyard.serial.jackson.JacksonSerializationData.Wheel

    }

    @Test
    public void testUnsupportedTypeArray() throws Exception {
        Car car = new Car();
        car.setCheapParts(new Part[] {new Wheel(), new ExpiredPart(new Date())});
        car = serDeser(car, Car.class);
        Assert.assertEquals(1, car.getCheapParts().length);
    }
View Full Code Here

Examples of org.switchyard.serial.jackson.JacksonSerializationData.Wheel

    @Test
    public void testUnsupportedTypeCollection() throws Exception {
        Car car = new Car();
        Collection<Part> ep = new ArrayList<Part>();
        for (int i=0; i < 4; i++) {
            ep.add(new Wheel());
        }
        ep.add(new ExpiredPart(new Date()));
        car.setExpensiveParts(ep);
        car = serDeser(car, Car.class);
        Assert.assertEquals(4, car.getExpensiveParts().size());
View Full Code Here

Examples of org.switchyard.serial.jackson.JacksonSerializationData.Wheel

    @Test
    @SuppressWarnings("unchecked")
    public void testUnsupportedTypeMap() throws Exception {
        Map<String, Part> map = new HashMap<String, Part>();
        map.put("wheel", new Wheel());
        map.put("crank", new ExpiredPart(new Date()));
        map = serDeser(map, Map.class);
        Assert.assertEquals(1, map.size());
    }
View Full Code Here

Examples of org.switchyard.serial.jackson.JacksonSerializationData.Wheel

    }

    @Test
    public void testCustomExceptions() throws Exception {
        final OutOfGasException expectedOutOfGasException = new OutOfGasException("Dagnabit!");
        final FlatTireException expectedFlatTireException = new FlatTireException(new Wheel(Wheel.Location.BACK_RIGHT));
        Car car = new Car();
        car.setProblems(Arrays.asList(new Exception[]{expectedOutOfGasException, expectedFlatTireException}));
        car = serDeser(car, Car.class);
        final List<Exception> actualExceptions = car.getProblems();
        final OutOfGasException actualOutOfGasException = (OutOfGasException)actualExceptions.get(0);
View Full Code Here

Examples of org.switchyard.serial.protostuff.ProtostuffSerializationData.Wheel

    }

    @Test
    public void testPolymorphicArray() throws Exception {
        Car car = new Car();
        car.setCheapParts(new Part[] {new Wheel(), new CustomPart(true)});
        car = serDeser(car, Car.class);
        Assert.assertEquals(2, car.getCheapParts().length);
        Assert.assertEquals(true, car.getCheapParts()[1].isReplaceable());
    }
View Full Code Here

Examples of org.switchyard.serial.protostuff.ProtostuffSerializationData.Wheel

    @Test
    public void testPolymorphicCollection() throws Exception {
        Car car = new Car();
        Collection<Part> ep = new ArrayList<Part>();
        for (int i=0; i < 4; i++) {
            ep.add(new Wheel());
        }
        ep.add(new CustomPart(false));
        car.setExpensiveParts(ep);
        car = serDeser(car, Car.class);
        Assert.assertEquals(5, car.getExpensiveParts().size());
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.