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 74095 - Allow plugin to be used in unit tests
Summary: Allow plugin to be used in unit tests
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Nitya Doraisamy
URL: http://j2ee.netbeans.org/source/brows...
Keywords: T9Y
Depends on:
Blocks:
 
Reported: 2006-03-28 14:41 UTC by Lukas Jungmann
Modified: 2006-06-13 23:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
promised exception (4.12 KB, text/plain)
2006-03-28 14:44 UTC, Lukas Jungmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2006-03-28 14:41:10 UTC
Currently there's no simple way how to pretend that there's installed
appserver in the "IDE" in unit tests.

   Only solution I've found so far is to provide faken AS installation with
dummy implementation of DeploymentFactory in class named
"com.sun.enterprise.deployapi.SunDeploymentFactory" which provides some dummy
implementation of DeploymentManager interface and these faken classes has to be
stored in <someLocation>/lib/appserv-rt.jar. Than you can use <someLocation> as
your AS installation root - server will be correctly registered in the IDE and
you can "use" it in unit tests.

   The reason for this hack is that there's NPE being thrown - attached - from
my investigation it comes from
AppserverBridge.getDisconnectedDeploymentManager() - and the server not become
"registered" due to this issue.

   I'm filling this as P2 because of big impact on testability of j2ee specific
features in the IDE (a lot of them requires appserver to be registered). Not
sure about bug-enhancement, but I think that thrown NPE is a bug.

   I was also asked to move method String registerSunAppServer(NbTestCase test)
 - see URL - to some better place so it can easily reused from other tests
insted of copy&pasting it (it should be improved and placed into NbJunit module)
- other thing why fixing this is important
Comment 1 Lukas Jungmann 2006-03-28 14:44:27 UTC
Created attachment 29450 [details]
promised exception
Comment 2 Lukas Jungmann 2006-03-28 14:48:42 UTC
btw: steps to reproduce

-checkout sources of j2ee/clientproject or j2ee/earproject
-remove appserv-rt.jar from ${project.home}/test/unit/data/SunAppServer.zip
-run unit test for {AppClient|Ear}ProjectGenerator
Comment 3 _ ludo 2006-03-28 20:52:35 UTC
I do not see an AppserverBridge.getDisconnectedDeploymentManager() API.

Also where is AppClientProjectGeneratorTest in cvs?

So I am a bit confused of what we are trying to do there.
Comment 4 _ ludo 2006-03-29 04:43:59 UTC
fixed.
Open new issues as needed by unit tests.
Comment 5 Lukas Jungmann 2006-06-13 23:30:53 UTC
v.