@@ -0,0 +1,2589 @@
+/*%0D%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0D%0A * contributor license agreements.  See the NOTICE file distributed with%0D%0A * this work for additional information regarding copyright ownership.%0D%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0D%0A * (the %22License%22); you may not use this file except in compliance with%0D%0A * the License.  You may obtain a copy of the License at%0D%0A *%0D%0A *      http://www.apache.org/licenses/LICENSE-2.0%0D%0A *%0D%0A * Unless required by applicable law or agreed to in writing, software%0D%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0D%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0D%0A * See the License for the specific language governing permissions and%0D%0A * limitations under the License.%0D%0A */%0D%0A%0D%0Apackage org.apache.commons.vfs2.provider.zip.test;%0D%0A%0D%0Aimport java.io.File;%0D%0Aimport java.io.IOException;%0D%0A%0D%0Aimport org.apache.commons.AbstractVfsTestCase;%0D%0Aimport org.apache.commons.io.FileUtils;%0D%0Aimport org.apache.commons.vfs2.FileObject;%0D%0Aimport org.apache.commons.vfs2.FileSystemManager;%0D%0Aimport org.apache.commons.vfs2.VFS;%0D%0Aimport org.junit.Assert;%0D%0Aimport org.junit.Ignore;%0D%0Aimport org.junit.Test;%0D%0A%0D%0A/**%0D%0A * Tests https://issues.apache.org/jira/browse/VFS-291%0D%0A */%0D%0Apublic class FileLockTestCase %7B%0D%0A%0D%0A    /**%0D%0A     * This test checks whether we can modify an underlying zip file after we have performed IO operations on files%0D%0A     * within it, but although we no longer have any FileObjects explicitely open.%0D%0A     * %0D%0A     * @throws IOException%0D%0A     */%0D%0A    @Test%0D%0A    @Ignore%0D%0A    public void testResourcesReleasedByZipFileProvider() throws Exception %7B%0D%0A        FileSystemManager manager = VFS.getManager();%0D%0A        //%0D%0A        // We copy the normal test zip to a second, nominally temporary, file so that we can try to delete it with%0D%0A        // impunity. Since the test fails, the file will be left behind, so it should probably be created in a temporary%0D%0A        // directory somewhere.%0D%0A        //%0D%0A        final File zipFile = new File(%22src/test/resources/test-data/test.zip%22);%0D%0A        final File newZipFile = new File(AbstractVfsTestCase.getTestDirectory(), %22test2.zip%22);%0D%0A        FileUtils.copyFile(zipFile, newZipFile);%0D%0A%0D%0A        final String uri = %22zip:file:%22 + newZipFile.getAbsolutePath() + %22!/read-tests/file1.txt%22;%0D%0A        try (final FileObject fileOne = manager.resolveFile(uri)) %7B%0D%0A            fileOne.getContent().getInputStream().close();%0D%0A        %7D%0D%0A%0D%0A        Assert.assertTrue(%22Could not delete file%22, newZipFile.delete());%0D%0A    %7D%0D%0A%7D%0D%0A

Add failing test for Tests https://issues.apache.org/jira/browse/VFS-291 with @Ignore.