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 237412 - Maven integration test support
Summary: Maven integration test support
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
: 229587 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-21 11:06 UTC by gualtiero65
Modified: 2014-06-04 21:21 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Standard Create Test dialog (36.88 KB, image/png)
2013-10-21 11:06 UTC, gualtiero65
Details
Create Test dialog when file name is changed to <class>IT.java (40.26 KB, image/png)
2013-10-21 11:08 UTC, gualtiero65
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gualtiero65 2013-10-21 11:06:39 UTC
Created attachment 141344 [details]
Standard Create Test dialog

Maven integration tests supports is not complete.

Integration tests are usually named <class>IT.java.

In 7.4 the Navigate -> Go to Test class works properly and let me go to integration test file.

On the contrary the "Create Test" function does not let me name the file to be create as <class>IT.java instead of the default <class>Test.java.

See attached pictures. The OK button is disabled when file name does not end with Test.java (the default).

Moreover the Warning is obsolete in 7.4 (it was valid until 7.3.1).

Expected "CreateTest" behaviour is to let me change the name of the test file to be created.
Comment 1 gualtiero65 2013-10-21 11:08:14 UTC
Created attachment 141345 [details]
Create Test dialog when file name is changed to <class>IT.java

OK button is disabled with filename is <class>IT.java even if this is supported by Navigate --> Go to test function
Comment 2 Milos Kleint 2013-10-23 10:24:18 UTC
the affected UI no part of maven support, reassigning
Comment 3 Theofanis Oikonomou 2013-10-31 16:00:19 UTC
Changeset: ad0113ce555d
Author:    Theofanis Oikonomou <theofanis@netbeans.org>
Date:      2013-10-31 16:56
Message:
Comment 4 Quality Engineering 2013-11-02 11:45:25 UTC
Integrated into 'main-silver', will be available in build *201311020744* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ad0113ce555d
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Task #237412 - Maven integration test support
Comment 5 tomzi 2013-11-25 08:28:30 UTC
Does this mean, that Integration Test support in netbeans will only work with <class>IT.java classes?

In our project integration test live in different maven projects that are not part of the main source tree. Unit tests are still part of the normal maven project. But these integration test can still be easily found by using the 'Find usage' feature. However it would make more sense to be able to let NB do the 'correct' thing when I choose 'Go to Test' by

- eg configuring where to look for 'integration tests'. For us we have one parent maven project with submodules.-> or by default look in all open projects. However there should be some filter that only tests should be found.
Comment 6 Theofanis Oikonomou 2013-11-25 10:29:33 UTC
(In reply to tomzi from comment #5)
> Does this mean, that Integration Test support in netbeans will only work
> with <class>IT.java classes?

correct

> 
> In our project integration test live in different maven projects that are
> not part of the main source tree. Unit tests are still part of the normal
> maven project. But these integration test can still be easily found by using
> the 'Find usage' feature. However it would make more sense to be able to let
> NB do the 'correct' thing when I choose 'Go to Test' by
> 
> - eg configuring where to look for 'integration tests'. For us we have one
> parent maven project with submodules.-> or by default look in all open
> projects. However there should be some filter that only tests should be
> found.

If the integration tests are in the classpath they should be found by the infrastructure. If not please file a new bug. Thank you
Comment 7 tomzi 2013-12-20 10:22:19 UTC
Our integration tests are call *Test.java, same as the 'normal' junit tests. Our Junit tests are part of the maven package where the actual code is in src/main/test directory. Integration tests live in an separted maven module, which is not part of the main source module, eg

myproject
 - module1
   + MyClass1
 - module2
   - module 2a...

myprojectIntegrationTests
 - module1Tests
   + MyClass1IntTest.java
 - module2Tests

So if I look for a test of MyClass1, would NB find them?
Comment 8 Milos Kleint 2013-12-20 11:06:45 UTC
(In reply to tomzi from comment #7)
> 
> So if I look for a test of MyClass1, would NB find them?

Unlikely, we only search within the same project (by folder + filename pattern only, no java infrastructure involved)
Comment 9 markiewb 2014-06-04 21:21:29 UTC
*** Bug 229587 has been marked as a duplicate of this bug. ***