JUnit: How to access rootAM from within nestedAM?
By Abhishek Dwivedi on Jun 25, 2012
In normal model project, the way to access root AM from within nested AM is simple -
RootAMImpl rootAM = (RootAMImpl)this.getRootApplicationModule();
However, the same approach doesn't help in JUnit model project. Use the following approach -
Inside setUp() method -- RootAM rootAM = (RootAM)Configuration.createRootApplicationModule(ROOT_AM, ROOT_AM_CONFIG);
Inside tearDown() method -- Configuration.releaseRootApplicationModule(rootAM , true);