Topics

A NetBeans issue with running tests

Bob M.
 

Netbeans seems to be the topic of the year (so far). I'm looking for a
solution to a problem where I cannot successfully build and run any JMRI
test from within NetBeans. I can build and execute the source code within
NetBeans, but executing tests is a problem.

It used to be that I could execute alltest (or its variants) from within
NetBeans, without problem. I could simply hit <ctrl><F6> to execute the
test for the currently-active source code file. None of that works any
more.

When I hit <ctrl><F6> (i.e. NetBeans "run the test for this particular
class"), after "realclean", I get:

ant -f "E:\\User Data\\NetBeans\\JMRI\\nbproject\\nbjdk.xml"
-Dtest.includes=jmri.jmrix.loconet.LnTurnoutTest test-single
Warning: nbjdk.active=JDK_1.8 or nbjdk.home=${platforms.JDK_1.8.home} is an
invalid Java platform; ignoring and using C:\Program Files\Java\jdk1.8.0_25
test-single:
Execute failed: java.io.IOException: Cannot run program "git" (in directory
"E:\User Data\NetBeans\JMRI"): CreateProcess error=2, The system cannot find
the file specified
JMRI.init:
JMRI.copyfiles:
JMRI.jjtree:
JMRI.javacc:
JMRI.update-template-code:
Copying 1 file to E:\User Data\NetBeans\JMRI\java\tmp
JMRI.compile-generated-source:
Copying 1 file to E:\User Data\NetBeans\JMRI\target\classes\jmri
JMRI.compile:
JMRI.debug:
JMRI.tests:
Compiling 4867 source files to E:\User
Data\NetBeans\JMRI\target\test-classes
warning: Supported source version 'RELEASE_7' from annotation processor
'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than
-source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor
'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source
'1.8'
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\idTag\JsonIdTagHttpServiceTest
.java:37: error: cannot find symbol
public class JsonIdTagHttpServiceTest extends
JsonNamedBeanHttpServiceTestBase<IdTag, JsonIdTagHttpService> {
symbol: class JsonIdTagHttpService
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalHead\JsonSignalHeadHttpS
erviceTest.java:28: error: cannot find symbol
public class JsonSignalHeadHttpServiceTest extends
JsonHttpServiceTestBase<JsonSignalHeadHttpService> {
symbol: class JsonSignalHeadHttpService
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalHead\JsonSignalHeadSocke
tServiceTest.java:211: error: cannot find symbol
private static class TestJsonSignalHeadHttpService extends
JsonSignalHeadHttpService {
symbol: class JsonSignalHeadHttpService
location: class JsonSignalHeadSocketServiceTest
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalMast\JsonSignalMastHttpS
erviceTest.java:32: error: cannot find symbol
public class JsonSignalMastHttpServiceTest extends
JsonNamedBeanHttpServiceTestBase<SignalMast, JsonSignalMastHttpService>{
symbol: class JsonSignalMastHttpService
4 errors
2 warnings
E:\User Data\NetBeans\JMRI\nbproject\nbjdk.xml:47: The following error
occurred while executing this line:
E:\User Data\NetBeans\JMRI\build.xml:644: The following error occurred while
executing this line:
E:\User Data\NetBeans\JMRI\build.xml:595: Compile failed; see the compiler
error output for details.
BUILD FAILED (total time: 58 seconds)

All of the warnings are ones I had before I encountered this test compile
problem. And I get the same set of errors if I try to execute build.xml's
"alltest" from within NetBeans. I have updated from HEAD of master. I have
executed "realclean".

It seems like the test files under test/jmri/server/json/idTag/*,
test/jmri/server/json/signalHead/*, test/server/json/signalMast/* are all
"generated" code, and all have problems in NetBeans - presumably they are
not properly compiled in the proper sequence. The remaining code under
test/jmri/server/json is not "generated" code, and Netbeans is not
complaining about these during testcase build-and-run.

So it seems that NetBeans is having problems with "generated" code in
test/jmri/server/json. I suspect something needs to be changed in the
NetBeans-specific configuration stuff, perhaps in a way similar to the
"generated" code in java/src.

I do not pretend to have any idea how "generated" test code is handled in
the NetBeans-specific stuff, so I cannot unravel the java/src generated code
handling to figure out the trick for the java/test generated code.

Any thoughts on how to resolve this new NetBeans challenge?

Regards,
Bob M.

Randall Wood
 

None of those classes are generated code, if they are not present, you do not have a usable working copy of the JMRI source code. I also don’t think we support running (or testing) JMRI on such an old version of Java 1.8 (update 25) as you are using due to changes in the security algorithms and trust stores around update 101 or 110 (I forget which).

Randall

On Jan 6, 2020, at 17:06, Bob M. <jawhugrps@...> wrote:

Netbeans seems to be the topic of the year (so far). I'm looking for a
solution to a problem where I cannot successfully build and run any JMRI
test from within NetBeans. I can build and execute the source code within
NetBeans, but executing tests is a problem.

It used to be that I could execute alltest (or its variants) from within
NetBeans, without problem. I could simply hit <ctrl><F6> to execute the
test for the currently-active source code file. None of that works any
more.

When I hit <ctrl><F6> (i.e. NetBeans "run the test for this particular
class"), after "realclean", I get:

ant -f "E:\\User Data\\NetBeans\\JMRI\\nbproject\\nbjdk.xml"
-Dtest.includes=jmri.jmrix.loconet.LnTurnoutTest test-single
Warning: nbjdk.active=JDK_1.8 or nbjdk.home=${platforms.JDK_1.8.home} is an
invalid Java platform; ignoring and using C:\Program Files\Java\jdk1.8.0_25
test-single:
Execute failed: java.io.IOException: Cannot run program "git" (in directory
"E:\User Data\NetBeans\JMRI"): CreateProcess error=2, The system cannot find
the file specified
JMRI.init:
JMRI.copyfiles:
JMRI.jjtree:
JMRI.javacc:
JMRI.update-template-code:
Copying 1 file to E:\User Data\NetBeans\JMRI\java\tmp
JMRI.compile-generated-source:
Copying 1 file to E:\User Data\NetBeans\JMRI\target\classes\jmri
JMRI.compile:
JMRI.debug:
JMRI.tests:
Compiling 4867 source files to E:\User
Data\NetBeans\JMRI\target\test-classes
warning: Supported source version 'RELEASE_7' from annotation processor
'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than
-source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor
'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source
'1.8'
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\idTag\JsonIdTagHttpServiceTest
.java:37: error: cannot find symbol
public class JsonIdTagHttpServiceTest extends
JsonNamedBeanHttpServiceTestBase<IdTag, JsonIdTagHttpService> {
symbol: class JsonIdTagHttpService
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalHead\JsonSignalHeadHttpS
erviceTest.java:28: error: cannot find symbol
public class JsonSignalHeadHttpServiceTest extends
JsonHttpServiceTestBase<JsonSignalHeadHttpService> {
symbol: class JsonSignalHeadHttpService
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalHead\JsonSignalHeadSocke
tServiceTest.java:211: error: cannot find symbol
private static class TestJsonSignalHeadHttpService extends
JsonSignalHeadHttpService {
symbol: class JsonSignalHeadHttpService
location: class JsonSignalHeadSocketServiceTest
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalMast\JsonSignalMastHttpS
erviceTest.java:32: error: cannot find symbol
public class JsonSignalMastHttpServiceTest extends
JsonNamedBeanHttpServiceTestBase<SignalMast, JsonSignalMastHttpService>{
symbol: class JsonSignalMastHttpService
4 errors
2 warnings
E:\User Data\NetBeans\JMRI\nbproject\nbjdk.xml:47: The following error
occurred while executing this line:
E:\User Data\NetBeans\JMRI\build.xml:644: The following error occurred while
executing this line:
E:\User Data\NetBeans\JMRI\build.xml:595: Compile failed; see the compiler
error output for details.
BUILD FAILED (total time: 58 seconds)

All of the warnings are ones I had before I encountered this test compile
problem. And I get the same set of errors if I try to execute build.xml's
"alltest" from within NetBeans. I have updated from HEAD of master. I have
executed "realclean".

It seems like the test files under test/jmri/server/json/idTag/*,
test/jmri/server/json/signalHead/*, test/server/json/signalMast/* are all
"generated" code, and all have problems in NetBeans - presumably they are
not properly compiled in the proper sequence. The remaining code under
test/jmri/server/json is not "generated" code, and Netbeans is not
complaining about these during testcase build-and-run.

So it seems that NetBeans is having problems with "generated" code in
test/jmri/server/json. I suspect something needs to be changed in the
NetBeans-specific configuration stuff, perhaps in a way similar to the
"generated" code in java/src.

I do not pretend to have any idea how "generated" test code is handled in
the NetBeans-specific stuff, so I cannot unravel the java/src generated code
handling to figure out the trick for the java/test generated code.

Any thoughts on how to resolve this new NetBeans challenge?

Regards,
Bob M.



Bob Jacobsen
 

Java 8u101 or later is required for development.

Bob

On Jan 6, 2020, at 2:21 PM, Randall Wood via Groups.Io <rhwood=mac.com@groups.io> wrote:

None of those classes are generated code, if they are not present, you do not have a usable working copy of the JMRI source code. I also don’t think we support running (or testing) JMRI on such an old version of Java 1.8 (update 25) as you are using due to changes in the security algorithms and trust stores around update 101 or 110 (I forget which).

Randall
On Jan 6, 2020, at 17:06, Bob M. <jawhugrps@...> wrote:

Netbeans seems to be the topic of the year (so far). I'm looking for a
solution to a problem where I cannot successfully build and run any JMRI
test from within NetBeans. I can build and execute the source code within
NetBeans, but executing tests is a problem.

It used to be that I could execute alltest (or its variants) from within
NetBeans, without problem. I could simply hit <ctrl><F6> to execute the
test for the currently-active source code file. None of that works any
more.

When I hit <ctrl><F6> (i.e. NetBeans "run the test for this particular
class"), after "realclean", I get:

ant -f "E:\\User Data\\NetBeans\\JMRI\\nbproject\\nbjdk.xml"
-Dtest.includes=jmri.jmrix.loconet.LnTurnoutTest test-single
Warning: nbjdk.active=JDK_1.8 or nbjdk.home=${platforms.JDK_1.8.home} is an
invalid Java platform; ignoring and using C:\Program Files\Java\jdk1.8.0_25
test-single:
Execute failed: java.io.IOException: Cannot run program "git" (in directory
"E:\User Data\NetBeans\JMRI"): CreateProcess error=2, The system cannot find
the file specified
JMRI.init:
JMRI.copyfiles:
JMRI.jjtree:
JMRI.javacc:
JMRI.update-template-code:
Copying 1 file to E:\User Data\NetBeans\JMRI\java\tmp
JMRI.compile-generated-source:
Copying 1 file to E:\User Data\NetBeans\JMRI\target\classes\jmri
JMRI.compile:
JMRI.debug:
JMRI.tests:
Compiling 4867 source files to E:\User
Data\NetBeans\JMRI\target\test-classes
warning: Supported source version 'RELEASE_7' from annotation processor
'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than
-source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor
'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source
'1.8'
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\idTag\JsonIdTagHttpServiceTest
.java:37: error: cannot find symbol
public class JsonIdTagHttpServiceTest extends
JsonNamedBeanHttpServiceTestBase<IdTag, JsonIdTagHttpService> {
symbol: class JsonIdTagHttpService
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalHead\JsonSignalHeadHttpS
erviceTest.java:28: error: cannot find symbol
public class JsonSignalHeadHttpServiceTest extends
JsonHttpServiceTestBase<JsonSignalHeadHttpService> {
symbol: class JsonSignalHeadHttpService
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalHead\JsonSignalHeadSocke
tServiceTest.java:211: error: cannot find symbol
private static class TestJsonSignalHeadHttpService extends
JsonSignalHeadHttpService {
symbol: class JsonSignalHeadHttpService
location: class JsonSignalHeadSocketServiceTest
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalMast\JsonSignalMastHttpS
erviceTest.java:32: error: cannot find symbol
public class JsonSignalMastHttpServiceTest extends
JsonNamedBeanHttpServiceTestBase<SignalMast, JsonSignalMastHttpService>{
symbol: class JsonSignalMastHttpService
4 errors
2 warnings
E:\User Data\NetBeans\JMRI\nbproject\nbjdk.xml:47: The following error
occurred while executing this line:
E:\User Data\NetBeans\JMRI\build.xml:644: The following error occurred while
executing this line:
E:\User Data\NetBeans\JMRI\build.xml:595: Compile failed; see the compiler
error output for details.
BUILD FAILED (total time: 58 seconds)

All of the warnings are ones I had before I encountered this test compile
problem. And I get the same set of errors if I try to execute build.xml's
"alltest" from within NetBeans. I have updated from HEAD of master. I have
executed "realclean".

It seems like the test files under test/jmri/server/json/idTag/*,
test/jmri/server/json/signalHead/*, test/server/json/signalMast/* are all
"generated" code, and all have problems in NetBeans - presumably they are
not properly compiled in the proper sequence. The remaining code under
test/jmri/server/json is not "generated" code, and Netbeans is not
complaining about these during testcase build-and-run.

So it seems that NetBeans is having problems with "generated" code in
test/jmri/server/json. I suspect something needs to be changed in the
NetBeans-specific configuration stuff, perhaps in a way similar to the
"generated" code in java/src.

I do not pretend to have any idea how "generated" test code is handled in
the NetBeans-specific stuff, so I cannot unravel the java/src generated code
handling to figure out the trick for the java/test generated code.

Any thoughts on how to resolve this new NetBeans challenge?

Regards,
Bob M.





--
Bob Jacobsen
@BobJacobsen

danielb987
 

Make sure you always do a clean build after you have downloaded code from GitHub. Netbeans tries to be smart and only compiles the changed parts of the code, and several times I have been hit by Netbeans fail to understand what needs to be compiled.

I use Netbeans 8.2 with Java 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03 on Windows 8.1. It works fine for me.

Some tests fail for me, but that's probably because I have a Swedish computer so I get some dialogs in Swedish when I run the tests from NetBeans. But tests without dialogs works just fine.

For info, I cannot run for example jmri.jmrit.beantable.TurnoutTableWindowTest since it shows a dialog with the text "Avbryt" instead of "Cancel".

Daniel

2020-01-06 23:06 skrev Bob M.:

Netbeans seems to be the topic of the year (so far). I'm looking for a
solution to a problem where I cannot successfully build and run any JMRI
test from within NetBeans. I can build and execute the source code within
NetBeans, but executing tests is a problem.
It used to be that I could execute alltest (or its variants) from within
NetBeans, without problem. I could simply hit <ctrl><F6> to execute the
test for the currently-active source code file. None of that works any
more.
When I hit <ctrl><F6> (i.e. NetBeans "run the test for this particular
class"), after "realclean", I get:
ant -f "E:\\User Data\\NetBeans\\JMRI\\nbproject\\nbjdk.xml"
-Dtest.includes=jmri.jmrix.loconet.LnTurnoutTest test-single
Warning: nbjdk.active=JDK_1.8 or nbjdk.home=${platforms.JDK_1.8.home} is an
invalid Java platform; ignoring and using C:\Program Files\Java\jdk1.8.0_25
test-single:
Execute failed: java.io.IOException: Cannot run program "git" (in directory
"E:\User Data\NetBeans\JMRI"): CreateProcess error=2, The system cannot find
the file specified
JMRI.init:
JMRI.copyfiles:
JMRI.jjtree:
JMRI.javacc:
JMRI.update-template-code:
Copying 1 file to E:\User Data\NetBeans\JMRI\java\tmp
JMRI.compile-generated-source:
Copying 1 file to E:\User Data\NetBeans\JMRI\target\classes\jmri
JMRI.compile:
JMRI.debug:
JMRI.tests:
Compiling 4867 source files to E:\User
Data\NetBeans\JMRI\target\test-classes
warning: Supported source version 'RELEASE_7' from annotation processor
'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than
-source '1.8'
warning: Supported source version 'RELEASE_7' from annotation processor
'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source
'1.8'
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\idTag\JsonIdTagHttpServiceTest
.java:37: error: cannot find symbol
public class JsonIdTagHttpServiceTest extends
JsonNamedBeanHttpServiceTestBase<IdTag, JsonIdTagHttpService> {
symbol: class JsonIdTagHttpService
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalHead\JsonSignalHeadHttpS
erviceTest.java:28: error: cannot find symbol
public class JsonSignalHeadHttpServiceTest extends
JsonHttpServiceTestBase<JsonSignalHeadHttpService> {
symbol: class JsonSignalHeadHttpService
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalHead\JsonSignalHeadSocke
tServiceTest.java:211: error: cannot find symbol
private static class TestJsonSignalHeadHttpService extends
JsonSignalHeadHttpService {
symbol: class JsonSignalHeadHttpService
location: class JsonSignalHeadSocketServiceTest
E:\User
Data\NetBeans\JMRI\java\test\jmri\server\json\signalMast\JsonSignalMastHttpS
erviceTest.java:32: error: cannot find symbol
public class JsonSignalMastHttpServiceTest extends
JsonNamedBeanHttpServiceTestBase<SignalMast, JsonSignalMastHttpService>{
symbol: class JsonSignalMastHttpService
4 errors
2 warnings
E:\User Data\NetBeans\JMRI\nbproject\nbjdk.xml:47: The following error
occurred while executing this line:
E:\User Data\NetBeans\JMRI\build.xml:644: The following error occurred while
executing this line:
E:\User Data\NetBeans\JMRI\build.xml:595: Compile failed; see the compiler
error output for details.
BUILD FAILED (total time: 58 seconds)
All of the warnings are ones I had before I encountered this test compile
problem. And I get the same set of errors if I try to execute build.xml's
"alltest" from within NetBeans. I have updated from HEAD of master. I have
executed "realclean".
It seems like the test files under test/jmri/server/json/idTag/*,
test/jmri/server/json/signalHead/*, test/server/json/signalMast/* are all
"generated" code, and all have problems in NetBeans - presumably they are
not properly compiled in the proper sequence. The remaining code under
test/jmri/server/json is not "generated" code, and Netbeans is not
complaining about these during testcase build-and-run.
So it seems that NetBeans is having problems with "generated" code in
test/jmri/server/json. I suspect something needs to be changed in the
NetBeans-specific configuration stuff, perhaps in a way similar to the
"generated" code in java/src.
I do not pretend to have any idea how "generated" test code is handled in
the NetBeans-specific stuff, so I cannot unravel the java/src generated code
handling to figure out the trick for the java/test generated code.
Any thoughts on how to resolve this new NetBeans challenge?
Regards,
Bob M.

Bob M.
 

Problem solved.

Further investigation into my problem was fruitless, so I cloned a new copy of the github repository. This local repository compiles and runs tests successfully.

So, for my particular case, I had a corrupted local repository, and NetBeans was (likely) not at fault.

Regards,
Bob M.