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 65057 - Lookups of NB classes return empty while running junit tests
Summary: Lookups of NB classes return empty while running junit tests
Status: CLOSED WONTFIX
Alias: None
Product: apisupport
Classification: Unclassified
Component: Harness (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-24 01:57 UTC by Ayub Khan
Modified: 2006-02-14 17:57 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ayub Khan 2005-09-24 01:57:50 UTC
I have isntalled from NB QBuild site, build 20050823 of NB4.2. I have created a
new NB module using the wizard, and was able to specify NB specific modules as
the dependent modules. Everything seems to work, I can install and run my module.

I have created a junit testcase that tests what my main code in my module. But
when I try to run this testcase, I see that the lookups (of certain NB classes)
return empty. My main code which works otherwise using these lookups, fail when
the lookups return enpty.

Is there something I have to do additionally on the build.xml file. So far I
haven't touched the generated build artifact files.
Comment 1 Milan Kubec 2005-09-26 10:25:19 UTC
Probably apisupport config issue. Reassigning. If you think it's junit problem,
please clarify and reassign back.
Comment 2 pzajac 2005-09-26 14:54:09 UTC
For unittest run is not preconfigured Lookup. You must create our own lookup
with registered services. And specify the classnameof lookup in
"org.openide.util.Lookup" property. 

If you want to run your test in IDE where is alredy configure Lookup, use
xtest.netbeans.org harness. 
 
Comment 3 Jesse Glick 2005-09-27 20:55:05 UTC
Specifically, if you do not explicitly set your own lookup (system property
"org.openide.util.Lookup"), the default that you will get should examine just
META-INF/services/* of JARs (or folders) on your unit test's classpath. You can
use test.unit.run.cp.extra to append to this classpath as needed (see
harness/README).
Comment 4 Tomas Danek 2005-12-12 13:43:39 UTC
v/c
Comment 5 Tomas Danek 2005-12-12 13:43:58 UTC
v/c