Examples of CField


Examples of com.pardot.rhombus.cobject.CField

        assertEquals(expected, result);
    }

    @Test
    public void typedObjectFromDoubleAndInteger() throws CObjectParseException {
        CField field = new CField("test", "int");
        double jsonValue = 1234.5678901234567;
        Integer expected = 1234;

        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 typedObjectFromIntAndTimestamp() throws CObjectParseException {
        CField field = new CField("test", "timestamp");
        Integer jsonValue = 1376079900;
        Date expected = new Date(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 typedObjectFromLongAndTimestamp() throws CObjectParseException {
        CField field = new CField("test", "timestamp");
        Long jsonValue = 1376079900000L;
        Date expected = new Date(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 typedObjectFromDateAndTimestamp() throws CObjectParseException {
        CField field = new CField("test", "timestamp");
        Date jsonValue = new Date(1376079900000L);

        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 typedObjectFromStringAndUUID() throws CObjectParseException {
        CField field = new CField("test", "uuid");
        UUID expected = UUID.randomUUID();
        String jsonValue = expected.toString();

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

Examples of com.pardot.rhombus.cobject.CField

        assertEquals(result, result);
    }

    @Test
    public void typedObjectFromUUIDAndUUID() throws CObjectParseException {
        CField field = new CField("test", "uuid");
        UUID jsonValue = UUID.randomUUID();

        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 typedObjectFromIntegerAndVarint() throws CObjectParseException {
        CField field = new CField("test", "varint");
        Integer jsonValue = 1234567890;
        BigInteger expected = new BigInteger("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
    public void typedObjectFromLongAndVarint() throws CObjectParseException {
        CField field = new CField("test", "varint");
        Long jsonValue = 1234567890123456789L;
        BigInteger expected = new BigInteger("1234567890123456789");

        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 typedObjectFromFloatAndVarint() throws CObjectParseException {
        CField field = new CField("test", "varint");
        Float jsonValue = 1234.56f;
        BigInteger expected = new BigInteger("1234");

        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 typedObjectFromDoubleAndVarint() throws CObjectParseException {
        CField field = new CField("test", "varint");
        Double jsonValue = 1234567890.1234567;
        BigInteger expected = new BigInteger("1234567890");

        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.