Examples of CField


Examples of com.pardot.rhombus.cobject.CField

        JsonUtil.typedObjectFromValueAndField(jsonValue, field);
    }

    @Test
    public void typedObjectFromIntAndFloat() throws CObjectParseException {
        CField field = new CField("test", "float");
        Integer jsonValue = 1234567890;
        float expected = 1234567890f;

        Object result = JsonUtil.typedObjectFromValueAndField(jsonValue, field);
        assertEquals(expected, result);
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

        assertEquals(expected, result);
    }

    @Test
    public void typedObjectFromLongAndFloat() throws CObjectParseException {
        CField field = new CField("test", "float");
        Long jsonValue = 123456789012345L;
        float expected = 123456789012345f;

        Object result = JsonUtil.typedObjectFromValueAndField(jsonValue, field);
        assertEquals(expected, result);
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

        assertEquals(expected, result);
    }

    @Test
    public void typedObjectFromFloatAndFloat() throws CObjectParseException {
        CField field = new CField("test", "float");
        float jsonValue = 1234.56f;

        Object result = JsonUtil.typedObjectFromValueAndField(jsonValue, field);
        assertEquals(jsonValue, result);
    }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

        assertEquals(jsonValue, result);
    }

    @Test
    public void typedObjectFromDoubleAndFloat() throws CObjectParseException {
        CField field = new CField("test", "float");
        double jsonValue = 1234.5678901234567;
        float expected = 1234.5678901234567f;

        Object result = JsonUtil.typedObjectFromValueAndField(jsonValue, field);
        assertTrue(Float.class.isAssignableFrom(result.getClass()));
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

        assertEquals(expected, (Float)result, jsonValue * (1E-6));
    }

    @Test
    public void typedObjectFromBooleanAndInteger() throws CObjectParseException {
        CField field = new CField("test", "int");
        Boolean jsonValue = true;
        Integer expected = 1;

        Object result = JsonUtil.typedObjectFromValueAndField(jsonValue, field);
        assertEquals(expected, result);
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

        assertEquals(expected, result);
    }

    @Test
    public void typedObjectFromLegitStringAndInteger() throws CObjectParseException {
        CField field = new CField("test", "int");
        String jsonValue = "1234567890";
        Integer expected = 1234567890;

        Object result = JsonUtil.typedObjectFromValueAndField(jsonValue, field);
        assertEquals(expected, result);
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

        assertEquals(expected, result);
    }

    @Test(expected=IllegalArgumentException.class)
    public void typedObjectFromCrapStringAndInteger() throws CObjectParseException {
        CField field = new CField("test", "int");
        String jsonValue = "I like ponies";

        JsonUtil.typedObjectFromValueAndField(jsonValue, field);
    }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

        JsonUtil.typedObjectFromValueAndField(jsonValue, field);
    }

    @Test
    public void typedObjectFromIntAndInteger() throws CObjectParseException {
        CField field = new CField("test", "int");
        Integer jsonValue = 1234567890;

        Object result = JsonUtil.typedObjectFromValueAndField(jsonValue, field);
        assertEquals(jsonValue, result);
    }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

        assertEquals(jsonValue, result);
    }

    @Test
    public void typedObjectFromLongAndInteger() throws CObjectParseException {
        CField field = new CField("test", "int");
        Long jsonValue = 1234567L;
        Integer expected = 1234567;

        Object result = JsonUtil.typedObjectFromValueAndField(jsonValue, field);
        assertEquals(expected, result);
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

        assertEquals(expected, result);
    }

    @Test
    public void typedObjectFromFloatAndInteger() throws CObjectParseException {
        CField field = new CField("test", "int");
        Float jsonValue = 1234.56f;
        Integer expected = 1234;

        Object result = JsonUtil.typedObjectFromValueAndField(jsonValue, field);
        assertEquals(expected, result);
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.