You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Trevor Harmon <tr...@vocaro.com> on 2009/01/07 18:06:41 UTC

Launching a stand-alone test program

Hi,

In addition to the usual automated unit tests that run in Maven's test  
phase, I now need to add a special kind of test program. It's stand- 
alone, requires user interaction, and should be run only occasionally,  
not during every test phase.

As for location, I assume I should just put it somewhere in src/test/ 
java, but what about invoking it? How would I configure the POM file  
so that users can launch this test program only when needed, on  
demand, rather than on every "mvn test"?

Thanks,

Trevor


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Launching a stand-alone test program

Posted by Wayne Fay <wa...@gmail.com>.
> As for location, I assume I should just put it somewhere in src/test/java,
> but what about invoking it? How would I configure the POM file so that users
> can launch this test program only when needed, on demand, rather than on
> every "mvn test"?

Use a profile.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Launching a stand-alone test program

Posted by Trevor Harmon <tr...@vocaro.com>.
On Jan 7, 2009, at 12:20 PM, John Stoneham wrote:

> If you're just
> running a standalone program that doesn't really need to interact with
> anything that's in the POM or be tied to the Maven lifecycle or
> dependencies, no sense trying to couple it into Maven.

I should have clarified what I meant by "stand-alone". It is stand- 
alone in the sense that it's not built on JUnit or a similar automated  
testing framework. But since it's testing the application, it does  
need to know the classpath (i.e. dependencies) that Maven sets up for  
the primary app. That's why the launching needs to be integrated with  
Maven.

Trevor


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Launching a stand-alone test program

Posted by John Stoneham <ly...@lyrically.net>.
On Wed, Jan 7, 2009 at 12:06 PM, Trevor Harmon <tr...@vocaro.com> wrote:
> As for location, I assume I should just put it somewhere in src/test/java,
> but what about invoking it? How would I configure the POM file so that users
> can launch this test program only when needed, on demand, rather than on
> every "mvn test"?

You would probably invoke this using the exec-maven-plugin, and put
the invocation in a profile activated by the presence of a property,
and have users activate it with something like:

mvn clean verify -Drun.my.manual.test.program

Or you could just create an Ant script to run it. :) If you're just
running a standalone program that doesn't really need to interact with
anything that's in the POM or be tied to the Maven lifecycle or
dependencies, no sense trying to couple it into Maven.

- John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Launching a stand-alone test program

Posted by Kalle Korhonen <ka...@gmail.com>.
Well depending on if you want to use Maven and even bind the execution to a
lifecycle or not. Since you said it runs manually and required manual
interaction, I keep thinking you want to prepare your environment once and
then run it multiple times from the command line. But either way, there's no
difference really; main point was that I'd put the manual test in a separate
module.

Kalle


On Fri, Jan 9, 2009 at 7:29 AM, Trevor Harmon <tr...@vocaro.com> wrote:

> On Jan 7, 2009, at 5:01 PM, Kalle Korhonen wrote:
>
>  If it's a manually run test application I'd create a separate module for
>> it.
>> You can set the main application as a dependency of this module, then spit
>> out the required classpath with dependency:build-classpath and put the run
>> parameters in your pom file, then write them out to a filtered shell or
>> batch script.
>>
>
>
> Is there some advantage to building the classpath and script manually? I'd
> have thought using the Exec plugin would be a lot simpler.
>
>
> Trevor
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Launching a stand-alone test program

Posted by Trevor Harmon <tr...@vocaro.com>.
On Jan 7, 2009, at 5:01 PM, Kalle Korhonen wrote:

> If it's a manually run test application I'd create a separate module  
> for it.
> You can set the main application as a dependency of this module,  
> then spit
> out the required classpath with dependency:build-classpath and put  
> the run
> parameters in your pom file, then write them out to a filtered shell  
> or
> batch script.


Is there some advantage to building the classpath and script manually?  
I'd have thought using the Exec plugin would be a lot simpler.

Trevor


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Launching a stand-alone test program

Posted by Kalle Korhonen <ka...@gmail.com>.
If it's a manually run test application I'd create a separate module for it.
You can set the main application as a dependency of this module, then spit
out the required classpath with dependency:build-classpath and put the run
parameters in your pom file, then write them out to a filtered shell or
batch script.

Kalle


On Wed, Jan 7, 2009 at 11:17 AM, Trevor Harmon <tr...@vocaro.com> wrote:

> On Jan 7, 2009, at 12:56 PM, Wendy Smoak wrote:
>
>  FWIW, I rely on my IDE to do this kind of thing.  There's usually a
>> "Run" configuration you can set up, and it figures out the classpath
>> for you, lets you set parameters, etc.
>>
>
> Setting up a Run configuration in an IDE is fine for a single user. But
> what about:
>
> 1) All members of your team need to set up the same configuration
> (lots of redundant manual effort)
>
> 2) The run parameters may change
> (each member has to perform the redundant manual effort again)
>
> Trevor
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Launching a stand-alone test program

Posted by Trevor Harmon <tr...@vocaro.com>.
On Jan 7, 2009, at 12:56 PM, Wendy Smoak wrote:

> FWIW, I rely on my IDE to do this kind of thing.  There's usually a
> "Run" configuration you can set up, and it figures out the classpath
> for you, lets you set parameters, etc.

Setting up a Run configuration in an IDE is fine for a single user.  
But what about:

1) All members of your team need to set up the same configuration
(lots of redundant manual effort)

2) The run parameters may change
(each member has to perform the redundant manual effort again)

Trevor


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Launching a stand-alone test program

Posted by Wendy Smoak <ws...@gmail.com>.
On Wed, Jan 7, 2009 at 10:06 AM, Trevor Harmon <tr...@vocaro.com> wrote:

> In addition to the usual automated unit tests that run in Maven's test
> phase, I now need to add a special kind of test program. It's stand-alone,
> requires user interaction, and should be run only occasionally, not during
> every test phase.

FWIW, I rely on my IDE to do this kind of thing.  There's usually a
"Run" configuration you can set up, and it figures out the classpath
for you, lets you set parameters, etc.

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org