dimanche 22 octobre 2017

eclipse rcp with tycho : test class not found

I created a multi-modules project with eclipse RCP, using maven, e4 for the graphical part, and tycho for the mix of rcp & maven. I can launch the product via "mvn install", and I get a working executable (it displays the eclipse window). I would like to manage tests; to do so, I must explain a bit deeper the structure of my project: it's a parent project (mavenized, like all projects inside it), which contains a pom.xml, and folders for its children. These children are "model" (packaging=eclipse-plugin), "rcp" (plugin of type e4, packaging = eclipse-plugin) , and model.tests, with the packaging eclipse-test-plugin, whose pom.xml is as this:

<project xmlns="http://ift.tt/IH78KX" xmlns:xsi="http://ift.tt/ra1lAU"
xsi:schemaLocation="http://ift.tt/IH78KX http://ift.tt/VE5zRx">
<modelVersion>4.0.0</modelVersion>
<groupId>lorry</groupId>
<artifactId>model.tests</artifactId>
<packaging>eclipse-test-plugin</packaging>
<name>tests</name>
<parent>
    <groupId>lorry.parent</groupId>
    <artifactId>lorry.parent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>..</relativePath>
</parent>
<repositories>
    <repository>
        <id>eclipse-repo</id>
        <layout>p2</layout>
        <url>http://ift.tt/2l6IeyR;
    </repository>
</repositories>
<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-surefire-plugin</artifactId>

            <version>0.22.0</version>

        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-surefire-plugin</artifactId>
                <version>0.22.0</version>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
</project>

the test class is as this:

package model.tests;

import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

class Test_modelTest {

@BeforeEach
void setUp() throws Exception {
}

@AfterEach
void tearDown() throws Exception {
}

@Test
void test() {
    assertTrue(false);
}

}

when I run "mvn integration-test", I get an erro with the following message:

[INFO] tests .............. FAILURE [ 2.406 s]

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:0.22.0:test (default-test) on project model.tests: No tests found.

I think I follow the maven-surefire-test guidelines for the name of the test class...

thank you

olivier

Aucun commentaire:

Enregistrer un commentaire