Package org.openengsb.core.ekb.common.models

Examples of org.openengsb.core.ekb.common.models.PrimitivePropertiesModel


            ModelWrapper.isModel(model.getClass()), is(true));
    }

    @Test
    public void primitivePropertyConversion_toEDBObject_works() {
        PrimitivePropertiesModel model = new PrimitivePropertiesModel();
        model.setId("test");
        model.setBooleanByGet(true);
        model.setBooleanByIs(true);
        model.setPrimitiveChar(Character.MAX_VALUE);
        model.setPrimitiveDouble(Double.MAX_VALUE);
        model.setPrimitiveFloat(Float.MAX_VALUE);
        model.setPrimitiveInt(Integer.MAX_VALUE);
        model.setPrimitiveLong(Long.MAX_VALUE);
        model.setPrimitiveShort(Short.MAX_VALUE);
        ConnectorInformation id = getTestConnectorInformation();
        List<EDBObject> objects = converter.convertModelToEDBObject(model, id);
        EDBObject object = objects.get(0);
        // check entry types
        assertThat(object.get("booleanByGet").getType(), is(Boolean.class.getName()));
View Full Code Here


        object.putEDBObjectEntry("primitiveInt", Integer.MAX_VALUE);
        object.putEDBObjectEntry("primitiveLong", Long.MAX_VALUE);
        object.putEDBObjectEntry("primitiveFloat", Float.MAX_VALUE);
        object.putEDBObjectEntry("primitiveDouble", Double.MAX_VALUE);

        PrimitivePropertiesModel model = converter.convertEDBObjectToModel(PrimitivePropertiesModel.class, object);
        assertThat(model.getId(), is("test"));
        assertThat(model.getBooleanByGet(), is(true));
        assertThat(model.isBooleanByIs(), is(true));
        assertThat(model.getPrimitiveChar(), is(Character.MAX_VALUE));
        assertThat(model.getPrimitiveShort(), is(Short.MAX_VALUE));
        assertThat(model.getPrimitiveInt(), is(Integer.MAX_VALUE));
        assertThat(model.getPrimitiveLong(), is(Long.MAX_VALUE));
        assertThat(model.getPrimitiveFloat(), is(Float.MAX_VALUE));
        assertThat(model.getPrimitiveDouble(), is(Double.MAX_VALUE));
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.ekb.common.models.PrimitivePropertiesModel

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.