How to Add a New Date Format to Magic String Automatically in VSI?
search cancel

How to Add a New Date Format to Magic String Automatically in VSI?

book

Article ID: 10889

calendar_today

Updated On:

Products

CA Application Test CA Continuous Application Insight (PathFinder) Service Virtualization

Issue/Introduction

This article will provide information on adding a specific date format to DevTest.

The VSE date utilities use the Date-Checker properties to determine which date patterns are considered magic string conversions. 

DevTest will magic string dates in VS responses automatically using doDateDeltaFromCurrent("yyyy-MM-dd","0D") and doDateDeltaFromRequest("yy-MM-dd", "2D"). 

doDateDeltaFromCurrent("yyyy-MM-dd","0D") and doDateDeltaFromRequest("yy-MM-dd", "2D") uses the format specified in lisa.properties file.

If VS response has any other date formats which are not defined in lisa.properties, then the specific format(s) need to be added to local.properties.

Note: We don't recommend make modifications to lisa.properties. You need to add to local.properties.

 

 

Environment

All support releases and platforms of DevTest.

Cause

N/A

Resolution

You can magic string specific date format(s) in VSI response by doing the below.

First need to add the regular expression of the date format to local.properties in the Date-Checker properties.

Note: Need to validate the regular expression with the date format. DevTest provides Regular Expression Helper which is available in Workstation-->Help-->Regular Expression Helper or some other Regular Expression validator tool can be used.  

Then add the specific date format to local.properties in the Date format section.

 

 

Additional Information

Documentation on Magic Dates: Refer to section "Magic Dates" in the documentation of the DevTest release you are running.

Documentation on Date-Checker properties and formats: Refer to section "VSE Properties" in the documentation of the DevTest release you are running.