Examples of CField


Examples of com.pardot.rhombus.cobject.CField

        CDefinition def = CDefinition.fromJsonString(json);
        Map<String, CField> fields = def.getFields();
        //Make sure the size is correct
        assertEquals(7, fields.size());
        //Check the first field
        CField field = fields.get("foreignid");
        assertEquals("foreignid", field.getName());
        assertEquals(CField.CDataType.BIGINT, field.getType());
    }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

* Date: 4/5/13
*/
public class CFieldTest extends TestCase{

  public void testEquals() {
    CField field1 = new CField("Name", CField.CDataType.ASCII);
    CField field2 = new CField("Name", CField.CDataType.ASCII);
    assertTrue(field1.equals(field2));
  }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

    CField field2 = new CField("Name", CField.CDataType.ASCII);
    assertTrue(field1.equals(field2));
  }

  public void testNotEqualsType() {
    CField field1 = new CField("Name", CField.CDataType.ASCII);
    CField field2 = new CField("Name", CField.CDataType.BIGINT);
    assertFalse(field1.equals(field2));
  }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

    CField field2 = new CField("Name", CField.CDataType.BIGINT);
    assertFalse(field1.equals(field2));
  }

  public void testNotEqualsName() {
    CField field1 = new CField("Name", CField.CDataType.ASCII);
    CField field2 = new CField("Name2", CField.CDataType.ASCII);
    assertFalse(field1.equals(field2));
  }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CField

public class JsonUtilTest extends JsonUtil{

    @Test
    public void typedObjectFromStringAndVarchar() throws CObjectParseException {
        CField field = new CField("test", "varchar");
        String jsonValue = "123456789";
        String expected = "123456789";

        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 typedObjectFromIntegerAndVarchar() throws CObjectParseException {
        CField field = new CField("test", "varchar");
        Integer jsonValue = 123456789;
        String expected = "123456789";

        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 typedObjectFromDateAndVarchar() throws CObjectParseException {
        CField field = new CField("test", "varchar");
        Date jsonValue = new Date(1376079901000L);
        String expected = jsonValue.toString();

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

Examples of com.pardot.rhombus.cobject.CField

        assertEquals(expected, result.toString());
    }

    @Test
    public void typedObjectFromIntegerAndBigint() throws CObjectParseException {
        CField field = new CField("test", "bigint");
        Integer 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
    public void typedObjectFromLongAndBigint() throws CObjectParseException {
        CField field = new CField("test", "bigint");
        Long jsonValue = 123456789012345L;

        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 typedObjectFromFloatAndBigint() throws CObjectParseException {
        CField field = new CField("test", "bigint");
        Float jsonValue = 1234.56f;
        Long expected = 1234L;

        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.