CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Jeremy D. Miller -- The Shade Tree Developer

Under the hood and working with .Net, TDD, Software Design, and Agile Stuff

What do you use to incorporate JSUnit tests into a NAnt build?

Anybody got some good tips, or a working NAnt task for this that they like?  I use a slightly modified version of the JsUnit 2.1 TestRunner, but it would be pretty easy to convert to something else.

 

Thanks in advance. 



Comments

Rytmis said:

... or did you mean you're using the HTML page and are actually looking for the same thing I am? :)

# May 28, 2007 2:02 PM

Jeremy D. Miller said:

@Rytmis,

I'm looking for the same think in all likelihood.  I know it's possible and other people have done it.  I'm mildly tempted to try to write a TestDriven.Net plugin for it.

# May 28, 2007 2:15 PM

Toby Henderson said:

We use a Nant exec task to do the job.

<property name="jsunit.port" value="9123" />

<property name="jsunit.url" value="&quot;http://localhost/${site}/jsunit/testRunner.html?testPage=localhost/${site}/tests/jsunit/WebTestSuite.htm&amp;autoRun=true&amp;submitresults=devweb02:9123/jsunit/acceptor&quot;" />

<property name="jsunit.browserFileNames" value="&quot;c:\program files\internet explorer\iexplore.exe&quot;" />

<property name="jsunit.log" value="${project.buildroot}\jsUnitLogs" />

<property name="jsunit.resourceBas" value="" />

<target name="jsunittests">

<exec program="java" workingdir="${project.workingdir}\${site}\jsunit\java" commandline="-Dport=${jsunit.port} -DbrowserFileNames=${jsunit.browserFileNames} -Durl=${jsunit.url} -DlogsDirectory=${jsunit.log} -classpath &quot;.\bin\jsunit.jar;.\lib\jetty.jar;.\lib\junit.jar;.\lib\jdom.jar;.\lib\xerces.jar;.\lib\javax.servlet.jar&quot; junit.textui.TestRunner net.jsunit.StandaloneTest" />

</target>

${site}/jsunit - contains jsunit

${site}/tests/jsunit - contains all the jsunit tests

Hope this helps.

If you need to ask any other questions; tobyh at perfectinfo dot com

I'll try help get you up and running

Got a basic style sheet to show the results. If you need it.

# May 29, 2007 4:54 AM

Jay Kimble said:

Jeremy,

I use ecmaunit which is a little more flexible IMO for running tests.  It has the browser based test viewer like JSUnit, but it also has a simple script that can be used to run JS tests from the command line (which I know Nant will handle very well).

I know this isn't the solution you were looking for necessarily, but JSUnit seems to be a fuller test environment (but you pay because there are some complexities to it)...

Ecmaunit feels better me (I wonder if it might be possible to cross pollinate some of the tools)

Jay

# May 30, 2007 10:15 AM

Arindam Manna said:

I am working on JsUnit buils. I want to run the JsUnit testcases and genarate a html report. I need  any xslt stylesheet which can convert a xml format jsunit report to html format.

# July 12, 2007 9:52 AM

Brian Donahue said:

Hi Jeremy,

Did you ever come up with an approach you liked for this?  Just curious as we are starting to play with jsUnit.

# August 30, 2007 10:57 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Jeremy D. Miller

Jeremy began his IT career writing "Shadow IT" applications to automate his engineering documentation, then wandered into software development because it looked like more fun. Jeremy previously worked as a systems architect building mission critical supply chain software for a Fortune 100 company and learned agile development practices as a .Net consultant at ThoughtWorks, one of the pioneers of agile development. Jeremy is the author of the open source StructureMap (http://structuremap.sourceforge.net) tool for Dependency Injection with .Net and the forthcoming StoryTeller (http://storyteller.tigris.org) tool for supercharged FIT testing in .Net. Jeremy's thoughts on just about everything software related can be found on his weblog "The Shade Tree Developer" at http://codebetter.com/blogs/jeremy.miller, part of the popular CodeBetter site. Jeremy is a Microsoft MVP for C#. Check out Devlicio.us!

This Blog

Syndication

News

All opinions expressed here constitute my (Jeremy D. Miller's) personal opinion, and do not necessarily represent the opinion of any other organization or person, including (but not limited to) my fellow employees, my employer, its clients or their agents.

About Me

"Best Of" Compendium

StructureMap (Dependency Injection for .Net)

StoryTeller (Supercharged Fit)

Build your own Cab

TestDriven

MVP