[
https://issues.apache.org/jira/browse/NETBEANS-6041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ratcash Developer updated NETBEANS-6041:
----------------------------------------
Description:
Given a test case like:
{code:java}
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
public class SampleTest {
@Test
public void testMyMethod1() {
System.out.println("write this");
}
@Nested
class NestedClass {
@Test
public void testMyMethod2() {
System.out.println("nested write 2");
}
}
@Nested
class NestedClass2 {
@Test
public void testMyMethod1() {
System.out.println("nested write 1");
}
@Test
public void testMyMethod3() {
System.out.println("nested write 3");
}
@Nested
class DoubleNestedClass3 {
@Test
public void testMyMethod4() {
System.out.println("double nested write 4");
}
@Test
public void testNextedException() throws Exception {
throw new Exception();
}
}
}
}
{code}
A couple of issues with such tests:
1. The "Test Results" window shows only some of the executed tests (in this
specific case only 3)
!image-2021-09-21-19-12-29-711.png!
2. the "Go to source" function does not work even for the test cases that are
shown.
Clearly, part of this is caused by the $ClassName in the test classname, which
is not correctly processed by the `Location` class.
Netbean's own navigator is able to navigate such classes, so this should be
supported by the Finder, but I was not able to figure out the right syntax.
was:
Given a test case like:
{code:java}
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
public class SampleTest {
@Test
public void testMyMethod1() {
System.out.println("write this");
}
@Nested
class NestedClass {
@Test
public void testMyMethod2() {
System.out.println("nested write 2");
}
}
@Nested
class NestedClass2 {
@Test
public void testMyMethod1() {
System.out.println("nested write 1");
}
@Test
public void testMyMethod3() {
System.out.println("nested write 3");
}
@Nested
class DoubleNestedClass3 {
@Test
public void testMyMethod4() {
System.out.println("double nested write 4");
}
@Test
public void testNextedException() throws Exception {
throw new Exception();
}
}
}
}
{code}
The "Test Results" window shows only some of the executed tests (in this
specific case only 3) and the "Go to source" function does not work even for
the test cases that are shown.
Clearly, part of this is caused by the $ClassName in the test classname, which
is not correctly processed by the `Location` class.
Netbean's own navigator is able to navigate such classes, so this should be
supported by the Finder, but I was not able to figure out the right syntax.
> Go To Source and test-results view broken with JUnit5 @Nested
> -------------------------------------------------------------
>
> Key: NETBEANS-6041
> URL: https://issues.apache.org/jira/browse/NETBEANS-6041
> Project: NetBeans
> Issue Type: Bug
> Components: projects - Gradle
> Affects Versions: 12.4, 12.5
> Environment: Manjaro Linux, kernel 5.14.2
> Netbeans 12.5
>
> Reporter: Ratcash Developer
> Assignee: Laszlo Kishalmi
> Priority: Major
> Attachments: image-2021-09-21-19-12-29-711.png
>
>
> Given a test case like:
> {code:java}
> import org.junit.jupiter.api.Nested;
> import org.junit.jupiter.api.Test;
> public class SampleTest {
> @Test
> public void testMyMethod1() {
> System.out.println("write this");
> }
> @Nested
> class NestedClass {
> @Test
> public void testMyMethod2() {
> System.out.println("nested write 2");
> }
> }
> @Nested
> class NestedClass2 {
> @Test
> public void testMyMethod1() {
> System.out.println("nested write 1");
> }
> @Test
> public void testMyMethod3() {
> System.out.println("nested write 3");
> }
> @Nested
> class DoubleNestedClass3 {
> @Test
> public void testMyMethod4() {
> System.out.println("double nested write 4");
> }
> @Test
> public void testNextedException() throws Exception {
> throw new Exception();
> }
> }
> }
> }
> {code}
> A couple of issues with such tests:
>
> 1. The "Test Results" window shows only some of the executed tests (in this
> specific case only 3)
> !image-2021-09-21-19-12-29-711.png!
> 2. the "Go to source" function does not work even for the test cases that are
> shown.
> Clearly, part of this is caused by the $ClassName in the test classname,
> which is not correctly processed by the `Location` class.
> Netbean's own navigator is able to navigate such classes, so this should be
> supported by the Finder, but I was not able to figure out the right syntax.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists