You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "David M. Goudreau" <da...@crosscommerce.com> on 2000/11/21 02:26:55 UTC

Running JUnit in Weblogic server from Ant?

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.


-dmg


Re: Running JUnit in Weblogic server from Ant?

Posted by Cyril Bouteille <Cy...@yahoo.com>.
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,

RE: Running JUnit in Weblogic server from Ant?

Posted by Chris Todd <ch...@christophertodd.com>.
David-

You might want to check out this article on Continuous Integration by Martin
Fowler and Matthew Foemmel.  He describes a process that sounds quite
similar to what you are describing.  I don't think he runs his 'in-server'
unit tests from ant, though.  Nonetheless, the article might give you some
ideas about how to do what you want.
http://www.martinfowler.com/articles/continuousIntegration.html

Sincerest regards,
Chris Todd
Software Engineer
Alabanza Corporation
ctodd@alabanza.com

>-----Original Message-----
>From: David M. Goudreau [mailto:david_goudreau@crosscommerce.com]
>Sent: Monday, November 20, 2000 8:27 PM
>To: Ant User Mailing List
>Subject: Running JUnit in Weblogic server from Ant?
>
>
>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.
>
>
>-dmg
>
>
>