Package com.tobedevoured.modelcitizen

Examples of com.tobedevoured.modelcitizen.Erector


    @Test
    public void testBlueprintWithPrimitive() throws CreateModelException, BlueprintTemplateException {
        Car car = modelFactory.createModel(Car.class);

        Erector erector = modelFactory.getErectors().get(Car.class);

        ModelField modelField = erector.getModelField("mileage");
        assertEquals(new Float(100.1), modelField.getValue());

        // Val is zero because primitive initializes as zero
        Object val = erector.getTemplate().get(new Car(), "mileage");
        assertEquals(new Float(0.0), val);

        // Val is zero because primitive initializes as zero
        assertEquals(0.0, car.getMileage(), 0);
    }
View Full Code Here


        assertFalse("Should create new instances", wheel1.equals(wheel2));
    }

    @Test
    public void testBlueprintConstructorOnlyTriggeredOncePerCreateModelInvocation() throws Exception {
        Erector erector = mock(Erector.class);
        modelFactory.getErectors().put(Car.class, erector);
        modelFactory.createModel(Car.class);
        verify(erector, times(1)).createNewInstance();
    }
View Full Code Here

        assertTrue("UserBlueprint should be registered", blueprintClasses.contains(UserBlueprint.class));
    }

    @Test
    public void springShouldInjectsBlueprint() {
        Erector erector = modelFactory.getErectors().get(SportsCar.class);
        assertNotNull( "ModelFactory should get injected from spring into Blueprint", ((SportsCarBlueprint) erector.getBlueprint()).modelFactory );
    }
View Full Code Here

TOP

Related Classes of com.tobedevoured.modelcitizen.Erector

Copyright © 2018 www.massapicom. 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.