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.
Summary: | Double notification from AbstractFileObject | ||
---|---|---|---|
Product: | platform | Reporter: | David Strupl <dstrupl> |
Component: | Filesystems | Assignee: | rmatous <rmatous> |
Status: | VERIFIED WONTFIX | ||
Severity: | blocker | Keywords: | SIMPLEFIX |
Priority: | P4 | ||
Version: | 3.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 32247 | ||
Attachments: |
AFO diff
Use rather the this one for your test |
Description
David Strupl
2003-06-16 13:04:56 UTC
Fixed on branch platform_32247. Target milestone: 4.0. Radek, are you going to commit this? I even don't remember exactly how long it is sitting here but I assume you understand the code. And if the change is ok, please consider applying it. If it is nonsense please mark as wontfix. It is in the same state from 19.6.2003! Its one of less priority issues in a queue for target milestone 3.6. I naturally plan to fix it because it is relatively easy, safe and harmless. I have no NbTestSetup subclass to test it with. But refresh (String added, String removed) shouldn't fire events neither for "added" resource nor for "removed". Definitely there is wrong call of this method. Please try parent.refresh (null, this.name) instead of parent.refresh (null, oldN). If your tests are OK I'll commit it instantly because there isn't time enough. Hi, with the original code I have two tests failing junit.framework.AssertionFailedError: parent should fire fileDataCreated Fired : 2 ,but expected: 1 [org.netbeans.modules.zeroadmin.XMLBufferFileSystemTest] at junit.framework.Assert.fail(Assert.java:51) at junit.framework.Assert.assertTrue(Assert.java:38) at org.openide.filesystems.TestBaseHid.fsAssert(TestBaseHid.java:89) at org.openide.filesystems.TestBaseHid.fileEventAssert(TestBaseHid.java:117) at org.openide.filesystems.TestBaseHid.fileDataCreatedAssert(TestBaseHid.java:97) at org.openide.filesystems.FileObjectTestHid.testMove1(FileObjectTestHid.java:199) junit.framework.AssertionFailedError: parent should fire fileDeleted Fired : 2 ,but expected: 1 [org.netbeans.modules.zeroadmin.XMLBufferFileSystemTest] at junit.framework.Assert.fail(Assert.java:51) at junit.framework.Assert.assertTrue(Assert.java:38) at org.openide.filesystems.TestBaseHid.fsAssert(TestBaseHid.java:89) at org.openide.filesystems.TestBaseHid.fileEventAssert(TestBaseHid.java:117) at org.openide.filesystems.TestBaseHid.fileDeletedAssert(TestBaseHid.java:105) at org.openide.filesystems.FileObjectTestHid.testMove1_Fs(FileObjectTestHid.java:236) With your proposed change only the second one is ok. Your change leaves still one test failing for me. If I completely remove the line in question all the tests pass. But please note that I have been testing this on NB3.5 since I don't have the xtest build scripts updated for 3.6 yet. I hope that there were not some changes in AbstractFileObject that could affect this between 3.5 and 3.6. Its a pity, that you don't mention how testMove1 failed. But I assume that now fails FileObjectTestHid.testMove1.fileDataCreatedAssert instead of fileDeletedAssert. If I'm right then parent.refresh (n, this.name) should be OK. If so then please let me know and I fix it. Sorry I messed up the failures. With your change this happened: testMove1: junit.framework.AssertionFailedError: parent should fire fileDataCreated Fired : 2 ,but expected: 1 [org.netbeans.modules.zeroadmin.XMLBufferFileSystemTest] at junit.framework.Assert.fail(Assert.java:51) at junit.framework.Assert.assertTrue(Assert.java:38) at org.openide.filesystems.TestBaseHid.fsAssert(TestBaseHid.java:89) at org.openide.filesystems.TestBaseHid.fileEventAssert(TestBaseHid.java:117) at org.openide.filesystems.TestBaseHid.fileDataCreatedAssert(TestBaseHid.java:97) at org.openide.filesystems.FileObjectTestHid.testMove1(FileObjectTestHid.java:199) What do you mean that it is ok? Is this test expected to fail this way? Naturally it isn't. But if you changed parent.refresh (null, this.name) into parent.refresh (n, this.name) then the test could pass, which I think could be OK. No. After I did your change the two move tests end up with error: java.io.FileNotFoundException: testFolder0/test.txt0 at org.netbeans.modules.zeroadmin.XMLBufferFileSystem.getContentsOf(XMLBufferFileSystem.java:265) at org.netbeans.modules.zeroadmin.XMLBufferFileSystem.inputStream(XMLBufferFileSystem.java:323) at org.openide.filesystems.AbstractFileObject.getInputStream(AbstractFileObject.java:164) at org.openide.filesystems.FileObjectTestHid.readStr(FileObjectTestHid.java:1586) at org.openide.filesystems.FileObjectTestHid.testMove1_Fs(FileObjectTestHid.java:229) I don't know whether the error is due to a problem in my filesystem or in the tests or ...? Created attachment 13669 [details]
AFO diff
Created attachment 13670 [details]
Use rather the this one for your test
Its not easy for me because I have not no testSuit for FS with implemented Transfer. So, attached patch and I hope this is last iteration. If not, then I give it up (at least for today). Sorry I give it up (at least for today). I am not able to use this version in NB 3.5 where I have the tests setup. I will try to update the configs for my tests to NB 3.6. I will let you know then how does your latest patch perform. But I have to go out with little Kata now ;-) Please test the last patch. Nobody interested to test the last patch anymore. Hi, sorry about that. I have simply removed the failing tests from my test config long time ago. I had to deliver the platform with the test and did not have the time to play with the tests ;-( And currently we did not moved to trunk yet - I still work with my copy of release 3.6. After I will have to start worry about trunk it will be late for any fix again. fck it. I suggest even closing this bug - I will enter a new one if after moving to the trunk (4.0) some test will still fail for me. Sorry for bothering you with this. Best, David closed |