[
https://issues.apache.org/jira/browse/VFS-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary Gregory resolved VFS-489.
------------------------------
Resolution: Fixed
Fix Version/s: 2.1
Reproduced In: 2.0, Nightly Builds
Thank you Bernd!
{noformat}
commit -m "[VFS-489][tests] ProviderWriteTests#testListener does not fail
cleanly. Thanks to Bernd Eckenfels."
C:/vcs/svn/apache/commons/trunks-proper/vfs/src/changes/changes.xml
C:/vcs/svn/apache/commons/trunks-proper/vfs/core/src/test/java/org/apache/commons/vfs2/test/ProviderWriteTests.java
Sending
C:/vcs/svn/apache/commons/trunks-proper/vfs/core/src/test/java/org/apache/commons/vfs2/test/ProviderWriteTests.java
Sending
C:/vcs/svn/apache/commons/trunks-proper/vfs/src/changes/changes.xml
Transmitting file data ...
Committed revision 1513473.
{noformat}
> [tests] ProviderWriteTests#testListener does not fail cleanly
> -------------------------------------------------------------
>
> Key: VFS-489
> URL: https://issues.apache.org/jira/browse/VFS-489
> Project: Commons VFS
> Issue Type: Bug
> Affects Versions: 2.0
> Reporter: Bernd Eckenfels
> Priority: Minor
> Fix For: 2.1
>
>
> When running ProviderTests against my new implementation the #testListener()
> test failed (expected). However the exception cause the listener to not be
> unregistered, which in turn leads to a (random) next test failing with
> unexpected events. A try/finally solves the problem.
> public void testListener() throws Exception
> {
> final FileObject baseFile = createScratchFolder();
> FileObject child = baseFile.resolveFile("newfile.txt");
> assertTrue(!child.exists());
> FileSystem fs = baseFile.getFileSystem();
> TestListener listener = new TestListener(child);
> fs.addListener(child, listener);
> + try
> + {
> // Create as a folder
> ...
> + } finally {
> fs.removeListener(child, listener);
> + }
> }
> The problem happens for me in 2.0, but trunk seems to have the same problem:
> http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/test/ProviderWriteTests.java?revision=1437556&view=markup
> (Line 629)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira