You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Lev Epshteyn <le...@google.com> on 2009/02/11 01:34:31 UTC

Running JSUnit tests as part of the Shindig mvn build

We're trying to figure out a good testing strategy with client-side
templates, and are running up against the fact that the JsUnit version that
maven works with doesn't seem to support DOM. This is a problem, given how
heavily templates relies on the DOM for its functionality - virtually no
actual tests can run, and we have been forced to put them into the EndToEnd
test harness instead (where HTMLUnit is available, which can be "adapted" to
behave like normal JsUnit).

Other features may need to be tested int he context of the DOM as well, so
the problem is not necessarily unique to Templates.

Is there any way to run build-time JS tests that will excercise javascript
code in the context of a DOM implementation? (I know that either JsUnit or
HTMLUnit can do this, but there may be others)

Re: Running JSUnit tests as part of the Shindig mvn build

Posted by Kevin Brown <et...@google.com>.
On Tue, Feb 10, 2009 at 4:34 PM, Lev Epshteyn <le...@google.com> wrote:

> We're trying to figure out a good testing strategy with client-side
> templates, and are running up against the fact that the JsUnit version that
> maven works with doesn't seem to support DOM. This is a problem, given how
> heavily templates relies on the DOM for its functionality - virtually no
> actual tests can run, and we have been forced to put them into the EndToEnd
> test harness instead (where HTMLUnit is available, which can be "adapted"
> to
> behave like normal JsUnit).
>
> Other features may need to be tested int he context of the DOM as well, so
> the problem is not necessarily unique to Templates.
>
> Is there any way to run build-time JS tests that will excercise javascript
> code in the context of a DOM implementation? (I know that either JsUnit or
> HTMLUnit can do this, but there may be others)


Why not create a simple mock DOM? It's pretty simple for the basic
operations.

Re: Running JSUnit tests as part of the Shindig mvn build

Posted by ar...@leroymerlin.fr.
Hello,
In our project, we use jqUnit and HtmlUnit to test client-side
javascript, and it certainly does support DOM handling. We have
wrapped pure jqUnit tests into JUnit test. The advantage of this
scheme over jsUnit is that one can run tests either manually (eg. in
development doing TDD, just hit F5 to reload the test page) or
automatically as part of the build.

If someone is interested ...
-- 
Arnaud Bailly, PhD
Leroy-Merlin - SIF - Projet Portail


Ce message et toutes les pièces jointes sont établis à l'attention exclusive de leurs destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le détruire et d'en avertir immédiatement l'expéditeur. L'internet ne permettant pas d'assurer l'intégrité de ce message, le contenu de ce message ne représente en aucun cas un engagement de la part de Leroy Merlin.


Re: Running JSUnit tests as part of the Shindig mvn build

Posted by Louis Ryan <lr...@google.com>.
HTML unit definitely does this. It even uses the Neko parser to support HTML
DOM I believe. How it gets bound into Rhino I dont know.

On Tue, Feb 10, 2009 at 4:45 PM, Ian Boston <ie...@tfd.co.uk> wrote:

> I think there is a DOM extension available for Rhino, written by the JQuery
> team, that might give HTMLUnit and JSUnit DOM ability.
>
> Ian
>
>
> On 11 Feb 2009, at 00:34, Lev Epshteyn wrote:
>
>  We're trying to figure out a good testing strategy with client-side
>> templates, and are running up against the fact that the JsUnit version
>> that
>> maven works with doesn't seem to support DOM. This is a problem, given how
>> heavily templates relies on the DOM for its functionality - virtually no
>> actual tests can run, and we have been forced to put them into the
>> EndToEnd
>> test harness instead (where HTMLUnit is available, which can be "adapted"
>> to
>> behave like normal JsUnit).
>>
>> Other features may need to be tested int he context of the DOM as well, so
>> the problem is not necessarily unique to Templates.
>>
>> Is there any way to run build-time JS tests that will excercise javascript
>> code in the context of a DOM implementation? (I know that either JsUnit or
>> HTMLUnit can do this, but there may be others)
>>
>
>

Re: Running JSUnit tests as part of the Shindig mvn build

Posted by Ian Boston <ie...@tfd.co.uk>.
I think there is a DOM extension available for Rhino, written by the  
JQuery team, that might give HTMLUnit and JSUnit DOM ability.

Ian

On 11 Feb 2009, at 00:34, Lev Epshteyn wrote:

> We're trying to figure out a good testing strategy with client-side
> templates, and are running up against the fact that the JsUnit  
> version that
> maven works with doesn't seem to support DOM. This is a problem,  
> given how
> heavily templates relies on the DOM for its functionality -  
> virtually no
> actual tests can run, and we have been forced to put them into the  
> EndToEnd
> test harness instead (where HTMLUnit is available, which can be  
> "adapted" to
> behave like normal JsUnit).
>
> Other features may need to be tested int he context of the DOM as  
> well, so
> the problem is not necessarily unique to Templates.
>
> Is there any way to run build-time JS tests that will excercise  
> javascript
> code in the context of a DOM implementation? (I know that either  
> JsUnit or
> HTMLUnit can do this, but there may be others)