This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 236359 - IllegalStateException at org.netbeans.modules.junit.DefaultPlugin.getTestClassPath
Summary: IllegalStateException at org.netbeans.modules.junit.DefaultPlugin.getTestClas...
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 7.4
Hardware: All All
: P2 normal (vote)
Assignee: Theofanis Oikonomou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-25 10:58 UTC by Stepan Zebra
Modified: 2013-11-22 12:52 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 204134


Attachments
stacktrace (901 bytes, text/plain)
2013-09-25 10:58 UTC, Stepan Zebra
Details
stacktrace (1.60 KB, text/plain)
2013-10-08 15:16 UTC, Marian Mirilovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stepan Zebra 2013-09-25 10:58:00 UTC
Build: NetBeans IDE 7.4 RC1 (Build 201309162201)
VM: Java HotSpot(TM) 64-Bit Server VM, 24.0-b55, Java(TM) SE Runtime Environment, 1.7.0_40-b39
OS: Windows 7

User Comments:
stezeb: running NB J2EEValidation functional test in 7.4 RC1




Stacktrace: 
java.lang.IllegalStateException
   at org.netbeans.modules.junit.DefaultPlugin.getTestClassPath(DefaultPlugin.java:1429)
   at org.netbeans.modules.junit.DefaultPlugin.logJUnitUsage(DefaultPlugin.java:184)
   at org.netbeans.modules.junit.output.JUnitOutputReader.<init>(JUnitOutputReader.java:190)
   at org.netbeans.modules.junit.output.JUnitAntLogger.getOutputReader(JUnitAntLogger.java:397)
   at org.netbeans.modules.junit.output.JUnitAntLogger.buildFinished(JUnitAntLogger.java:352)
   at org.apache.tools.ant.module.bridge.impl.NbBuildLogger.buildFinished(NbBuildLogger.java:440)
Comment 1 Stepan Zebra 2013-09-25 10:58:02 UTC
Created attachment 140448 [details]
stacktrace
Comment 2 Stepan Zebra 2013-09-25 11:08:27 UTC
I see this exception whenever I try to run any functional test from j2ee.kit package in 7.4 RC1 or in latest Dev. After the exception, the tests seems to start normally, but fail to finish.
I'm not sure if there is some problem with my configuration/installation, but it works fine when I launch these tests from 7.4 Beta. Please advise.
Comment 3 Theofanis Oikonomou 2013-09-25 12:04:44 UTC
(In reply to Stepan Zebra from comment #2)
> I see this exception whenever I try to run any functional test from j2ee.kit
> package in 7.4 RC1 or in latest Dev. After the exception, the tests seems to
> start normally, but fail to finish.
> I'm not sure if there is some problem with my configuration/installation,
> but it works fine when I launch these tests from 7.4 Beta. Please advise.

The ISE is thrown because there are no test folders found. When trying to run the J2EEValidation test I get info messages like this:

test-init:
Sep 25, 2013 1:55:56 PM org.netbeans.jellytools.modules.j2ee.J2eeTestCase registerGlassFish
Testsuite: org.netbeans.test.j2ee.J2EEValidation
WARNING: Valid GlassFish server not found at path null
Sep 25, 2013 1:55:56 PM org.netbeans.jellytools.modules.j2ee.J2eeTestCase addServerTests
INFO: no server to add tests
Sep 25, 2013 1:55:56 PM org.netbeans.jellytools.modules.j2ee.J2eeTestCase addServerTests
INFO: jboss.home=null
Sep 25, 2013 1:55:56 PM org.netbeans.jellytools.modules.j2ee.J2eeTestCase addServerTests
INFO: tomcat.home=null
Sep 25, 2013 1:55:56 PM org.netbeans.jellytools.modules.j2ee.J2eeTestCase addServerTests
INFO: glassfish.home=null

and later on a couple of
########  testEmpty  #######

In the J2EEValidation file I see comment that the test-qa-functional-sys-prop.glassfish.home property must be set in order to run the tests. Have you set this property? Maybe this is the root problem?
Comment 4 Stepan Zebra 2013-09-25 13:01:20 UTC
(In reply to Theofanis Oikonomou from comment #3)
> 
> In the J2EEValidation file I see comment that the
> test-qa-functional-sys-prop.glassfish.home property must be set in order to
> run the tests. Have you set this property? Maybe this is the root problem?

I have this property set in ..\nbbuild\user.build.properties and I think that it's being resolved properly. My log contains:

...
build-init:
init:
test-preinit:
test-lib-init:
test-init:
IX 25, 2013 2:53:12 ODP. org.netbeans.jellytools.modules.j2ee.J2eeTestCase registerGlassFish
Testsuite: org.netbeans.test.j2ee.J2EEValidation
INFO: Registering GlassFish server at C:/AppServers/glassfish4
...

The exception seems to show up when the test-init: task starts.
Comment 5 Stepan Zebra 2013-09-26 12:19:49 UTC
I don't see the problem anymore after JDK reinstall. I'm not sure what was wrong. Unless you discovered something, you can close this issue as worksforme for now. Thanks.
Comment 6 Theofanis Oikonomou 2013-09-27 07:06:00 UTC
Did not find anything either. Closing for now. Thank you
Comment 7 Stepan Zebra 2013-10-07 13:53:23 UTC
Product Version: NetBeans IDE 7.4 (Build 201310012201)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b16

I see the problem again and now I can't get rid of it.
Test server is set in
..\nbbuild\user.build.properties
as
test-qa-functional-sys-prop.glassfish.home=C:/AppServers/glassfish4
Can you please try to reproduce the exception?

Jirko, do you have an idea what is causing the problem?
Comment 8 Marian Mirilovic 2013-10-08 15:16:07 UTC
Created attachment 140893 [details]
stacktrace

started tests
Comment 9 Jiri Skrivanek 2013-10-09 07:06:12 UTC
I don't see any exception in latest core-main (clean and build) repository. Project is opened in NetBeans 7.4.
Comment 10 Jiri Skrivanek 2013-10-16 13:38:17 UTC
It throws exception when it cannot find test/unit/src folder. For example in j2ee.kit project this folder exists but it is empty. For me it sometimes throws the exception but sometimes not. Probably something is not properly initialized. But such exception should not be thrown in any case. To reproduce:

- open j2ee.kit project
- go to Files view and remove test/unit folder
- open Functional Test Packages|org.netbeans.test.j2ee|J2EEValidation.java
- run this test (Ctrl + F6)
Comment 11 Theofanis Oikonomou 2013-10-23 12:54:28 UTC
Fixed: http://hg.netbeans.org/core-main/rev/ddf9039d42b0
Comment 12 Quality Engineering 2013-10-24 02:38:47 UTC
Integrated into 'main-silver', will be available in build *201310240001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ddf9039d42b0
User: Theofanis Oikonomou <theofanis@netbeans.org>
Log: Task #236359 - IllegalStateException at org.netbeans.modules.junit.DefaultPlugin.getTestClassPath
Comment 13 Jiri Kovalsky 2013-11-22 12:52:45 UTC
Product Version: NetBeans IDE 7.4 (Build 201310111528)
Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 1
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.0.0-12-generic running on amd64; UTF-8; cs_CZ (nb)
User directory: /home/cesilko/.netbeans/7.4
Cache directory: /home/cesilko/.cache/netbeans/7.4

Didn't see any exception when trying Jiri's scenario.