To access parentAM instance from within nestedAM JUnit test class

Posted by Abhishek Dwivedi on Oracle Blogs See other posts from Oracle Blogs or by Abhishek Dwivedi
Published on Mon, 25 Jun 2012 06:54:53 +0000 Indexed on 2012/06/25 9:20 UTC
Read the original article Hit count: 297

Filed under:

In normal model project, the way to access parent AM from within nested AM is simple -

ParentAMImpl parentAM =  (ParentAMImpl)this.getRootApplicationModule();

However, the same approach doesn't help in JUnit model project. Use the following approach - 

Inside setUp() method --  ParentAM parentAM =  (ParentAM)Configuration.createRootApplicationModule(ROOT_AM, ROOT_AM_CONFIG);

Inside tearDown() method -- Configuration.releaseRootApplicationModule(parentAM, true);


© Oracle Blogs or respective owner

Related posts about /Oracle