I have a layered verification environment i.e. testcase extends sub_test_base; sub_test_base extends global_test_base etc. Same hierachy applies also to the env. At the global level we create a global env variable inside global test base. At the sub layer, we would like to utilize the env variable created at the global layer. The problem is that we should be able to change the type of the env variable to be the sub env type. Sub env type extends global env type, but it also brings some new properties like new agents, and methods as well. My first idea was to make global test base parameterized, so you can deliver the correct env type with help of parameterization. But I don't know if it is the best way to do it... Could you help me, please? Basically, I think we have a couple of alternatives:
1) Parameterize global test base with env type as mentioned above, or
2) Use type overriding at the sub layer to override the type of the env variable introduced in global testbase. But with that approach you are not able to access directly the overriden properties vai global env type variable (m_env) like sequencer of sub layer agent m_env.agent_in_subenv.sequencer.
What is the preferred approach in my case?
Thanks already in advance for your answers.