0

Currently I am using DDsteps as a datadriven testing framework for my unit tests. It works quite well, except when inserting DateTime data into the database.

Example data input row (stored in excel):

APS_ID
99${my.unique_four_digits}
APS_LOGIN_DT
3/21/2007 8:52

DDsteps will generate this SQL to load the date time field:

  • insert into MySchema.Applications (APS_ID, APS_LOGIN_DT) values (?, ?)
  • insert into MySchema.Applications (APS_ID, APS_LOGIN_DT) values ('993919', '2007-03-21')

How do I get DDsteps to recognize the time stamp on the input data row?

updated:

  • www.ddsteps.org
  • These data driven tests are run against an oracle database
AdrianHHH
  • 13,492
  • 16
  • 50
  • 87
DefyGravity
  • 5,681
  • 5
  • 32
  • 47
  • DDsteps does not handle time stamp values from the excel spreadsheet correctly. DDsteps will truncate the time stamp value before feeding it to DBUnit for insertion. thanks MLK, you pointed me in the right direction, which eventually got me to the 'aha!' of what's going on. my current work around is inside unit tests that require it. Another 'update myTable set myTable.dateTime = to_date('my/da/te ti:me:00','mm/dd/yy HH24:MI') where myTable.ID = idWanted' database call is executed. dd – DefyGravity Oct 14 '09 at 18:08

1 Answers1

0

A quick look at the DDSteps site and it looks to be using DbUnit under the hood. Do you mind if I ask what database server you are using? I had to use the OracleDataTypeFactory to get DbUnit to accept date times.

Michael Lloyd Lee mlk
  • 14,561
  • 3
  • 44
  • 81
  • had to restart my workstation, i'll definately give that a look and get back to you – DefyGravity Oct 14 '09 at 15:47
  • Yes, it appears the dbConnection was using the dbunit DefaultDataTypeFactory. Yes, I should probably use the OracleDataTypeFactory. – DefyGravity Oct 14 '09 at 17:10
  • before I load data, I followed DBunit's steps to use their OracleDataTypeFactory. before the test loads any data, but after it gets a db connection. No change on insertion/update SQL created. – DefyGravity Oct 14 '09 at 17:18