Examples of CField


Examples of com.pardot.rhombus.cobject.CField

        assertEquals(expected, result);
    }

    @Test
    public void typedObjectFromDoubleAndBigint() throws CObjectParseException {
        CField field = new CField("test", "bigint");
        Double jsonValue = 1234567890.1234567;
        Long expected = 1234567890L;

        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 typedObjectFromLegitStringAndBigint() throws CObjectParseException {
        CField field = new CField("test", "bigint");
        String jsonValue = "1234567890";
        Long expected = 1234567890L;

        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 typedObjectFromCrapStringAndBigint() throws CObjectParseException {
        CField field = new CField("test", "bigint");
        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 typedObjectFromIntegerAndBoolean() throws CObjectParseException {
        CField field = new CField("test", "boolean");
        Integer jsonValue = 1234;
        assertEquals(true, JsonUtil.typedObjectFromValueAndField(jsonValue, field));
    }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

        assertEquals(true, JsonUtil.typedObjectFromValueAndField(jsonValue, field));
    }

    @Test
    public void typedObjectFromTrueStringAndBoolean() throws CObjectParseException {
        CField field = new CField("test", "boolean");
        String jsonValue = "true";
        Boolean expected = true;

        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 typedObjectFromNumericalStringAndBoolean() throws CObjectParseException {
        CField field = new CField("test", "boolean");
        String jsonValue = "1";
        Boolean expected = true;

        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 typedObjectFromLegitStringAndDecimal() throws CObjectParseException {
        CField field = new CField("test", "decimal");
        String jsonValue = "1234567890.12345678";
        BigDecimal expected = new BigDecimal("1234567890.12345678");

        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 typedObjectFromCrapStringAndDecimal() throws CObjectParseException {
        CField field = new CField("test", "decimal");
        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 typedObjectFromIntAndDecimal() throws CObjectParseException {
        CField field = new CField("test", "decimal");
        Integer jsonValue = 1234567890;
        BigDecimal expected = BigDecimal.valueOf(jsonValue);

        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 typedObjectFromLongAndDecimal() throws CObjectParseException {
        CField field = new CField("test", "decimal");
        Long jsonValue = 123456789012345L;
        BigDecimal expected = BigDecimal.valueOf(jsonValue);

        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.