jeudi 3 décembre 2015

Why @Ignore annotation doesn't work?

Colleagues, I have @ignore annotation in my test Class AppTest.java.

@Ignore("this test is not ready yet")
    public static void testWithAllRequiredParameters() {
        }

My pom looks:

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19</version>
                    <executions>
                    <execution>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>

                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>2.19</version>
                    </dependency>
                </dependencies>

                <configuration>
                    <includes>
                        <include>AdapterAppTest.java</include>
                    </includes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>com.adapter</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>com.comp.adapter</mainClass>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>

        </plugins>
    </build>

As a result i receive:

[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building adapter 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-jaxb2-plugin:0.13.0:generate (default) @ adapter --- [INFO] Up-to-date check for source resources [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ adapter --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 3 resources [INFO] Copying 1 resource [INFO] [INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ adapter --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 25 source files to C:\Users\git\adapter\adapter\target\classes [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ adapter --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory C:\Users\git\adapter\adapter\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ adapter --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.19:test (default-test) @ adapter ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.adapter.AdapterAppTest

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.546 sec - in com.adapter.AdapterAppTest

Results :

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

[INFO]
[INFO] --- maven-surefire-plugin:2.19:test (default) @ adapter ---
[INFO] Skipping execution of surefire because it has already been run for this configuration
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.452 s
[INFO] Finished at: 2015-12-03T16:09:13+03:00
[INFO] Final Memory: 25M/413M
[INFO] ------------------------------------------------------------------------

Why @Ignore annotation have not effect?

Aucun commentaire:

Enregistrer un commentaire