> I do not want to have redundance of code and write the same code in each aa_register_case .
I guess you haven't found it yet, if not I assume you would have the decency to post your discovery here.
First, look at this: aa_register_init_class, "Registers a initialisation class to be used by one or more testcases. An initialisation class can be assigned to a testcase via the aa_register_case proc."
Also, useful stuff is to:
Use aa_register_component: "Registers a re-usable code component"
And then call it at your test case using: aa_call_component
Next time, at least spend some time searching the aa_* API, and grep /packages/, like /news that has some good examples, there are more than 4000 test cases in openacs to use as guidance...
More info here: https://openacs.org/doc/openacs-5-1/tutorial-debug.html