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.
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
Created attachment 29450 [details] promised exception
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
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.
fixed. Open new issues as needed by unit tests.
v.