Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 89743 invoked by uid 500); 10 Apr 2001 20:19:34 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 89389 invoked from network); 10 Apr 2001 20:19:28 -0000 Message-ID: <3AD36A9E.5DFC35E1@iso-ne.com> Date: Tue, 10 Apr 2001 16:18:38 -0400 From: Jim Doyle X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: ant-user@jakarta.apache.org Subject: Running junit tests that access EJBs Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hi, I looked on this list for some suggestions about how to use Ant to manage unit tests for EJBs, and it seemed that a couple people had the approach of running the server in one Ant instance (using wlrun) and running the junit test in another Ant instance. I've got the server part working fine, but I'm having trouble with my client. I can run the JUnit test from the command line with no problem. I can also run it with a forked java task, like this: But I would like to use the junit task, which I use for my other unit tests, and that doesn't work unless I put weblogic in my CLASSPATH for Ant. I've tried: but it throws a "java.lang.NoClassDefFoundError: javax/ejb/CreateException". I've also tried eliminating the classpath element, and it throws a "javax.naming.NoInitialContextException, java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory". If I put my weblogic classpath into the Ant classpath, it works OK, but I'd prefer to have the classpath in my build file. So: 1) Does anybody know why the class loading is behaving the way it does? I can dump some debugging output if it would help. 2) How are others out there running JUnit tests that use EJBs? Do you use a forked java task, or put weblogic in Ant's CLASSPATH, or is there some other way? Thanks for your help! -- Jim Doyle jdoyle@iso-ne.com