I'm currently writing seam tests, running the Microcontainer. I need to access a Hibernate MBean, from my test.
If I wasn't running the Microcontainer, I would write something like this:
InitialContext ctx = new InitialContext();
SessionFactory sf = (SessionFactory)
Session hsess = sf.getCurrentSession();
Session dynaSess = hsess.getSession(EntityMode.MAP);
Query qry = dynaSess.createQuery("select foo from bar where fooName=?");
qry.setParameter(0, new String("name"));
List result = qry.list();
How do I achieve this running the Microcontainer? How do I deploy the Hibernate service (MBean) and how do I access it from the test?
Best regards, Fredrik
As a clearification: I'm also running embedded EJB on top of the microcontainer. I'm a little bit unsure where my problem belongs.