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.

View | Details | Raw Unified | Return to bug 223167
Collapse All | Expand All

(-)masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/FileObjTest.java (+16 lines)
Lines 46-51 Link Here
46
import java.io.File;
46
import java.io.File;
47
import java.io.IOException;
47
import java.io.IOException;
48
import java.io.OutputStream;
48
import java.io.OutputStream;
49
import java.util.Arrays;
49
import java.util.logging.Handler;
50
import java.util.logging.Handler;
50
import java.util.logging.Level;
51
import java.util.logging.Level;
51
import java.util.logging.LogRecord;
52
import java.util.logging.LogRecord;
Lines 174-177 Link Here
174
            f.setWritable(true);
175
            f.setWritable(true);
175
        }
176
        }
176
    }
177
    }
178
179
    public void testFileObjectForBrokenLink () throws Exception {
180
        clearWorkDir();
181
        File original = new File(getWorkDir(), "original");
182
//        original.createNewFile();
183
        File lockFile = new File(getWorkDir(), "wlock");
184
        ProcessBuilder pb = new ProcessBuilder().directory(lockFile.getParentFile()).command(new String[] { "ln", "-s", original.getName(), lockFile.getName() });
185
        pb.start().waitFor();
186
        // file exists, or at least dir.listFiles lists the file
187
        assertTrue(Arrays.asList(lockFile.getParentFile().list()).contains(lockFile.getName()));
188
        // java.io.File.exists returns false
189
        assertFalse(lockFile.exists());
190
        // and no FileObject is reated for suh a file
191
        assertNotNull(FileUtil.toFileObject(lockFile));
192
    }
177
}
193
}

Return to bug 223167