Examples of Wheel


Examples of com.avaje.tests.model.carwheel.Wheel

    GlobalProperties.put("ebean.search.packages", "com.avaje.tests.model.carwheel");
   
    Car car = new Car();

    Tire t1 = new Tire();
    Wheel w1 = new Wheel();
    w1.setCar(car);
    w1.setTire(t1);

    Tire t2 = new Tire();
    Wheel w2 = new Wheel();
    w2.setCar(car);
    w2.setTire(t2);

    Tire t3 = new Tire();
    Wheel w3 = new Wheel();
    w3.setCar(car);
    w3.setTire(t3);

    Tire t4 = new Tire();
    Wheel w4 = new Wheel();
    w4.setCar(car);
    w4.setTire(t4);
   
    List<Wheel> wheels = new ArrayList<Wheel>();
    wheels.add(w1);
    wheels.add(w2);
    wheels.add(w3);
View Full Code Here

Examples of com.avaje.tests.sp.model.car.Wheel

  @Test
  public void testInsertCarTwice() {

    List<Wheel> wheels = new LinkedList<Wheel>();
    wheels.add(new Wheel());
    wheels.add(new Wheel());
    wheels.add(new Wheel());
    wheels.add(new Wheel());

    Car c = new Car();
    c.setWheels(wheels);

    Ebean.save(c); // NOTE 1ST SAVE
View Full Code Here

Examples of com.tobedevoured.modelcitizen.model.Wheel

        modelFactory.registerBlueprint(OptionBlueprint.class);
    }

    @Test
    public void spireTireBlueprintInheritsFromWheelBlueprint() throws CreateModelException {
        Wheel wheel = modelFactory.createModel(Wheel.class);
        SpareTire spareTire = modelFactory.createModel(SpareTire.class);

        assertEquals(wheel.getColor(), spareTire.getColor());

        assertEquals("spare tire name", spareTire.getName());
        assertEquals(9, (int) spareTire.getSize());
        assertEquals(400, (int) spareTire.getMileLimit());
    }
View Full Code Here

Examples of com.tobedevoured.modelcitizen.model.Wheel

        modelFactory.registerBlueprint(optionBlueprint);
    }


    public void testEmptyListDoesNotInjectBlueprint() throws CreateModelException {
        Wheel wheel = new Wheel("Test");
        wheel.setOptions(new ArrayList<Option>()); // prevents injection

        Wheel factoryWheel = modelFactory.createModel(wheel);

        assertEquals(0, factoryWheel.getOptions().size());
        assertEquals(3, factoryWheel.getVariants().size());
    }
View Full Code Here

Examples of com.tobedevoured.modelcitizen.model.Wheel

        assertEquals(0, factoryWheel.getOptions().size());
        assertEquals(3, factoryWheel.getVariants().size());
    }

    public void testEmptyListInjectsBlueprint() throws CreateModelException {
        Wheel wheel = new Wheel("Test");
        wheel.setVariants(new ArrayList<Option>())// still injected due to ignoreEmpty = true

        Wheel factoryWheel = modelFactory.createModel(wheel);

        assertEquals(3, factoryWheel.getOptions().size());
        assertEquals(3, factoryWheel.getVariants().size());
    }
View Full Code Here

Examples of com.tobedevoured.modelcitizen.model.Wheel

    @Test
    public void testForceAlwaysCreatesMappedList() throws CreateModelException {

        Car car = new Car();
        car.setWheels(Arrays.asList(new Wheel[]{new Wheel("test")}));
        car = modelFactory.createModel(car);

        assertEquals("force=true ensures wheels will be injected", 4, car.getWheels().size());
    }
View Full Code Here

Examples of com.tobedevoured.modelcitizen.model.Wheel

        car.setMake("new make");
        car.setManufacturer("test manuf");

        car.setWheels(new ArrayList<Wheel>());
        Wheel wheel = new Wheel("mega tire");
        car.getWheels().add(wheel);

        car.setSpares(new HashSet<Wheel>());

        car = modelFactory.createModel(car);
View Full Code Here

Examples of com.tobedevoured.modelcitizen.model.Wheel

    }

    @Test
    public void testCreateModelWithConstructorCallBack() throws CreateModelException {

        Wheel wheel1 = modelFactory.createModel(Wheel.class);
        assertEquals("tire name", wheel1.getName());

        Wheel wheel2 = modelFactory.createModel(Wheel.class);
        assertEquals("tire name", wheel1.getName());

        assertFalse("Should create new instances", wheel1.equals(wheel2));
    }
View Full Code Here

Examples of items.Wheel

    assertTrue("Store0 Inventory missing Medicine", R0Store.getInventory().contains(new Medicine()));
    assertTrue("Store0 Inventory missing Axle", R0Store.getInventory().contains(new Axle()));
    assertTrue("Store0 Inventory missing Clothing", R0Store.getInventory().contains(new Clothing()));
    assertTrue("Store0 Inventory missing Oxen", R0Store.getInventory().contains(new Oxen()));
    assertTrue("Store0 Inventory missing Tongue", R0Store.getInventory().contains(new Tongue()));
    assertTrue("Store0 Inventory missing Wheel", R0Store.getInventory().contains(new Wheel()));
    //region 1 with most things available
    assertTrue("Store1 Inventory missing Food", R1Store.getInventory().contains(new Food()));
    assertTrue("Store1 Inventory missing Ammo", R1Store.getInventory().contains(new Ammo()));
    assertTrue("Store1 Inventory missing Water", R1Store.getInventory().contains(new Water()));
    assertTrue("Store1 Inventory missing Medicine", R1Store.getInventory().contains(new Medicine()));
    assertTrue("Store1 Inventory missing Axle", R1Store.getInventory().contains(new Axle()));
    assertFalse("Store1 Inventory not missing Clothing", R1Store.getInventory().contains(new Clothing()));
    assertTrue("Store1 Inventory missing Oxen", R1Store.getInventory().contains(new Oxen()));
    assertTrue("Store1 Inventory missing Tongue", R1Store.getInventory().contains(new Tongue()));
    assertFalse("Store1 Inventory not missing Wheel", R1Store.getInventory().contains(new Wheel()));
    //region 2 with less available
    assertTrue("Store2 Inventory missing Food", R2Store.getInventory().contains(new Food()));
    assertTrue("Store2 Inventory missing Ammo", R2Store.getInventory().contains(new Ammo()));
    assertFalse("Store2 Inventory not missing Water", R2Store.getInventory().contains(new Water()));
    assertFalse("Store2 Inventory not missing Medicine", R2Store.getInventory().contains(new Medicine()));
    assertTrue("Store2 Inventory missing Axle", R2Store.getInventory().contains(new Axle()));
    assertTrue("Store2 Inventory missing Clothing", R2Store.getInventory().contains(new Clothing()));
    assertFalse("Store2 Inventory not missing Oxen", R2Store.getInventory().contains(new Oxen()));
    assertFalse("Store2 Inventory not missing Tongue", R2Store.getInventory().contains(new Tongue()));
    assertTrue("Store2 Inventory missing Wheel", R2Store.getInventory().contains(new Wheel()));
    //region 3 with almost nothing available
    assertTrue("Store3 Inventory missing Food", R3Store.getInventory().contains(new Food()));
    assertFalse("Store3 Inventory not missing Ammo", R3Store.getInventory().contains(new Ammo()));
    assertFalse("Store3 Inventory not missing Water", R3Store.getInventory().contains(new Water()));
    assertTrue("Store3 Inventory missing Medicine", R3Store.getInventory().contains(new Medicine()));
    assertFalse("Store3 Inventory not missing Axle", R3Store.getInventory().contains(new Axle()));
    assertFalse("Store3 Inventory not missing Clothing", R3Store.getInventory().contains(new Clothing()));
    assertTrue("Store3 Inventory missing Oxen", R3Store.getInventory().contains(new Oxen()));
    assertFalse("Store3 Inventory not missing Tongue", R3Store.getInventory().contains(new Tongue()));
    assertFalse("Store3 Inventory not missing Wheel", R3Store.getInventory().contains(new Wheel()));
   
  }
View Full Code Here

Examples of items.Wheel

    itemInventory[3] = new Water();
    itemInventory[4] = new Axle();
    itemInventory[5] = new Clothing();
    itemInventory[6] = new Oxen();
    itemInventory[7] = new Tongue();
    itemInventory[8] = new Wheel();
  }
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.