Package org.openx.data.jsonserde.objectinspector.primitive

Examples of org.openx.data.jsonserde.objectinspector.primitive.JavaStringTimestampObjectInspector


    JSONObject result = (JSONObject) instance.deserialize(w);
   
    StructObjectInspector soi = (StructObjectInspector) instance.getObjectInspector();
   
    JavaStringTimestampObjectInspector jstOi = (JavaStringTimestampObjectInspector)
            soi.getStructFieldRef("five").getFieldObjectInspector();
    assertEquals(Timestamp.valueOf("2013-03-27 23:18:40.0"), jstOi.getPrimitiveJavaObject(result.get("five")));
  }
View Full Code Here


    JSONObject result = (JSONObject) instance.deserialize(w);
   
    StructObjectInspector soi = (StructObjectInspector) instance.getObjectInspector();
   
    JavaStringTimestampObjectInspector jstOi = (JavaStringTimestampObjectInspector)
            soi.getStructFieldRef("five").getFieldObjectInspector();
    assertEquals( Timestamp.valueOf("2013-03-27 23:18:40.123456"),  jstOi.getPrimitiveJavaObject(result.get("five")));
  }
View Full Code Here

    // Test that timestamp object can be deserialized
    Writable w = new Text("{\"one\":true,\"five\":1367801925}");

    JSONObject result = (JSONObject) instance.deserialize(w);
     StructObjectInspector soi = (StructObjectInspector) instance.getObjectInspector();
    JavaStringTimestampObjectInspector jstOi = (JavaStringTimestampObjectInspector)
            soi.getStructFieldRef("five").getFieldObjectInspector();
    assertEquals(getDate("2013-05-05 17:58:45.0" ),
            jstOi.getPrimitiveJavaObject(result.get("five"))   );
  }
View Full Code Here

    // Test that timestamp object can be deserialized
    Writable w = new Text("{\"one\":true,\"five\":1367801925.123}");
//
    JSONObject result = (JSONObject) instance.deserialize(w);
     StructObjectInspector soi = (StructObjectInspector) instance.getObjectInspector();
    JavaStringTimestampObjectInspector jstOi = (JavaStringTimestampObjectInspector)
            soi.getStructFieldRef("five").getFieldObjectInspector();
    assertEquals(getDate("2013-05-05 17:58:45.123"),
            jstOi.getPrimitiveJavaObject(result.get("five")) );
  }
View Full Code Here

TOP

Related Classes of org.openx.data.jsonserde.objectinspector.primitive.JavaStringTimestampObjectInspector

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.