ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Atul Tiwary" <>
Subject RE: Running junit tests that access EJBs
Date Wed, 11 Apr 2001 00:11:05 GMT
could someone send me an excerpt of there build.xml where you use
<wlrun> to start weblogic.

-----Original Message-----
From: Andrew Sliwkowski []
Sent: Tuesday, April 10, 2001 5:13 PM
Subject: RE: Running junit tests that access EJBs

Check out
for lots of good ideas

Andrew Sliwkowski
Bea Systems Inc
Cluster Engineering
<phone:  603.579.2572>

-----Original Message-----
From: Jim Doyle []
Sent: Tuesday, April 10, 2001 4:19 PM
Subject: Running junit tests that access EJBs

    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:
  <property name="jdbc.driver.class.path"

  <property name="weblogic.home"
  <property name="weblogic.class.path"

  <target name="" depends="compile">
    <java classname="junit.textui.TestRunner" fork="yes">
      <sysproperty key="java.naming.provider.url"
      <arg value="PowerSystemEjbTest"/>


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:
  <target name="test.ejb.cp" depends="compile">
    <junit haltonfailure="yes">
      <sysproperty key="java.naming.provider.url"
      <classpath path="${weblogic.class.path}"/>
        <formatter type="plain" usefile="no"/>
        <fileset dir="${basedir}">
          <include name=""/>
but it throws a "java.lang.NoClassDefFoundError:
I've also tried eliminating the classpath element, and it throws a

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.

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

View raw message