> On Dec. 7, 2014, 8:37 p.m., Qian Xu wrote: > > connector/connector-sdk/src/test/java/org/apache/sqoop/connector/idf/TestCSVIntermediateDataFormat.java, > > line 402 > > <https://reviews.apache.org/r/28782/diff/1/?file=784393#file784393line402> > > > > The minutes second and millis parts are always zero. I'd suggest > > construct a random datetime value (i.e. `now`) as fixture, so that they > > will all get tested. > > > > DateTime fixture = DateTime.now() > > dateFormat.setTextData(fixture.toString("YYYY-mm-dd HH:MM:SS.zz"); > > assertEquals(fixture.toString(), > > dateFormat.getObjectData()[0].toString()); > > > > Nits: I'd suggest remove three note comments. > > Veena Basavaraj wrote: > whats wrong with the notes :) > > Qian Xu wrote: > What is the propose of the test case then? Does it check, whether a > DateTime field is able to be stored as a datetime object (in our case a joda > datetime)? I thought we expect `dataFormat.getObjectData()[0]` to be a > `org.jodatime.DateTime` object and the value equals to the expected datetime > value. > > Instead of > > // NOTE: string representation will have the T added, it is an > // implementation quirk of using JODA > assertEquals("2014-10-01T12:00:00.000-04:00", > dataFormat.getObjectData()[0].toString()); > > My first thought of the test code would be > > DateTimeZone zone = DateTimeZone.forID("America/New_York"); > org.joda.time.DateTime expectedDateTime = new > org.joda.time.DateTime(2014, 10, 01, 12, 0, 0, 0, zone); > assertTrue(dataFormat.getTextData() instanceof new > org.joda.time.DateTime); > assertEquals(expectedDateTime, dataFormat.getObjectData()[0]);
it covers both the object and string, see the line before tha note that asserts the object. - Veena ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/28782/#review64192 ----------------------------------------------------------- On Dec. 8, 2014, 11:33 a.m., Veena Basavaraj wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/28782/ > ----------------------------------------------------------- > > (Updated Dec. 8, 2014, 11:33 a.m.) > > > Review request for Sqoop. > > > Bugs: SQOO-1845 > https://issues.apache.org/jira/browse/SQOO-1845 > > > Repository: sqoop-sqoop2 > > > Description > ------- > > see jira > > > Diffs > ----- > > common/src/main/java/org/apache/sqoop/json/util/SchemaSerialization.java > 2f5fadc > common/src/main/java/org/apache/sqoop/schema/type/DateTime.java 791542a > common/src/main/java/org/apache/sqoop/schema/type/Time.java 9765eab > > common/src/test/java/org/apache/sqoop/json/util/TestSchemaSerialization.java > 3d31600 > > connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/util/SqlTypesUtils.java > 9d50dc3 > > connector/connector-sdk/src/main/java/org/apache/sqoop/connector/idf/CSVIntermediateDataFormat.java > daa51eb > > connector/connector-sdk/src/test/java/org/apache/sqoop/connector/idf/TestCSVIntermediateDataFormat.java > e66c897 > > Diff: https://reviews.apache.org/r/28782/diff/ > > > Testing > ------- > > yes > > > Thanks, > > Veena Basavaraj > >
