This content has been marked as final.
Show 3 replies
-
1. Re: test on ejb3 with junit by eclipse
jaikiran Aug 6, 2009 4:56 AM (in response to folal)(javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an application
resource file: java.naming.factory.initial).
See this http://www.jboss.org/community/wiki/GetquotjavaxnamingNoInitialContextExceptionquot -
2. Re: test on ejb3 with junit by eclipse
wolfgangknauf Aug 6, 2009 5:31 AM (in response to folal)Hi Alan,
for using Dependeny injection in your Unit Tests (which are actually application clients), you have to do some very special tasks to start it. Here is a doc which describes the required steps for a standalone application client: http://www.jboss.org/community/wiki/HowtouseanapplicationclientinJBoss-5
But I fear this cannot be applied to JUnit, as you cannot use "org.jboss.client.AppClientMain" to run a test.
So I think you have to perform a JNDI lookup in the JUnit tests.
Best regards
Wolfgang -
3. Re: test on ejb3 with junit by eclipse
folal Aug 6, 2009 5:37 AM (in response to folal)Thank a lot!!