This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258243 - Unit tests will not execute while build or clean build
Summary: Unit tests will not execute while build or clean build
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 8.1
Hardware: PC Other
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-04 12:52 UTC by Christian Lenz
Modified: 2016-03-07 21:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Lenz 2016-03-04 12:52:03 UTC
I have a netbeans module project with unit tests, after I run the unit tests separately, everything is fine. When I clean build or only build the whole solution everything is fine, except that the unit tests will not executed as default.
I created stuff and I thought that everything is fine because the the project will build and later I executed the tests separately and they failed. I expected that the build will fail, when the tests are failing. So I only see that netbeans will call "clean netbeans" but the tests where not executed. Did I forgot to add smth that the tests should executed while build or is this a bug or is this feature missing?
Comment 1 markiewb 2016-03-07 20:39:48 UTC
IMO the expected behaviour is based on working with Maven/Gradle, where a "mvn package"/"mvn install" also executes tests and integration tests.

Standard Ant-based project don't execute tests when building via 'ant clean jar' too.

If it's important, then switch to Maven-based NBM. :P
Comment 2 markiewb 2016-03-07 21:10:56 UTC
Workaround for an Ant-based project. Tested with "Anagram" sample.

    <target name="-post-jar">
        <antcall target="test"/>
    </target>