2

Any ideas how this can be done with Unitils dbunit? Date relative to current in the DBUnit dataset

The problem is that the [create_date]-placeholder is not recognized in @Dataset.

Community
  • 1
  • 1
mjgirl
  • 1,214
  • 7
  • 24
  • 42
  • You're question is a bit vague. What have you tried so far? Could you provide the logs or a description of what is happening? – Mark Robinson Apr 28 '13 at 02:35
  • I made this more of I need an example of using relative dates in unitils dataset -question. I have tried some code copied from the link provided, but getting errors about using []-placeholder in my xml. – mjgirl May 07 '13 at 07:47

1 Answers1

0

A simple solution might be to just use placeholders in your xml dataset, eg.

<?xml version='1.0' encoding='UTF-8'?> <dataset> <user userName="jdoe" name="doe" firstname="john" lastLogin="{YESTERDAY}" /> <user userName="jdoe" name="doe" firstname="jane" lastLogin="{A_WEEK_AGO}" /> </dataset>

and do some post-processing(replace the placeholders with the calculated values) before you run your tests. When you are using Maven, you could then first execute the post-processing, (fill in the values in the xml-template-dataset, copy the filled-in-xml-dataset to the correct folder), before any tests are executed.

davidcyp
  • 649
  • 8
  • 18