[jira] [Commented] (NETBEANS-3733) Cannot test single method with Maven and Junit 5
[ https://issues.apache.org/jira/browse/NETBEANS-3733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17109382#comment-17109382 ] Svatopluk Dedic commented on NETBEANS-3733: --- Correction: you don't need that Vintage engine at all. Netbeans recognize JUnit5 + Surefire 2.22.0 ... but will not suggest it for some reason. > Cannot test single method with Maven and Junit 5 > > > Key: NETBEANS-3733 > URL: https://issues.apache.org/jira/browse/NETBEANS-3733 > Project: NetBeans > Issue Type: Bug > Components: java - JUnit, projects - Maven >Affects Versions: 11.1, 11.2, 11.3 >Reporter: Bernard >Priority: Critical > > All defaults, hello world application as simple as possible. > How to reproduce: > Menu|File|New Project|Java with Maven|Java Application|Finish > Projects|New|java Class|NewClass|Finish > Add two methods: > public void hello1() { > System.out.println("Hello 1"); > } > > public void hello2() { > System.out.println("Hello 2"); > } > [Ctrl+Shift+U] Create / Update Tests|JUnit|OK > generates test as expected, adds dependencies to POM as expected: > > > org.junit.jupiter > junit-jupiter-api > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-params > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-engine > 5.3.1 > test > > > In generated class NewClassTest now I want to test the single method > "testHello2()" > So I put cursor on it and right click, "Run Focused Test Method". > I get a dialog: > "Feature requires update of POM" > "Executing single test method requires Surefire 2.8+ and JUnit in version 4.8 > and bigger. > Update your pom.xml?" > I click "Yes" > In pom.xml, another dependecy is added: > > junit > junit > 4.11 > > Si I try again. Put cursor on the method and right click, "Run Focused Test > Method". > I get a message > "No tests executed for mavenproject1" > This means that I cannot use the default way of NetBeans to quickly create a > class and test it. > This reproduces with all only defaults selected such as Java Maven project, > as simple as it can get. This has worked for about 10 years until it was > broken with JUnit 5. > How can we select JUnit 4 until this is mature? -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-3733) Cannot test single method with Maven and Junit 5
[ https://issues.apache.org/jira/browse/NETBEANS-3733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17109375#comment-17109375 ] Svatopluk Dedic commented on NETBEANS-3733: --- I did reproduce using the steps in the initial comment. I'm not sure if it qualifies to {{Critical}} as a workaround exists: * you seem to use *JUnit 5*, the added dependency is *JUnit 4*, which is probably NOT what you'd want. Remove the added dependency and add Junit's 5 package to shut NetBeans up: {code:java} org.junit.vintage junit-vintage-engine 5.6.0 test {code} * Despite [Maven Documentation|[https://maven.apache.org/surefire/maven-surefire-plugin/examples/single-test.html]] says that the syntax {{ClassName#method}} works from *surefire 2.7.3*, I was able to get it work only for *surefire 2.22.0* and above. I have Maven *3.6.0* installed separately and on my installation, *surefire 2.12.4* is used by default. Check (run with -X, show debug output) if it is your case. Update your {{pom.xml}} with {code:java} org.apache.maven.plugins maven-surefire-plugin 2.22.0 {code} to force *2.22.0* version Of course NB JUnit support *should* recognize JUnit Jupiter artifacts and "do the right thing". > Cannot test single method with Maven and Junit 5 > > > Key: NETBEANS-3733 > URL: https://issues.apache.org/jira/browse/NETBEANS-3733 > Project: NetBeans > Issue Type: Bug > Components: java - JUnit, projects - Maven >Affects Versions: 11.1, 11.2, 11.3 >Reporter: Bernard >Priority: Critical > > All defaults, hello world application as simple as possible. > How to reproduce: > Menu|File|New Project|Java with Maven|Java Application|Finish > Projects|New|java Class|NewClass|Finish > Add two methods: > public void hello1() { > System.out.println("Hello 1"); > } > > public void hello2() { > System.out.println("Hello 2"); > } > [Ctrl+Shift+U] Create / Update Tests|JUnit|OK > generates test as expected, adds dependencies to POM as expected: > > > org.junit.jupiter > junit-jupiter-api > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-params > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-engine > 5.3.1 > test > > > In generated class NewClassTest now I want to test the single method > "testHello2()" > So I put cursor on it and right click, "Run Focused Test Method". > I get a dialog: > "Feature requires update of POM" > "Executing single test method requires Surefire 2.8+ and JUnit in version 4.8 > and bigger. > Update your pom.xml?" > I click "Yes" > In pom.xml, another dependecy is added: > > junit > junit > 4.11 > > Si I try again. Put cursor on the method and right click, "Run Focused Test > Method". > I get a message > "No tests executed for mavenproject1" > This means that I cannot use the default way of NetBeans to quickly create a > class and test it. > This reproduces with all only defaults selected such as Java Maven project, > as simple as it can get. This has worked for about 10 years until it was > broken with JUnit 5. > How can we select JUnit 4 until this is mature? -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-3733) Cannot test single method with Maven and Junit 5
[ https://issues.apache.org/jira/browse/NETBEANS-3733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17096136#comment-17096136 ] Geertjan Wielenga commented on NETBEANS-3733: - Right. Everyone working on Apache projects are volunteers. Take a look at apache.org for how Apache projects are run. The very best you can do is actively participate on the mailing lists, see netbeans.apache.org for details. Don’t just file an issue, instead, also start a discussion on the mailing lists to motivate others to join you in fixing the issues you identify. > Cannot test single method with Maven and Junit 5 > > > Key: NETBEANS-3733 > URL: https://issues.apache.org/jira/browse/NETBEANS-3733 > Project: NetBeans > Issue Type: Bug > Components: java - JUnit, projects - Maven >Affects Versions: 11.1, 11.2, 11.3 >Reporter: Bernard >Priority: Critical > > All defaults, hello world application as simple as possible. > How to reproduce: > Menu|File|New Project|Java with Maven|Java Application|Finish > Projects|New|java Class|NewClass|Finish > Add two methods: > public void hello1() { > System.out.println("Hello 1"); > } > > public void hello2() { > System.out.println("Hello 2"); > } > [Ctrl+Shift+U] Create / Update Tests|JUnit|OK > generates test as expected, adds dependencies to POM as expected: > > > org.junit.jupiter > junit-jupiter-api > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-params > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-engine > 5.3.1 > test > > > In generated class NewClassTest now I want to test the single method > "testHello2()" > So I put cursor on it and right click, "Run Focused Test Method". > I get a dialog: > "Feature requires update of POM" > "Executing single test method requires Surefire 2.8+ and JUnit in version 4.8 > and bigger. > Update your pom.xml?" > I click "Yes" > In pom.xml, another dependecy is added: > > junit > junit > 4.11 > > Si I try again. Put cursor on the method and right click, "Run Focused Test > Method". > I get a message > "No tests executed for mavenproject1" > This means that I cannot use the default way of NetBeans to quickly create a > class and test it. > This reproduces with all only defaults selected such as Java Maven project, > as simple as it can get. This has worked for about 10 years until it was > broken with JUnit 5. > How can we select JUnit 4 until this is mature? -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-3733) Cannot test single method with Maven and Junit 5
[ https://issues.apache.org/jira/browse/NETBEANS-3733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17096047#comment-17096047 ] Bernard commented on NETBEANS-3733: --- I might be wrong but I think what is happening is that people like me are filing issues like this, effectively acting as testers, multiple times. Then they see that these issues are not even assigned to anyone. These people then start to think that there are probably not enough developer resources. Like the developers not getting paid or something like that. Then the people think what is the point of testing even more / earlier? So perhaps NetBeans needs sponsors and / or some donate buttons. Just an idea. > Cannot test single method with Maven and Junit 5 > > > Key: NETBEANS-3733 > URL: https://issues.apache.org/jira/browse/NETBEANS-3733 > Project: NetBeans > Issue Type: Bug > Components: java - JUnit, projects - Maven >Affects Versions: 11.1, 11.2, 11.3 >Reporter: Bernard >Priority: Critical > > All defaults, hello world application as simple as possible. > How to reproduce: > Menu|File|New Project|Java with Maven|Java Application|Finish > Projects|New|java Class|NewClass|Finish > Add two methods: > public void hello1() { > System.out.println("Hello 1"); > } > > public void hello2() { > System.out.println("Hello 2"); > } > [Ctrl+Shift+U] Create / Update Tests|JUnit|OK > generates test as expected, adds dependencies to POM as expected: > > > org.junit.jupiter > junit-jupiter-api > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-params > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-engine > 5.3.1 > test > > > In generated class NewClassTest now I want to test the single method > "testHello2()" > So I put cursor on it and right click, "Run Focused Test Method". > I get a dialog: > "Feature requires update of POM" > "Executing single test method requires Surefire 2.8+ and JUnit in version 4.8 > and bigger. > Update your pom.xml?" > I click "Yes" > In pom.xml, another dependecy is added: > > junit > junit > 4.11 > > Si I try again. Put cursor on the method and right click, "Run Focused Test > Method". > I get a message > "No tests executed for mavenproject1" > This means that I cannot use the default way of NetBeans to quickly create a > class and test it. > This reproduces with all only defaults selected such as Java Maven project, > as simple as it can get. This has worked for about 10 years until it was > broken with JUnit 5. > How can we select JUnit 4 until this is mature? -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-3733) Cannot test single method with Maven and Junit 5
[ https://issues.apache.org/jira/browse/NETBEANS-3733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17095887#comment-17095887 ] Geertjan Wielenga commented on NETBEANS-3733: - You want to join the NetBeans testing community to participate in testing? > Cannot test single method with Maven and Junit 5 > > > Key: NETBEANS-3733 > URL: https://issues.apache.org/jira/browse/NETBEANS-3733 > Project: NetBeans > Issue Type: Bug > Components: java - JUnit, projects - Maven >Affects Versions: 11.1, 11.2, 11.3 >Reporter: Bernard >Priority: Critical > > All defaults, hello world application as simple as possible. > How to reproduce: > Menu|File|New Project|Java with Maven|Java Application|Finish > Projects|New|java Class|NewClass|Finish > Add two methods: > public void hello1() { > System.out.println("Hello 1"); > } > > public void hello2() { > System.out.println("Hello 2"); > } > [Ctrl+Shift+U] Create / Update Tests|JUnit|OK > generates test as expected, adds dependencies to POM as expected: > > > org.junit.jupiter > junit-jupiter-api > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-params > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-engine > 5.3.1 > test > > > In generated class NewClassTest now I want to test the single method > "testHello2()" > So I put cursor on it and right click, "Run Focused Test Method". > I get a dialog: > "Feature requires update of POM" > "Executing single test method requires Surefire 2.8+ and JUnit in version 4.8 > and bigger. > Update your pom.xml?" > I click "Yes" > In pom.xml, another dependecy is added: > > junit > junit > 4.11 > > Si I try again. Put cursor on the method and right click, "Run Focused Test > Method". > I get a message > "No tests executed for mavenproject1" > This means that I cannot use the default way of NetBeans to quickly create a > class and test it. > This reproduces with all only defaults selected such as Java Maven project, > as simple as it can get. This has worked for about 10 years until it was > broken with JUnit 5. > How can we select JUnit 4 until this is mature? -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-3733) Cannot test single method with Maven and Junit 5
[ https://issues.apache.org/jira/browse/NETBEANS-3733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17095885#comment-17095885 ] Bernard commented on NETBEANS-3733: --- I upgraded to Maven 6.3 and changed NetBeans to use it. I cannot see how this improves anything. How can I get NetBeans to use JUnit 4? I cannot use NetBeans 8.2 which seems to work fine. Also the generated test classes do not compile - getting duplicate methods. JUnit 5 support seems to be broken. How can this go into a release untested? > Cannot test single method with Maven and Junit 5 > > > Key: NETBEANS-3733 > URL: https://issues.apache.org/jira/browse/NETBEANS-3733 > Project: NetBeans > Issue Type: Bug > Components: java - JUnit, projects - Maven >Affects Versions: 11.1, 11.2, 11.3 >Reporter: Bernard >Priority: Critical > > All defaults, hello world application as simple as possible. > How to reproduce: > Menu|File|New Project|Java with Maven|Java Application|Finish > Projects|New|java Class|NewClass|Finish > Add two methods: > public void hello1() { > System.out.println("Hello 1"); > } > > public void hello2() { > System.out.println("Hello 2"); > } > [Ctrl+Shift+U] Create / Update Tests|JUnit|OK > generates test as expected, adds dependencies to POM as expected: > > > org.junit.jupiter > junit-jupiter-api > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-params > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-engine > 5.3.1 > test > > > In generated class NewClassTest now I want to test the single method > "testHello2()" > So I put cursor on it and right click, "Run Focused Test Method". > I get a dialog: > "Feature requires update of POM" > "Executing single test method requires Surefire 2.8+ and JUnit in version 4.8 > and bigger. > Update your pom.xml?" > I click "Yes" > In pom.xml, another dependecy is added: > > junit > junit > 4.11 > > Si I try again. Put cursor on the method and right click, "Run Focused Test > Method". > I get a message > "No tests executed for mavenproject1" > This means that I cannot use the default way of NetBeans to quickly create a > class and test it. > This reproduces with all only defaults selected such as Java Maven project, > as simple as it can get. This has worked for about 10 years until it was > broken with JUnit 5. > How can we select JUnit 4 until this is mature? -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-3733) Cannot test single method with Maven and Junit 5
[ https://issues.apache.org/jira/browse/NETBEANS-3733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17094771#comment-17094771 ] Paulo Tibério Bulhões commented on NETBEANS-3733: - I ran into the same problem and I used to solution at [https://springframework.guru/why-your-junit-5-tests-are-not-running-under-maven/.|https://springframework.guru/why-your-junit-5-tests-are-not-running-under-maven/] I.e., edit the pom file and add dependencies for maven-surefire-plugin version 2.22.0. It worked fine for me but I am new to netbeans and there might be better solutions. > Cannot test single method with Maven and Junit 5 > > > Key: NETBEANS-3733 > URL: https://issues.apache.org/jira/browse/NETBEANS-3733 > Project: NetBeans > Issue Type: Bug > Components: java - JUnit, projects - Maven >Affects Versions: 11.1, 11.2 >Reporter: Bernard >Priority: Major > > All defaults, hello world application as simple as possible. > How to reproduce: > Menu|File|New Project|Java with Maven|Java Application|Finish > Projects|New|java Class|NewClass|Finish > Add two methods: > public void hello1() { > System.out.println("Hello 1"); > } > > public void hello2() { > System.out.println("Hello 2"); > } > [Ctrl+Shift+U] Create / Update Tests|JUnit|OK > generates test as expected, adds dependencies to POM as expected: > > > org.junit.jupiter > junit-jupiter-api > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-params > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-engine > 5.3.1 > test > > > In generated class NewClassTest now I want to test the single method > "testHello2()" > So I put cursor on it and right click, "Run Focused Test Method". > I get a dialog: > "Feature requires update of POM" > "Executing single test method requires Surefire 2.8+ and JUnit in version 4.8 > and bigger. > Update your pom.xml?" > I click "Yes" > In pom.xml, another dependecy is added: > > junit > junit > 4.11 > > Si I try again. Put cursor on the method and right click, "Run Focused Test > Method". > I get a message > "No tests executed for mavenproject1" > This means that I cannot use the default way of NetBeans to quickly create a > class and test it. > This reproduces with all only defaults selected such as Java Maven project, > as simple as it can get. This has worked for about 10 years until it was > broken with JUnit 5. > How can we select JUnit 4 until this is mature? -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-3733) Cannot test single method with Maven and Junit 5
[ https://issues.apache.org/jira/browse/NETBEANS-3733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17022571#comment-17022571 ] Bernard commented on NETBEANS-3733: --- This might be helpful: [Maven and JUnit 5: run a single test in a class|[http://example.com|https://stackoverflow.com/questions/45919894/maven-and-junit-5-run-a-single-test-in-a-class]] > Cannot test single method with Maven and Junit 5 > > > Key: NETBEANS-3733 > URL: https://issues.apache.org/jira/browse/NETBEANS-3733 > Project: NetBeans > Issue Type: Bug > Components: java - JUnit, projects - Maven >Affects Versions: 11.1, 11.2 >Reporter: Bernard >Priority: Major > > All defaults, hello world application as simple as possible. > How to reproduce: > Menu|File|New Project|Java with Maven|Java Application|Finish > Projects|New|java Class|NewClass|Finish > Add two methods: > public void hello1() { > System.out.println("Hello 1"); > } > > public void hello2() { > System.out.println("Hello 2"); > } > [Ctrl+Shift+U] Create / Update Tests|JUnit|OK > generates test as expected, adds dependencies to POM as expected: > > > org.junit.jupiter > junit-jupiter-api > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-params > 5.3.1 > test > > > org.junit.jupiter > junit-jupiter-engine > 5.3.1 > test > > > In generated class NewClassTest now I want to test the single method > "testHello2()" > So I put cursor on it and right click, "Run Focused Test Method". > I get a dialog: > "Feature requires update of POM" > "Executing single test method requires Surefire 2.8+ and JUnit in version 4.8 > and bigger. > Update your pom.xml?" > I click "Yes" > In pom.xml, another dependecy is added: > > junit > junit > 4.11 > > Si I try again. Put cursor on the method and right click, "Run Focused Test > Method". > I get a message > "No tests executed for mavenproject1" > This means that I cannot use the default way of NetBeans to quickly create a > class and test it. > This reproduces with all only defaults selected such as Java Maven project, > as simple as it can get. This has worked for about 10 years until it was > broken with JUnit 5. > How can we select JUnit 4 until this is mature? -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists