Examples of Wheel


Examples of org.switchyard.serial.protostuff.ProtostuffSerializationData.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.protostuff.ProtostuffSerializationData.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.protostuff.ProtostuffSerializationData.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.protostuff.ProtostuffSerializationData.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 protobuf_unittest.Wheel

        .setLiters(10);

    Vehicle vehicle = vehicleBuilder.build();
    assertEquals(4, vehicle.getWheelCount());
    for (int i = 0; i < 4; i++) {
      Wheel wheel = vehicle.getWheel(i);
      assertEquals(4, wheel.getRadius());
      assertEquals(i + 1, wheel.getWidth());
    }
    assertEquals(10, vehicle.getEngine().getLiters());

    for (int i = 0; i < 4; i++) {
      vehicleBuilder.getWheelBuilder(i)
          .setRadius(5)
          .setWidth(i + 10);
    }
    vehicleBuilder.getEngineBuilder().setLiters(20);

    vehicle = vehicleBuilder.build();
    for (int i = 0; i < 4; i++) {
      Wheel wheel = vehicle.getWheel(i);
      assertEquals(5, wheel.getRadius());
      assertEquals(i + 10, wheel.getWidth());
    }
    assertEquals(20, vehicle.getEngine().getLiters());
    assertTrue(vehicle.hasEngine());
  }
View Full Code Here

Examples of protobuf_unittest.Wheel

        .setLiters(10);

    Vehicle vehicle = vehicleBuilder.build();
    assertEquals(4, vehicle.getWheelCount());
    for (int i = 0; i < 4; i++) {
      Wheel wheel = vehicle.getWheel(i);
      assertEquals(4, wheel.getRadius());
      assertEquals(i + 1, wheel.getWidth());
    }
    assertEquals(10, vehicle.getEngine().getLiters());

    for (int i = 0; i < 4; i++) {
      vehicleBuilder.getWheelBuilder(i)
          .setRadius(5)
          .setWidth(i + 10);
    }
    vehicleBuilder.getEngineBuilder().setLiters(20);

    vehicle = vehicleBuilder.build();
    for (int i = 0; i < 4; i++) {
      Wheel wheel = vehicle.getWheel(i);
      assertEquals(5, wheel.getRadius());
      assertEquals(i + 10, wheel.getWidth());
    }
    assertEquals(20, vehicle.getEngine().getLiters());
    assertTrue(vehicle.hasEngine());
  }
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.