maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yegor Bugayenko <e...@technoparkcorp.com>
Subject Re: Re-using tests - best practice
Date Thu, 24 Mar 2011 08:08:33 GMT
What is the point of retesting a library which has already been tested?

You need your own tests, that will check the validity of your own
application, not a third-party library. If you want to reuse some code from
the library - just get their .java files from their repository and add them
to your project statically (don't forget to review their license
restrictions).

—
Yegor Bugayenko, PMP®, SCEA



On Tue, Mar 22, 2011 at 12:17 PM, Tim Pizey <tim.pizey@gmail.com> wrote:

> Hi,
>
> Atombeat http://code.google.com/p/atombeat/ has a set of possible
> configurations with different backends and security policies.
>
>     atombeat-exist-full
>     atombeat-exist-minimal
>     atombeat-exist-full-secure
>     atombeat-exist-minimal-secure
>     atombeat-orbeon-full
>     atombeat-orbeon-minimal
>     atombeat-orbeon-full-secure
>     atombeat-orbeon-minimal-secure
>
> Atombeat  has a separate project which contains the tests for all of the
> above:
>
> http://code.google.com/p/atombeat/source/browse/trunk/parent/atombeat-integration-tests/pom.xml
>
> As an Atombeat user I want to re-purpose these tests to test a
> particular Atombeat installation, with a different security mechanism
> (CAS).
>
> Because the Atombeat tests test a set of different configurations some
> are not applicable - testing security on an unsecured configuration
> for example - so the tests pom file contains a lot of configuration
> information.
> I had hoped to be able to inherit from the Atombeat test pom, ie set
> it as parent, but parents may only be of type pom.
>
> The Atombeat test source is in src/test/java, so currently no jar file
> is produced.
>
> I can fix that by adding
>
>     <plugin>
>        <groupId>org.apache.maven.plugins</groupId>
>        <artifactId>maven-jar-plugin</artifactId>
>        <executions>
>          <execution>
>            <goals>
>              <goal>test-jar</goal>
>            </goals>
>          </execution>
>        </executions>
>      </plugin>
>
> however the surefire plugin will not run the tests as it does not look
> inside jars to discover tests.
>
> Unpacking the jar into target/test-classes gets the tests discovered
> by Surefire.
>
> I then need to configure my project by duplicating the configuration
> information in the test POM.
>
> Is this the best way to reuse tests?
>
> cheers
> Tim
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> Tim Pizey - http://pizey.net/~timp
> Centre for Genomics and Global Health - http://cggh.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message