You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by kooper <se...@list.ru> on 2012/01/19 11:04:05 UTC

fail-safe plugin does not see test

Hi,
I'm using fail-safe plugin for integration tests but it seems that plugin
does not see the tests. I have DeviceResourceIT.java that uses junit in it
it has test method IsRegisteredTest() but fail-safe says 0 test run:
@Test
    public void IsRegisteredTest(){
        logger.debug("isRegisteredTest started");
       ClientResponse clientResponse =
webClient.performGet("http://localhost:8080/app/Device/" +
WebClientImpl.TEST_DEVICE);
        ... 
        logger.debug("isRegisteredTest completed");
    }
 
Here is the plugin configuration:
<plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>2.11</version>
                        <configuration>
                            <skipTests>false</skipTests>
                            <encoding>utf-8</encoding>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency><groupId>junit</groupId>
                                <artifactId>junit</artifactId>
                                <version>4.8.2</version>
                            </dependency>
                            
                        </dependencies>
                    </plugin>

I've tried different configs added include tags, surfire dependency etc, but
it stills says: 

[INFO] --- maven-failsafe-plugin:2.11:integration-test (integration-test) @
app---
[INFO] Failsafe report directory: D:\Projects\app\target\failsafe-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- cargo-maven2-plugin:1.1.4:stop (stop-container) 

What could be the issue here? Can anyone help with it? 

Thanks in advance.


--
View this message in context: http://maven.40175.n5.nabble.com/fail-safe-plugin-does-not-see-test-tp5157259p5157259.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: fail-safe plugin does not see test

Posted by kooper <se...@list.ru>.
Thank you very much for help. I've found build-helper-maven-plugin, it adds
test location to maven build and now it seems to work as I want it to.
Thanks again for help.

--
View this message in context: http://maven.40175.n5.nabble.com/fail-safe-plugin-does-not-see-test-tp5157259p5157441.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: fail-safe plugin does not see test

Posted by Stephen Connolly <st...@gmail.com>.
On 19 January 2012 11:31, kooper <se...@list.ru> wrote:
> hm, I've tried moving class to src/test/java folder once more and it works
> now. Not sure why it wasn't previously, so thank you very much for advice.
>
> BTW can I configure fail-safe to check my directory also?

failsafe looks for .class files in target/test-classes

you can configure failsafe to look elsewhere, but then you need to
configure compiler-m-p to compile your classes from your custom
location into your custom location.

failsafe uses the different naming scheme as a way around having to
have different layers.

hence, it's tests are *IT, etc while surefire's are *Test, etc

>
> --
> View this message in context: http://maven.40175.n5.nabble.com/fail-safe-plugin-does-not-see-test-tp5157259p5157424.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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


Re: fail-safe plugin does not see test

Posted by kooper <se...@list.ru>.
hm, I've tried moving class to src/test/java folder once more and it works
now. Not sure why it wasn't previously, so thank you very much for advice.

BTW can I configure fail-safe to check my directory also?

--
View this message in context: http://maven.40175.n5.nabble.com/fail-safe-plugin-does-not-see-test-tp5157259p5157424.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: fail-safe plugin does not see test

Posted by kooper <se...@list.ru>.
The test is in src/test/java-functional, I've added this dir to test sources.
Tried with surfire plugin renaming it to  DeviceResourceTest and it sees it.
I also tried it in src/test/java, but still the same result.  So I'm not
sure why fail-safe does not see it. 

--
View this message in context: http://maven.40175.n5.nabble.com/fail-safe-plugin-does-not-see-test-tp5157259p5157286.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: fail-safe plugin does not see test

Posted by Stephen Connolly <st...@gmail.com>.
where is that test?

is it in src/test/java? it should be somewhere in src/test/java or it
will not be picked up

On 19 January 2012 10:04, kooper <se...@list.ru> wrote:
> Hi,
> I'm using fail-safe plugin for integration tests but it seems that plugin
> does not see the tests. I have DeviceResourceIT.java that uses junit in it
> it has test method IsRegisteredTest() but fail-safe says 0 test run:
> @Test
>    public void IsRegisteredTest(){
>        logger.debug("isRegisteredTest started");
>       ClientResponse clientResponse =
> webClient.performGet("http://localhost:8080/app/Device/" +
> WebClientImpl.TEST_DEVICE);
>        ...
>        logger.debug("isRegisteredTest completed");
>    }
>
> Here is the plugin configuration:
> <plugin>
>                        <groupId>org.apache.maven.plugins</groupId>
>                        <artifactId>maven-failsafe-plugin</artifactId>
>                        <version>2.11</version>
>                        <configuration>
>                            <skipTests>false</skipTests>
>                            <encoding>utf-8</encoding>
>                        </configuration>
>                        <executions>
Simplify your life, use the default phases and have one execution
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>

Why are you adding the dependency here? it should be a (test scoped)
dependency of your project, not the plugin
>                        <dependencies>
>                            <dependency><groupId>junit</groupId>
>                                <artifactId>junit</artifactId>
>                                <version>4.8.2</version>
>                            </dependency>
>
>                        </dependencies>
>                    </plugin>
>
> I've tried different configs added include tags, surfire dependency etc, but
> it stills says:
>
> [INFO] --- maven-failsafe-plugin:2.11:integration-test (integration-test) @
> app---
> [INFO] Failsafe report directory: D:\Projects\app\target\failsafe-reports
>
> -------------------------------------------------------
>  T E S T S
> -------------------------------------------------------
>
> Results :
>
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
>
> [INFO]
> [INFO] --- cargo-maven2-plugin:1.1.4:stop (stop-container)
>
> What could be the issue here? Can anyone help with it?
>
> Thanks in advance.
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/fail-safe-plugin-does-not-see-test-tp5157259p5157259.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

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