Oscar,
Unfortunately, our "creative" configuration required more than just pom
changes.  We had to write an integration-test plugin which performed
some tasks to make the maven "integration-test" phase more feature rich.
I will attempt to describe what we have below.  I make no claims that it
is the best approach, just that we have been successful.

In our web module, we have the pom configured to output a war.  We then
have a reference to our plugin:
<plugin>
        <groupId>novusedge</groupId>
        <artifactId>maven-htmlunit-it-plugin</artifactId>
        <version>0.4</version>
        <executions>
          <execution>
            <id>jetty-1</id>
            <phase>package</phase>
            <goals>
              <goal>start</goal>
            </goals>
          </execution>
          <execution>
            <id>cobertura-dump</id>
            <goals>
              <goal>dumpCobertura</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          ...
        </configuration>
      </plugin>

The jetty-1 execution starts jetty as part of the mvn process, not as a
distinct process.  The purpose of this is if a test fails and mvn quits,
we want jetty to be shut down by default.  Because we run in the same
process, we have to force Cobertura to dump its data (which is usually
done as the process exits).  The cobertura execution runs on the site
phase.

We also had to tweak the surefire plugin to *not* run during the normal
"test" phase, but to run during the "integration-test" phase.
Integration-test runs after package so the tests are actually run
against the war.  So we package the war, start jetty, and then start the
surefire tests.  The surefire entry is:

<plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <executions>
          <execution>
            <id>integration-test</id>
            <phase>integration-test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>false</skip>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <skip>true</skip>
          <forkMode>once</forkMode>
          <argLine>-XX:MaxPermSize=128m -Xmx640m</argLine>
        </configuration>
      </plugin>

Because we were getting OutOfMemory exceptions on the PermGen space
because Tap and other libraries, like Hibernate, load lots of classes,
we run our tests forked and bump the memory.

This works pretty well.  Getting Cobertura output has another, more
painful, set of issues.

I hope this helps,
DeFrance

-----Original Message-----
From: Oscar Picasso [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 18, 2006 12:16 PM
To: Tapestry users
Subject: RE: How do you test tapestry 4?

I guess your "creative" configuration is in a pom.xml file.  Could you
post its relevant parts.

Oscar

---------------------------------------
Daun DeFrance <[EMAIL PROTECTED]> wrote: Rob,
We use HtmlUnit and Canoo Webtest running during a maven 2
integration-test phase.  We use the Jetty6 maven plugin to start a
container and then just fire the tests. It's taken some "creative"
configuration to get it working, but it works well and we are able to
get test reports and cobertura coverage of our classes.

We are now working on building a "Creator-based" framework to get more
granular testing of our pages.  We are doing the opposite process of
you, I guess.  Starting out and working in.

Best,
DeFrance

-----Original Message-----
From: Rob Dennett [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 18, 2006 11:01 AM
To: Tapestry users
Subject: How do you test tapestry 4?

I presume that everyone here separates their business logic from their
pages and that you unit test that code separately.  But how do you test
your pages and components in isolation?  It's all well and good to test
page and component class methods using the Creator, but there doesn't
seem to be anyway to test the rendered output from your pages separate
from the business tier.  You could manually replace the hivemodule with
one that injects fake services, but I would like to keep this process as
automatic as possible.  Could you use something like ant or maven to do
this and maybe to launch a container as well?

 

Thanks for your help,

Rob


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.6.0/342 - Release Date: 5/17/2006
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



                
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great
rates starting at 1&cent;/min.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to