Tips for testing stashing
Stashing is an operation that combines multiple different steps, so it must be tested properly at the time when you prepare the upgrade scripts in Development.
The following are tips for testing the default XML/XSL implementation of stashing outlined in the " Stashing " help topic.
Identify the statements using Descriptions
Write the statements in the Pre-upgrade and Post-upgrade scripts. For traceability, make sure you identify the subject of the operation in the Descriptions field. For example, to stash, upgrade and re-apply the contents of a table called Parameters, write "Parameters" in the Description of the XML.EXPORT statement and also in the description of the XML.IMPORT statement.
Prepare to revert to the old situation
In the database where you test, it must be easy to re-initialise the test: to revert all the data to the pre-upgrade situation so that you can run the test repeatedly. Use one of Delivery Manager's data management actions to clear all the data and re-import a dataset stored on file.
Having the scripts checked
When you have finished writing the statements, have both the Pre-upgrade and the Post-upgrade script checked (press the Check button in the Current Upgrade Scripts window).
The Pre-upgrade script must be checked against a repository that contains the "old" version of the application. You must identify this repository by setting the "Source for pre-upgrade check" Application attribute (choose Define, Applications from the menu). You could use the test repository, but in that case you must have the discipline to always re-initialise test data just prior to having the pre-upgrade script checked. If possible, it is better to use a different repository that you know will contain the previous version of the application.
The Post-upgrade script must be checked against a repository that contains the "new" version of the application. You must identify this repository by setting the "Source for post-upgrade check" Application attribute. Typically, this will simply be the repository where you are developing your stashing scripts.
Test the Output Statements
When the scripts are checked, in the right bottom corner of the Current Upgrade scripts window, select the Output Statements. Copy and paste the XML.EXPORT Output Statement from the Pre-upgrade script and run it in SQL Command in the test database account.
The next step is to upgrade the test dataset by running the create-tables script. In parallel, make sure the stashed data is transformed:
•If you implemented the data transformation using added XSL, the XSL is already included in the Output Statement.
•If you implemented the data transformation using USXSL.APPLY2FILE, you need to run also that Output Statement.
The last step is to reclaim the stashed and transformed data. Do this, again, by cutting and pasting the Output Statement for the XML.IMPORT statement in the Post-upgrade script.
This is only a general indication of how to proceed. In practice, the variations are endless: depending on your situation, it may be necessary to execute not just the Output Statements of the XML.EXPORT and XML.IMPORT statements, but also of other surrounding statements in the scripts that are immediately related.