Ant task runs ignored tests (@Ignore)

0

Holas

In my build.xml I have the integration-test task which runs my integration tests. The problem is that when I execute the task, it also runs the tests with the @Ignore tag, which should not run.}

This is the target of the build.xml

<target name="integration-test">
    <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml"  classpathref="classpath"/>
    <jacoco:coverage destfile="${test.result}/jacoco/jacoco.exec" xmlns:jacoco="antlib:org.jacoco.ant">
        <junit fork="yes" haltonfailure="yes">
            <classpath>
              <path refid="classpath"/>
              <pathelement location="${wardir}/WEB-INF/classes"/>
            </classpath>
            <formatter type="plain" usefile="false" />
            <formatter type="xml" />
            <batchtest fork="true" todir="${test.result}">
                <fileset dir="${test.src.dir}" includes="**/integration/test/*Test.java" />
            </batchtest>
        </junit>
    </jacoco:coverage>
</target>

And this is my unit test

@Ignore
public void testTableExportCollapsed() {
    //Arrange
    boolean collapsed = true;
    DBManager dbManager = (DBManager) EnviromentModule.getCurrent().getObject(DBManager.class);
    PnPlanning pnPlanning = (PnPlanning) EnviromentModule.getCurrent().getObject(PnPlanning.class);
    Trip trip = dbManager.getEntityById(Trip.class,90003L);
    PnTrip pnTrip = new PnTrip(pnPlanning,trip);
    try {
        pnTrip.run();
    } catch (BaseException e) {
        e.printStackTrace();
    }
    //Act
    Grid table = pnTrip.getTable();
    ExcelExport excelExport = new ExcelExport(table,collapsed);
    //Assert
    Assert.assertNotEquals(table.getVisibleColumns().length,excelExport.getTableHolder().getPropIds().size());
}

I use the Vaadin framework and for the Junit use tests. If anyone knows how I can make them do not run the ignored tests I would appreciate it very much

    
asked by Andres Castañeda Marin 22.03.2018 в 22:11
source

0 answers