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 194418
Collapse All | Expand All

(-)a/openide.filesystems/test/unit/src/org/openide/filesystems/FileObjectTestHid.java (+33 lines)
Lines 713-718 Link Here
713
        fsAssert("findResource problem", result != null);
713
        fsAssert("findResource problem", result != null);
714
        fsAssert("findResource problem",fo1.equals(result));
714
        fsAssert("findResource problem",fo1.equals(result));
715
    }
715
    }
716
717
    public void  testGetPathWithDots() {
718
        checkSetUp();
719
        FileObject fold1 = getTestFolder1(root);
720
        FileObject fold2 = getTestFolder1(fold1);
721
        
722
        assertEquals("Is parent", fold1, fold2.getParent());
723
        assertEquals("No .. can be used", null, fold2.getFileObject(".."));
724
    }
716
    
725
    
717
    public void  testGetPath2() {
726
    public void  testGetPath2() {
718
        checkSetUp();
727
        checkSetUp();
Lines 776-781 Link Here
776
        fsAssert("findResource problem",fo1.equals(result));
785
        fsAssert("findResource problem",fo1.equals(result));
777
    }
786
    }
778
787
788
    public void testGetPathNoParent() throws  IOException{
789
        checkSetUp();
790
        FileObject fold1 = getTestFolder1(root);
791
        FileObject fold2 = getTestFolder1(fold1);
792
793
        FileObject fo1 = null;
794
        FileObject fo2 = null;
795
        try {
796
            fo1 = FileUtil.createData(fold2, "a/b/c.java");        
797
            fo2 = FileUtil.createData(fold2, "a/x/y.java");        
798
        } catch (IOException iex) {
799
            fsAssert("There is not possible to create folder a.b.c",
800
            fs.isReadOnly() || fold2.isReadOnly());
801
            return;
802
        }
803
        
804
        FileObject r1 = fo1.getParent().getParent().getFileObject("x/y.java");
805
        FileObject r2 = fo1.getParent().getFileObject("../x/y.java");
806
        FileObject r3 = fo1.getFileObject("../../x/y.java");
807
        assertEquals("y.java found without ..", fo2, r1);
808
        assertNull("y.java not found with ..", r2);
809
        assertNull("y.java not found with ../..", r3);
810
    }
811
779
    public void  testGetPath5() throws  IOException{
812
    public void  testGetPath5() throws  IOException{
780
        checkSetUp();
813
        checkSetUp();
781
        FileObject fold1 = getTestFolder1(root);
814
        FileObject fold1 = getTestFolder1(root);

Return to bug 194418