You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Ryan Lubke <Ry...@Sun.COM> on 2007/02/08 18:33:05 UTC

Running the shale integration tests

Hello folks,

I've dug around on the wiki looking for information on running the
integration tests for Shale (itest), and from what I can tell, all I really
need to set is the cargo property 'cargo.container.home'. 

When I do this and run the tests, the integration tests fail.  No output
is provided that I've found useful (container.log has three lines, none
of them informative).

Anyone have some tips to get this going?

Thanks,

-rl

Re: Running the shale integration tests

Posted by Craig McClanahan <cr...@apache.org>.
On 2/8/07, Ryan Lubke <Ry...@sun.com> wrote:
>
> Hello folks,
>
> I've dug around on the wiki looking for information on running the
> integration tests for Shale (itest), and from what I can tell, all I
> really
> need to set is the cargo property 'cargo.container.home'.
>
> When I do this and run the tests, the integration tests fail.  No output
> is provided that I've found useful (container.log has three lines, none
> of them informative).
>
> Anyone have some tips to get this going?


Sure ... thanks for asking here so we can get it on record :-).  Then, maybe
someone can snapshot this onto a wiki.

Background:  I have a personal bias that unit testing the individual classes
of a web application is necessary but not sufficient.  It is also important
to validate the runtime behavior of the dynamic system.  Therefore, the
Shale example and test applications support an optional "itest" (integration
test) profile that actually deploys a running instance of the app on a
Tomcat instance, and then uses an HtmlUnit based test environment to fire
off requests to the server and then examine the response.  HtmlUnit gives
you back a DOM view of the page, so you can examine the rendered output and
ensure that correct results were retrieved.

In order to run the "itest" profile, you must first have a Tomcat
5.5instance available.  Next, you must tell Maven2's "Cargo" plugin
where that
install is.  The easiest way I have found is to add the following snippet to
your user settings file (~/.m2/settings.xml):

<profiles>

  ...

  <profile>
    <id>cargo-config</id>
    <properties>
      <cargo.container.home>/home/craigmcc/apache-tomcat-5.5.20
</cargo.container.home>
    </properties>
  </profile>

  ...

</profiles>

Now, from the top level directory of (say) the shale-usecases application, I
can say:

    mvn -Pitest clean install

and it will run the integration tests for this application (see sources in
src/test/java/.../systest) after the normal compile and unit test phases,
using the MyFaces 1.1 JSF implementation by default.

Separately, there are also profiles available (in the shale-apps POM) to
help you select which JSF implementation strategy you wish to use.  If your
own application uses this POM as a parent, you'll have the same features
available to you.  Choose your implementation as follows:

* Default (MyFaces 1.1):    mvn clean install

* JSF 1.1 RI:  mvn -Djsf=ri clean install

* JSF 1.2 RI (included in the application):  mvn -Djsf=ri12 clean install

* JSF 1.2 (provided by the app server):  mvn -Djsf=ee5 clean install

I have tried the combination of RI 1.1 and the integration tests, but
haven't yet done so with the 1.2 variants ... I suspect we'll need a Cargo
setup for Servlet 2.5 / JSP 2.1 / JSF 1.2 type containers for this to work.

Craig




Thanks,
>
> -rl
>