Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!

Bug 237412

Summary: Maven integration test support
Product: java Reporter: gualtiero65
Component: JUnitAssignee: Theofanis Oikonomou <theofanis>
Status: RESOLVED FIXED QA Contact: junit-issues <junit-issues.netbeans.org>
Priority: P3 CC: abien, mkleint
Version: 7.4   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Issue Type: DEFECT Exception Report:
Attachments: Standard Create Test dialog
Create Test dialog when file name is changed to <class>IT.java

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. ***
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo