This section contains a set of loosly coupled information that will not take a complete section on its own.
Name | Description |
---|---|
!NULL! | Used to specify that a certain field/object should be null |
!EMPTY! | Used to specify an empty String object. - Restricted to type String! |
!BLANK! | Used to specify a blank String (one Space char). - Restricted to type String! |
<obj id="myExample" type="junitx.ddtunit.resources.SimpleVO">!NULL!</obj>
Processing information about date - java.util.Date, java.sql.Date, java.text.Date
Three examples
<obj id="myDate" hint="date" type="java.util.Date">01.05.2005 00:00:00.000</obj>
<obj id="myDate" hint="date" type="date">01.05.2005 00:00:00</obj>
<obj id="myDate" hint="date" type="udate">01.05.2005</obj>
<obj id="myDate" hint="date" type="date" dateformat="EEE MMM dd HH:mm:ss zzz yyyy" locale="en_US"> Thu Dec 06 12:15:00 CET 2007</obj>
To specify an actual date or time new keywords are introduced
Name | Description |
---|---|
!SYSDATE! | Specifies the actual date of test execution, time is set to zero |
!SYSTIME! | Specifies the actual date and time of test execution. |
Because there were a few requests on special date format support DDTUnit it is now possible to process the following example test as used in the functional testing suite of DDTUnit:
<test id="readFreeDate"> <objs> <obj id="myDate" hint="date" type="date" dateformat="EEE MMM dd HH:mm:ss zzz yyyy">Thu Dec 06 10:11:12 CET 2007</obj> </objs> <asserts> <assert id="result" hint="date" type="date" action="isEqual">06.12.2007 10:11:12</assert> </asserts> </test> <test id="readFreeDateWithLocale"> <objs> <obj id="myDate" hint="date" type="date" dateformat="EE MMM dd HH:mm:ss zzz yyyy" locale="de_DE">Di Dez 06 10:11:12 MET 2007</obj> </objs> <asserts> <assert id="result" hint="date" type="date" action="isEqual">06.12.2007 10:11:12</assert> </asserts> </test>
This date format is interpreted during parse time and instanciates the requested Date.