Really great work! This is really cool.
On Sep 23, 2009, at 6:12 AM, Quintin Beukes wrote:
It would work great if you could "hint" to OpenEJB a "LocalClient".
This way the user doesn't have to @LocalClient his EJBs, and the
Runner can hint to OpenEJB which objects to do it for.
We could definitely work up something like that.
To modify the existing runner into using @LocalClient instead, VERY
easy. Just do the following:
1. In the OpenEjbRunner.java file, replace the configureTest(Class
testObj) method with the following:
protected void configureTest(Object testObj) throws Exception
{
initialContext.bind("inject", testObj);
}
Right, that'd be the preferred way to go.
The remaining open issue for the test runner which kind of puzzled me
was some way to pass properties to the InitialContext. We could have
a @Properties or @Options annotation. But the tradeoff there is you
can't change the properties per test method -- it'd be static per test
class. The other is maybe an annotation you could put on a field of
type Properties (or method that returns properties). Not sure,
neither really have that "that's perfect" feel to them. Need some
real out of the box thinking. I'm sure there's a good technique just
waiting to be discovered.
For interest sake, did the attachment go through?
Yes it did. We can't take code over email though for licensing
reasons. You need to file a jira and be sure to check the box that
says you agree to have it licensed ASL.
-David