You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tony Truong <to...@atlassian.com> on 2006/08/14 05:00:02 UTC

[m2] Executing a Test First

To all,

I need to run a specific JWebunit test before the other tests, since this
JWebunit test sets up the web app environment. How would I be able to do
this with the surefire plugin?

Tony.
-- 
View this message in context: http://www.nabble.com/-m2--Executing-a-Test-First-tf2101214.html#a5790831
Sent from the Maven - Users forum at Nabble.com.


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


Re: [m2] Executing a Test First

Posted by Tony Truong <to...@atlassian.com>.
Hi franz,

Thanks franz! The solution to the problem was to create two executions and
bind it to the same phase. In each execution, specify a different ID.

Case solved.


franz see wrote:
> 
> 
> 
> Tony Truong wrote:
>> 
>> Hi Franz,
>> 
>> Thanks for you quick reply.
>> 
>> For one thing, -Dtest only runs one singular test. What I want though is
>> to run that specified test, then have it execute the rest of the tests.
>> 
>> It would also be desirable if I could specify this in the pom rather than
>> in command line/runtime.
>> 
>> Tony.
>> 
>> franz see wrote:
>>> 
>>> 
>>> Tony Truong wrote:
>>>> 
>>>> To all,
>>>> 
>>>> I need to run a specific JWebunit test before the other tests, since
>>>> this JWebunit test sets up the web app environment. How would I be able
>>>> to do this with the surefire plugin?
>>>> 
>>>> Tony.
>>>> 
>>> 
>>> Good day to you, Tony,
>>> 
>>> add -Dtest=[test class name] to your mvn command.
>>> 
>>> Cheers, 
>>> Franz
>>> 
>> 
>> 
> 
> 
> Good day to you, Tony, 
> 
> Sorry about that, my bad. Anyway, here's another suggestion.
> 
> Try binding the test goal to the test-compile phase (the phase right
> before test) and to the test phase. Also, specify that the only test you
> would run during the test-compile is that specific JWebunit test case. 
> 
> Specifically, try adding this
> 
> <project>
>   [...]
>   <build>
> 	<pluginManagement>
>       <plugins>
>         <plugin>
>           <groupId>org.apache.maven.plugins</groupId>
>           <artifactId>maven-surefire-plugin</artifactId>
>           <executions>
>             <execution>
>               <id>1</id>
>               <phase>test-compile</phase>
>               <goals>
>                 <goal>test</goal>
>               </goals>
>               <configuration>
>                 <test>[...your initial test...]
>               </configuration>
>             </execution>
>             <execution>
>               <id>2</id>
>               <goals>
>                 <goal>test</goal>
>               </goals>
>             </execution>
>           </executions>
>         </plugin>
>       </plugins>
>     </pluginManagement>
>   </build>
>   [...]
> </project>
> 

-- 
View this message in context: http://www.nabble.com/-m2--Executing-a-Test-First-tf2101214.html#a5791954
Sent from the Maven - Users forum at Nabble.com.


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


Re: [m2] Executing a Test First

Posted by franz see <fr...@gmail.com>.


Tony Truong wrote:
> 
> Hi Franz,
> 
> Thanks for you quick reply.
> 
> For one thing, -Dtest only runs one singular test. What I want though is
> to run that specified test, then have it execute the rest of the tests.
> 
> It would also be desirable if I could specify this in the pom rather than
> in command line/runtime.
> 
> Tony.
> 
> franz see wrote:
>> 
>> 
>> Tony Truong wrote:
>>> 
>>> To all,
>>> 
>>> I need to run a specific JWebunit test before the other tests, since
>>> this JWebunit test sets up the web app environment. How would I be able
>>> to do this with the surefire plugin?
>>> 
>>> Tony.
>>> 
>> 
>> Good day to you, Tony,
>> 
>> add -Dtest=[test class name] to your mvn command.
>> 
>> Cheers, 
>> Franz
>> 
> 
> 


Good day to you, Tony, 

Sorry about that, my bad. Anyway, here's another suggestion.

Try binding the test goal to the test-compile phase (the phase right before
test) and to the test phase. Also, specify that the only test you would run
during the test-compile is that specific JWebunit test case. 

Specifically, try adding this

<project>
  [...]
  <build>
	<pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <executions>
            <execution>
              <id>1</id>
              <phase>test-compile</phase>
              <goals>
                <goal>test</goal>
              </goals>
              <configuration>
                <test>[...your initial test...]
              </configuration>
            </execution>
            <execution>
              <id>2</id>
              <goals>
                <goal>test</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  [...]
</project>
-- 
View this message in context: http://www.nabble.com/-m2--Executing-a-Test-First-tf2101214.html#a5791865
Sent from the Maven - Users forum at Nabble.com.


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


Re: [m2] Executing a Test First

Posted by Tony Truong <to...@atlassian.com>.
Hi Franz,

Thanks for you quick reply.

For one thing, -Dtest only runs one singular test. What I want though is to
run that specified test, then have it execute the rest of the tests.

It would also be desirable if I could specify this in the pom rather than in
command line/runtime.

Tony.

franz see wrote:
> 
> 
> Tony Truong wrote:
>> 
>> To all,
>> 
>> I need to run a specific JWebunit test before the other tests, since this
>> JWebunit test sets up the web app environment. How would I be able to do
>> this with the surefire plugin?
>> 
>> Tony.
>> 
> 
> Good day to you, Tony,
> 
> add -Dtest=[test class name] to your mvn command.
> 
> Cheers, 
> Franz
> 

-- 
View this message in context: http://www.nabble.com/-m2--Executing-a-Test-First-tf2101214.html#a5791217
Sent from the Maven - Users forum at Nabble.com.


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


Re: [m2] Executing a Test First

Posted by Tony Truong <to...@atlassian.com>.
Hi Franz,

Thanks for you quick reply.

For one thing, -Dtest only runs one singular test. What I want though is to
run that specified test, then have it execute the rest of the tests.

It would also be desirable if I could specify this in the pom rather than in
command line/runtime.


franz see wrote:
> 
> 
> Tony Truong wrote:
>> 
>> To all,
>> 
>> I need to run a specific JWebunit test before the other tests, since this
>> JWebunit test sets up the web app environment. How would I be able to do
>> this with the surefire plugin?
>> 
>> Tony.
>> 
> 
> Good day to you, Tony,
> 
> add -Dtest=[test class name] to your mvn command.
> 
> Cheers, 
> Franz
> 

-- 
View this message in context: http://www.nabble.com/-m2--Executing-a-Test-First-tf2101214.html#a5791217
Sent from the Maven - Users forum at Nabble.com.


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


Re: [m2] Executing a Test First

Posted by franz see <fr...@gmail.com>.

Tony Truong wrote:
> 
> To all,
> 
> I need to run a specific JWebunit test before the other tests, since this
> JWebunit test sets up the web app environment. How would I be able to do
> this with the surefire plugin?
> 
> Tony.
> 

Good day to you, Tony,

add -Dtest=[test class name] to your mvn command.

Cheers, 
Franz
-- 
View this message in context: http://www.nabble.com/-m2--Executing-a-Test-First-tf2101214.html#a5791109
Sent from the Maven - Users forum at Nabble.com.


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