MockServletContext servletContext = new MockServletContext();
ServletLifecycle.beginApplication(servletContext);
new Initialization( servletContext ).create().init();
Lifecycle.beginCall();
Contexts.getEventContext().set(Seam.getComponentName(Transaction.class), new NoTransaction());
MyEntityHome myEntityHome = (MyEntityHome) Component.getInstance("myEntityHome");
assert myEntityHome != null;
// verify that the reference to new-instance remains unparsed
Assert.assertEquals(myEntityHome.getNewInstance().getExpressionString(), "#{simpleEntity}");
// verify that the message string for the created/updated/deleted message remains unparsed
Assert.assertEquals(myEntityHome.getCreatedMessage().getExpressionString(), "You #{'created'} it! Yeah!");
// verify that the id is parsed prior to assignment
Assert.assertEquals(String.valueOf(myEntityHome.getId()), "11");
ServletLifecycle.endApplication();
}