This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi helpers and supporters, I have a J2EE application running on Websphere (WSAD) and I have written some JUnit testcase for this application. All this stuff was already running on WebLogic and now I have migrated it to WebSphere. Some of the JUnit testcases directly make a lookup on the DataSources without using an EJB in between. In WebLogic I was able to lookup the DataSources directly from the JUnit testcase, but in WebSphere (WSAD) I get a SecurityException when I try to do this. This happens even I disabled all security stuff in WSAD. Why is it not possible to lookup a DataSource from a Java application directly (outside the container)? Any idea how I can make it? Thanks a lot
It is possible but you need to use the Application Container (launch Client). This is all covered in detail in my book -- but the short answer is you need to package your JUnit tests into an Application Client project and put that in an EAR file. Then you can use Run... to set up an Application Client runner for your Tests, using the JUnit test runner as the main() class. Kyle
Hi, Thanks a lot for a quick answer! I think I understood what you mean. I already started to setup a new client project and to include a first JUnit testcase here. So I should be able to assign the required references like EJB and DataSource references to this client project later on, right? Then I will try to start the different JUnit test classes from Run.. and the different available main methods. Let's see if I can manage this... - fidi