You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by HRH <hr...@yahoo.com.INVALID> on 2020/05/15 04:18:34 UTC
Netbeans 11.3 Tutorial JUnit Testing fails
Hi, I am following the tutorial step by step but LibClassTesting.java (generated JUnit test class by the IDE) fails. Here is the trace:
Testsuite: org.me.mylib.LibClassTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.133 sec
Testcase: initializationError(org.me.mylib.LibClassTest): Caused an ERROR
No runnable methods
java.lang.Exception: No runnable methods
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
Thanks
Re: Netbeans 11.3 Tutorial JUnit Testing fails
Posted by HRH <hr...@yahoo.com.INVALID>.
OK, I look forward to your screencast and the tutorial pointer.
thx
On Saturday, May 16, 2020, 2:44:33 PM GMT+4:30, Geertjan Wielenga <ge...@apache.org> wrote:
No, it’s quite different. I’ll make a screencast to show what the problem is and also show how the tutorial can be tweaked.
Gj
On Sat, 16 May 2020 at 11:59, HRH <hr...@yahoo.com.invalid> wrote:
GeertJan,
I thank you immensely. This worked fine and the test passed. I guess we can sum up that the putative JUnit 5 feature in Netbeans 11.3 needs attention.
Thanks again
On Saturday, May 16, 2020, 11:07:31 AM GMT+4:30, Geertjan Wielenga <ge...@apache.org> wrote:
OK, I think I've reproduced the problem.
Can you change the content of your test source file to the following and let us know if that works.
package org.me.mylib;
import org.junit.After;import org.junit.AfterClass;import org.junit.Before;import org.junit.BeforeClass;import org.junit.Test;import static org.junit.Assert.*;
public class LibClassTest {
public LibClassTest() { }
@BeforeClass public static void setUpClass() { }
@AfterClass public static void tearDownClass() { }
@Before public void setUp() { }
@After public void tearDown() { }
@Test public void testAcrostic() { System.err.println("Running testAcrostic..."); String result = LibClass.acrostic(new String[]{"fnord", "polly", "tropism"}); assertEquals("Correct value", "foo", result); }
}
Thanks,
Gj
On Sat, May 16, 2020 at 8:09 AM Geertjan Wielenga <ge...@apache.org> wrote:
In which part of the tutorial specifically are you encountering the problem, i.e., what is the name of the section where the problem occurs?
Gj
On Sat, May 16, 2020 at 7:49 AM HRH <hr...@yahoo.com> wrote:
Developing General Java Applications
|
|
| |
Developing General Java Applications
Apache NetBeans
Developing General Java Applications - Apache NetBeans
|
|
|
On Saturday, May 16, 2020, 10:19:25 AM GMT+4:30, HRH <hr...@yahoo.com> wrote:
Here is the link to the tutorial. Everything works up to the JUnit test section.
Thanks
On Saturday, May 16, 2020, 10:17:15 AM GMT+4:30, Geertjan Wielenga <ge...@apache.org> wrote:
Can you point to the tutorial you're referring to, so that I can try to reproduce the problem?
Gj
On Fri, May 15, 2020 at 6:18 AM HRH <hr...@yahoo.com.invalid> wrote:
Hi, I am following the tutorial step by step but LibClassTesting.java (generated JUnit test class by the IDE) fails. Here is the trace:
Testsuite: org.me.mylib.LibClassTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.133 sec
Testcase: initializationError(org.me.mylib.LibClassTest): Caused an ERROR
No runnable methods
java.lang.Exception: No runnable methods
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
Thanks
Re: Netbeans 11.3 Tutorial JUnit Testing fails
Posted by Geertjan Wielenga <ge...@apache.org>.
No, it’s quite different. I’ll make a screencast to show what the problem
is and also show how the tutorial can be tweaked.
Gj
On Sat, 16 May 2020 at 11:59, HRH <hr...@yahoo.com.invalid> wrote:
> GeertJan,
>
> I thank you immensely. This worked fine and the test passed. I guess we
> can sum up that the putative JUnit 5 feature in Netbeans 11.3 needs
> attention.
>
> Thanks again
>
> On Saturday, May 16, 2020, 11:07:31 AM GMT+4:30, Geertjan Wielenga <
> geertjan@apache.org> wrote:
>
>
> OK, I think I've reproduced the problem.
>
> Can you change the content of your test source file to the following and
> let us know if that works.
>
> package org.me.mylib;
>
> import org.junit.After;
> import org.junit.AfterClass;
> import org.junit.Before;
> import org.junit.BeforeClass;
> import org.junit.Test;
> import static org.junit.Assert.*;
>
> public class LibClassTest {
>
> public LibClassTest() {
> }
>
> @BeforeClass
> public static void setUpClass() {
> }
>
> @AfterClass
> public static void tearDownClass() {
> }
>
> @Before
> public void setUp() {
> }
>
> @After
> public void tearDown() {
> }
>
> @Test
> public void testAcrostic() {
> System.err.println("Running testAcrostic...");
> String result = LibClass.acrostic(new String[]{"fnord", "polly",
> "tropism"});
> assertEquals("Correct value", "foo", result);
> }
>
> }
>
>
>
> Thanks,
>
> Gj
>
> On Sat, May 16, 2020 at 8:09 AM Geertjan Wielenga <ge...@apache.org>
> wrote:
>
> In which part of the tutorial specifically are you encountering the
> problem, i.e., what is the name of the section where the problem occurs?
>
> Gj
>
> On Sat, May 16, 2020 at 7:49 AM HRH <hr...@yahoo.com> wrote:
>
> Developing General Java Applications
> <https://netbeans.apache.org/kb/docs/java/javase-intro.html>
>
> Developing General Java Applications
>
> Apache NetBeans
>
> Developing General Java Applications - Apache NetBeans
> <https://netbeans.apache.org/kb/docs/java/javase-intro.html>
>
>
>
> On Saturday, May 16, 2020, 10:19:25 AM GMT+4:30, HRH <hr...@yahoo.com>
> wrote:
>
>
> Here is the link to the tutorial. Everything works up to the JUnit test
> section.
>
> Thanks
> On Saturday, May 16, 2020, 10:17:15 AM GMT+4:30, Geertjan Wielenga <
> geertjan@apache.org> wrote:
>
>
> Can you point to the tutorial you're referring to, so that I can try to
> reproduce the problem?
>
> Gj
>
> On Fri, May 15, 2020 at 6:18 AM HRH <hr...@yahoo.com.invalid> wrote:
>
> Hi, I am following the tutorial step by step but LibClassTesting.java
> (generated JUnit test class by the IDE) fails. Here is the trace:
>
> Testsuite: org.me.mylib.LibClassTest
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.133 sec
>
> Testcase: initializationError(org.me.mylib.LibClassTest): Caused an
> ERROR
> No runnable methods
> java.lang.Exception: No runnable methods
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
> at
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
>
> Thanks
>
>
Re: Netbeans 11.3 Tutorial JUnit Testing fails
Posted by HRH <hr...@yahoo.com.INVALID>.
GeertJan,
I thank you immensely. This worked fine and the test passed. I guess we can sum up that the putative JUnit 5 feature in Netbeans 11.3 needs attention.
Thanks again
On Saturday, May 16, 2020, 11:07:31 AM GMT+4:30, Geertjan Wielenga <ge...@apache.org> wrote:
OK, I think I've reproduced the problem.
Can you change the content of your test source file to the following and let us know if that works.
package org.me.mylib;
import org.junit.After;import org.junit.AfterClass;import org.junit.Before;import org.junit.BeforeClass;import org.junit.Test;import static org.junit.Assert.*;
public class LibClassTest {
public LibClassTest() { }
@BeforeClass public static void setUpClass() { }
@AfterClass public static void tearDownClass() { }
@Before public void setUp() { }
@After public void tearDown() { }
@Test public void testAcrostic() { System.err.println("Running testAcrostic..."); String result = LibClass.acrostic(new String[]{"fnord", "polly", "tropism"}); assertEquals("Correct value", "foo", result); }
}
Thanks,
Gj
On Sat, May 16, 2020 at 8:09 AM Geertjan Wielenga <ge...@apache.org> wrote:
In which part of the tutorial specifically are you encountering the problem, i.e., what is the name of the section where the problem occurs?
Gj
On Sat, May 16, 2020 at 7:49 AM HRH <hr...@yahoo.com> wrote:
Developing General Java Applications
|
|
| |
Developing General Java Applications
Apache NetBeans
Developing General Java Applications - Apache NetBeans
|
|
|
On Saturday, May 16, 2020, 10:19:25 AM GMT+4:30, HRH <hr...@yahoo.com> wrote:
Here is the link to the tutorial. Everything works up to the JUnit test section.
Thanks
On Saturday, May 16, 2020, 10:17:15 AM GMT+4:30, Geertjan Wielenga <ge...@apache.org> wrote:
Can you point to the tutorial you're referring to, so that I can try to reproduce the problem?
Gj
On Fri, May 15, 2020 at 6:18 AM HRH <hr...@yahoo.com.invalid> wrote:
Hi, I am following the tutorial step by step but LibClassTesting.java (generated JUnit test class by the IDE) fails. Here is the trace:
Testsuite: org.me.mylib.LibClassTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.133 sec
Testcase: initializationError(org.me.mylib.LibClassTest): Caused an ERROR
No runnable methods
java.lang.Exception: No runnable methods
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
Thanks
Re: Netbeans 11.3 Tutorial JUnit Testing fails
Posted by Geertjan Wielenga <ge...@apache.org>.
OK, I think I've reproduced the problem.
Can you change the content of your test source file to the following and
let us know if that works.
package org.me.mylib;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
public class LibClassTest {
public LibClassTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
@Test
public void testAcrostic() {
System.err.println("Running testAcrostic...");
String result = LibClass.acrostic(new String[]{"fnord", "polly",
"tropism"});
assertEquals("Correct value", "foo", result);
}
}
Thanks,
Gj
On Sat, May 16, 2020 at 8:09 AM Geertjan Wielenga <ge...@apache.org>
wrote:
> In which part of the tutorial specifically are you encountering the
> problem, i.e., what is the name of the section where the problem occurs?
>
> Gj
>
> On Sat, May 16, 2020 at 7:49 AM HRH <hr...@yahoo.com> wrote:
>
>> Developing General Java Applications
>> <https://netbeans.apache.org/kb/docs/java/javase-intro.html>
>>
>> Developing General Java Applications
>>
>> Apache NetBeans
>>
>> Developing General Java Applications - Apache NetBeans
>> <https://netbeans.apache.org/kb/docs/java/javase-intro.html>
>>
>>
>>
>> On Saturday, May 16, 2020, 10:19:25 AM GMT+4:30, HRH <hr...@yahoo.com>
>> wrote:
>>
>>
>> Here is the link to the tutorial. Everything works up to the JUnit test
>> section.
>>
>> Thanks
>> On Saturday, May 16, 2020, 10:17:15 AM GMT+4:30, Geertjan Wielenga <
>> geertjan@apache.org> wrote:
>>
>>
>> Can you point to the tutorial you're referring to, so that I can try to
>> reproduce the problem?
>>
>> Gj
>>
>> On Fri, May 15, 2020 at 6:18 AM HRH <hr...@yahoo.com.invalid> wrote:
>>
>> Hi, I am following the tutorial step by step but LibClassTesting.java
>> (generated JUnit test class by the IDE) fails. Here is the trace:
>>
>> Testsuite: org.me.mylib.LibClassTest
>> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.133 sec
>>
>> Testcase: initializationError(org.me.mylib.LibClassTest): Caused an
>> ERROR
>> No runnable methods
>> java.lang.Exception: No runnable methods
>> at
>> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>> at
>> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>> at
>> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>> at
>> java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
>> at
>> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
>>
>> Thanks
>>
>>
Re: Netbeans 11.3 Tutorial JUnit Testing fails
Posted by Geertjan Wielenga <ge...@apache.org>.
In which part of the tutorial specifically are you encountering the
problem, i.e., what is the name of the section where the problem occurs?
Gj
On Sat, May 16, 2020 at 7:49 AM HRH <hr...@yahoo.com> wrote:
> Developing General Java Applications
> <https://netbeans.apache.org/kb/docs/java/javase-intro.html>
>
> Developing General Java Applications
>
> Apache NetBeans
>
> Developing General Java Applications - Apache NetBeans
> <https://netbeans.apache.org/kb/docs/java/javase-intro.html>
>
>
>
> On Saturday, May 16, 2020, 10:19:25 AM GMT+4:30, HRH <hr...@yahoo.com>
> wrote:
>
>
> Here is the link to the tutorial. Everything works up to the JUnit test
> section.
>
> Thanks
> On Saturday, May 16, 2020, 10:17:15 AM GMT+4:30, Geertjan Wielenga <
> geertjan@apache.org> wrote:
>
>
> Can you point to the tutorial you're referring to, so that I can try to
> reproduce the problem?
>
> Gj
>
> On Fri, May 15, 2020 at 6:18 AM HRH <hr...@yahoo.com.invalid> wrote:
>
> Hi, I am following the tutorial step by step but LibClassTesting.java
> (generated JUnit test class by the IDE) fails. Here is the trace:
>
> Testsuite: org.me.mylib.LibClassTest
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.133 sec
>
> Testcase: initializationError(org.me.mylib.LibClassTest): Caused an
> ERROR
> No runnable methods
> java.lang.Exception: No runnable methods
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
> at
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
>
> Thanks
>
>
Re: Netbeans 11.3 Tutorial JUnit Testing fails
Posted by HRH <hr...@yahoo.com.INVALID>.
Developing General Java Applications
|
|
| |
Developing General Java Applications
Apache NetBeans
Developing General Java Applications - Apache NetBeans
|
|
|
On Saturday, May 16, 2020, 10:19:25 AM GMT+4:30, HRH <hr...@yahoo.com> wrote:
Here is the link to the tutorial. Everything works up to the JUnit test section.
Thanks
On Saturday, May 16, 2020, 10:17:15 AM GMT+4:30, Geertjan Wielenga <ge...@apache.org> wrote:
Can you point to the tutorial you're referring to, so that I can try to reproduce the problem?
Gj
On Fri, May 15, 2020 at 6:18 AM HRH <hr...@yahoo.com.invalid> wrote:
Hi, I am following the tutorial step by step but LibClassTesting.java (generated JUnit test class by the IDE) fails. Here is the trace:
Testsuite: org.me.mylib.LibClassTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.133 sec
Testcase: initializationError(org.me.mylib.LibClassTest): Caused an ERROR
No runnable methods
java.lang.Exception: No runnable methods
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
Thanks
Re: Netbeans 11.3 Tutorial JUnit Testing fails
Posted by HRH <hr...@yahoo.com.INVALID>.
Here is the link to the tutorial. Everything works up to the JUnit test section.
Thanks
On Saturday, May 16, 2020, 10:17:15 AM GMT+4:30, Geertjan Wielenga <ge...@apache.org> wrote:
Can you point to the tutorial you're referring to, so that I can try to reproduce the problem?
Gj
On Fri, May 15, 2020 at 6:18 AM HRH <hr...@yahoo.com.invalid> wrote:
Hi, I am following the tutorial step by step but LibClassTesting.java (generated JUnit test class by the IDE) fails. Here is the trace:
Testsuite: org.me.mylib.LibClassTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.133 sec
Testcase: initializationError(org.me.mylib.LibClassTest): Caused an ERROR
No runnable methods
java.lang.Exception: No runnable methods
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
Thanks
Re: Netbeans 11.3 Tutorial JUnit Testing fails
Posted by Geertjan Wielenga <ge...@apache.org>.
Can you point to the tutorial you're referring to, so that I can try to
reproduce the problem?
Gj
On Fri, May 15, 2020 at 6:18 AM HRH <hr...@yahoo.com.invalid> wrote:
> Hi, I am following the tutorial step by step but LibClassTesting.java
> (generated JUnit test class by the IDE) fails. Here is the trace:
>
> Testsuite: org.me.mylib.LibClassTest
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.133 sec
>
> Testcase: initializationError(org.me.mylib.LibClassTest): Caused an
> ERROR
> No runnable methods
> java.lang.Exception: No runnable methods
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
> at
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
>
> Thanks
>