ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hilton, Chris" <chil...@Question.com>
Subject RE: Running JUnit in Weblogic server from Ant?
Date Fri, 08 Dec 2000 23:14:19 GMT
For the person who was looking to run JUnit within WebLogic, I recommend the
following article:

http://www.javaworld.com/javaworld/jw-05-2000/jw-0526-testinfect.html

Things didn't seem quite as straightforward as the article showed, but I
eventually got it sorted out.  Personally, I wrote a Perl script to perform
the requisite HTTP request to run the tests, but that could easily be done
in java as well.

Hope that helps.

Chris Hilton

-----Original Message-----
From: Cyril Bouteille [mailto:CyrilBouteille@yahoo.com]
Sent: Tuesday, November 21, 2000 11:16 AM
To: ant-user@jakarta.apache.org
Subject: Re: Running JUnit in Weblogic server from Ant?


David,

> I have tests set up to run INSIDE the WebLogic server, since many of my
> objects require various services of the server.  Right now, the way I run
my
> JUnit tests is manually through a servlet which outputs the test results
to
> an HTML page while the server is running.
> Does anyone know if it's possible to run JUnit in the context of a running
> WebLogic server from Ant?  I'd love to build AND test at the same
> time...TIA.

To test your EJBs, you can write a jUnit test acting as a T3 client for
weblogic:
* Extend TestCase with a class A.
* Declare an instance-level EJB reference to your bean.
* Override the setup method to perform a lookup on your bean's home and
init the reference.
* Then, you can invoke biz methods on your EJB in each of you test
methods. 
This can be integrated in Ant by calling A with the <java> task. Of
course you need to make this target dependent on <wlrun> :)

Hope it helps,

Mime
View raw message