Is there any way I can specify the current system time for my testcase?
The simplest way is to use the ReplacementTable/ReplacementDataSet. ITable actualTable = … // Load actual table from database or somewhere else ITable table = new XmlDataSet(new FileInputStream(“myFile.xml”)).getTable(“TABLE”); ReplacementTable replacementTable = new ReplacementTable(table); replacementTable.addReplacementObject(“special-now”, new java.util.Date(System.currentTimeMillis())); Assertion.assertEquals(replacementTable, actualTable); Every “special-now” column value from your XML-dataset will be replaced by the current systime represented by a java.util.Date object.
Related Questions
- Word on the street is that Administrators are going to have to clock in and out everyday under the new Time & Labor system. Is that true?
- What happens to compensatory time accrued when the new Time & Labor system goes "live?" How does it get entered into the new system?
- Is there any way I can specify the current system time for my testcase?