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.
java.lang.NullPointerException: Passed null to FileOwnerQuery.getOwner(FileObject) at org.netbeans.api.project.FileOwnerQuery.getOwner(FileOwnerQuery.java:97) at org.netbeans.modules.websvc.core.client.wizard.WebServiceClientCreatorTest.testJ2SEonJdk6(WebServiceClientCreatorTest.java:86) After this patch: diff --git a/websvc.core/test/unit/src/org/netbeans/modules/websvc/core/client/wizard/WebServiceClientCreatorTest.java b/websvc.core/test/unit/src/org/netbeans/modules/websvc/core/client/wizard/WebServiceClientCreatorTest.java --- a/websvc.core/test/unit/src/org/netbeans/modules/websvc/core/client/wizard/WebServiceClientCreatorTest.java +++ b/websvc.core/test/unit/src/org/netbeans/modules/websvc/core/client/wizard/WebServiceClientCreatorTest.java @@ -81,7 +81,7 @@ public void testJ2SEonJdk6() throws Exception { System.setProperty("websvc.core.test.repo.root", this.getWorkDirPath()); MockServices.setServices(RepositoryImpl.class); - File projectRoot = new File(getDataDir(), "projects/j2se_16"); + File projectRoot = new File(getDataDir(), "projects/J2SE_16"); FileObject projectDir = FileUtil.toFileObject(FileUtil.normalizeFile(projectRoot)); Project p = FileOwnerQuery.getOwner(projectDir); assert p != null : "null Project"; diff --git a/websvc.core/test/unit/src/org/netbeans/modules/websvc/core/testutils/RepositoryImpl.java b/websvc.core/test/unit/src/org/netbeans/modules/websvc/core/testutils/RepositoryImpl.java --- a/websvc.core/test/unit/src/org/netbeans/modules/websvc/core/testutils/RepositoryImpl.java +++ b/websvc.core/test/unit/src/org/netbeans/modules/websvc/core/testutils/RepositoryImpl.java @@ -91,7 +91,7 @@ private static void addLayer(List<FileSystem> layers, String layerRes) throws SAXException { URL layerFile = RepositoryImpl.class.getClassLoader().getResource(layerRes); - assert layerFile != null; + assert layerFile != null : layerRes; layers.add(new XMLFileSystem(layerFile)); } it still fails: java.lang.AssertionError: org/netbeans/modules/java/j2seproject/ui/resources/layer.xml at org.netbeans.modules.websvc.core.testutils.RepositoryImpl.addLayer(RepositoryImpl.java:94) at org.netbeans.modules.websvc.core.testutils.RepositoryImpl.mksystem(RepositoryImpl.java:82) at org.netbeans.modules.websvc.core.testutils.RepositoryImpl.<init>(RepositoryImpl.java:66) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.openide.util.lookup.implspi.SharedClassObjectBridge.newInstance(SharedClassObjectBridge.java:64) at org.openide.util.lookup.MetaInfServicesLookup$P.getInstance(MetaInfServicesLookup.java:488) at org.openide.util.lookup.AbstractLookup.lookup(AbstractLookup.java:414) at org.openide.util.lookup.ProxyLookup.lookup(ProxyLookup.java:214) at org.openide.filesystems.Repository.initialize(Repository.java:117) at org.openide.filesystems.Repository.getDefault(Repository.java:291) at org.openide.filesystems.FileUtil.getConfigFile(FileUtil.java:2224) at org.openide.filesystems.FileUtil.getConfigRoot(FileUtil.java:2254) at org.netbeans.core.startup.preferences.PropertiesStorage.<clinit>(PropertiesStorage.java:78) at org.netbeans.core.startup.preferences.NbPreferences$UserPreferences.getFileStorage(NbPreferences.java:305) at org.netbeans.core.startup.preferences.NbPreferences.<init>(NbPreferences.java:106) at org.netbeans.core.startup.preferences.NbPreferences.<init>(NbPreferences.java:61) at org.netbeans.core.startup.preferences.NbPreferences$UserPreferences.<init>(NbPreferences.java:290) at org.netbeans.core.startup.preferences.NbPreferences.userRootImpl(NbPreferences.java:90) at org.netbeans.core.startup.preferences.PreferencesProviderImpl.preferencesRoot(PreferencesProviderImpl.java:74) at org.netbeans.core.startup.preferences.PreferencesProviderImpl.preferencesForModule(PreferencesProviderImpl.java:70) at org.openide.util.NbPreferences.forModule(NbPreferences.java:76) at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProjectXml(AntBasedProjectFactorySingleton.java:374) at org.netbeans.modules.project.ant.AntBasedProjectFactorySingleton.loadProject(AntBasedProjectFactorySingleton.java:245) at org.netbeans.api.project.ProjectManager.createProject(ProjectManager.java:365) at org.netbeans.api.project.ProjectManager.access$300(ProjectManager.java:85) at org.netbeans.api.project.ProjectManager$2.run(ProjectManager.java:286) at org.netbeans.api.project.ProjectManager$2.run(ProjectManager.java:233) at org.openide.util.Mutex.readAccess(Mutex.java:330) at org.netbeans.api.project.ProjectManager.findProject(ProjectManager.java:233) at org.netbeans.modules.projectapi.SimpleFileOwnerQueryImplementation.getOwner(SimpleFileOwnerQueryImplementation.java:131) at org.netbeans.api.project.FileOwnerQuery.getOwner(FileOwnerQuery.java:104) at org.netbeans.modules.websvc.core.client.wizard.WebServiceClientCreatorTest.testJ2SEonJdk6(WebServiceClientCreatorTest.java:86) Is there no Hudson builder running these unit tests?
Denis, let me know when tests are passing and I will add them to javaee job on bertram2.
(In reply to comment #0) > > Is there no Hudson builder running these unit tests? I don't think this test was in the validation procedure. This test do nothing. It's fake. So it should not be included into the javaee job. As I understand for now it is not included in the job. So I set this bug as fixed.
> This test do nothing. It's fake. So why do we have such a test at all? If it does not do anything, it should be deleted. When you run 'ant test' on any module, it should pass. If in the future there are some real tests in this module, then it needs to pass, and should be run regularly on the javaee job.
(In reply to comment #3) > > This test do nothing. It's fake. > > So why do we have such a test at all? If it does not do anything, it should be > deleted. When you run 'ant test' on any module, it should pass. If in the > future there are some real tests in this module, then it needs to pass, and > should be run regularly on the javaee job. I can't answer to this question. It's not mine. The author is Lukas Jungmann. I believe there are a lot of such tests in different areas. There is no working tests in websvc.core at all. I can delete tests from websvc.core.
web-main#ad5861dbdb0a test is deleted
That was the only test in the module. I would recommend deleting the rest of the test subdir (incl. the data area, and the RepositoryImpl.java mock) and removing <test-dependencies> from project.xml.