As a former java guy with sound testing background, I am now in contact with mainframe / cobol stuff in the financial industry.
I want automated tests, but learned that it is really difficult to implement in our context so I ask here for advice.
1) My plan would be implementing a junit-based test-driver in java to call cobol stuff via stored-procedures, MQ or similar and to check the actual result in various DB2 tables. No problem here from MPOV.
2) The tricky thing is the context / data and here especially the date:
=> How can we avoid this single locking? How can things like a global current date, or current exchange rates be easily synthesized?
(current ideas are about cloning the whole context on a daily, weekly, monthly basis. This way one can still lock the given context. But I dislike the idea of "locking" or "owning" at all.)
This is a trick thing with any automated unit testing -- even Junit testing.
The answer is you must pass in the dates. Set up wrappers to "read current date and add it to the parameter list" for production, but have your unit tests call the modules that receive the date.
That is the only way to keep your tests from getting stale in any language or environment.