Package org.uberfire.java.nio.fs.file

Examples of org.uberfire.java.nio.fs.file.SimpleWindowsFileStore


    final Path               nonNullPath = GeneralPathImpl.create( fileSystem, "c:\\something", false );

    @Test
    public void simpleTests() {
        final Path path = GeneralPathImpl.create( fileSystem, "something", false );
        final FileStore fileStore = new SimpleWindowsFileStore( roots, path );

        assertThat( fileStore.name() ).isNotNull().isEqualTo( "c:\\" );
        assertThat( fileStore.type() ).isNull();
        assertThat( fileStore.isReadOnly() ).isFalse();
        assertThat( fileStore.getTotalSpace() ).isEqualTo( 0L );
        assertThat( fileStore.getUsableSpace() ).isEqualTo( 0L );

        assertThat( fileStore.supportsFileAttributeView( BasicFileAttributeView.class ) ).isTrue();
        assertThat( fileStore.supportsFileAttributeView( MyFileAttributeView.class ) ).isFalse();
        assertThat( fileStore.supportsFileAttributeView( MyAlsoInvalidFileAttributeView.class ) ).isFalse();
        assertThat( fileStore.supportsFileAttributeView( "basic" ) ).isTrue();
        assertThat( fileStore.supportsFileAttributeView( "any" ) ).isFalse();
        assertThat( fileStore.supportsFileAttributeView( BasicFileAttributeView.class.getName() ) ).isFalse();
        assertThat( fileStore.supportsFileAttributeView( MyAlsoInvalidFileAttributeView.class.getName() ) ).isFalse();
        assertThat( fileStore.getFileStoreAttributeView( FileStoreAttributeView.class ) ).isNull();

        assertThat( fileStore.getAttribute( "name" ) ).isNotNull().isEqualTo( fileStore.name() );
        assertThat( fileStore.getAttribute( "totalSpace" ) ).isNotNull().isEqualTo( fileStore.getTotalSpace() );
        assertThat( fileStore.getAttribute( "usableSpace" ) ).isNotNull().isEqualTo( fileStore.getUsableSpace() );
        assertThat( fileStore.getAttribute( "readOnly" ) ).isNotNull().isEqualTo( fileStore.isReadOnly() );
    }
View Full Code Here


        assertThat( fileStore.getAttribute( "readOnly" ) ).isNotNull().isEqualTo( fileStore.isReadOnly() );
    }

    @Test(expected = IllegalArgumentException.class)
    public void contructorWithNullRootsAndPath() {
        new SimpleWindowsFileStore( (File[]) null, (Path) null );
    }
View Full Code Here

        new SimpleWindowsFileStore( (File[]) null, (Path) null );
    }

    @Test(expected = IllegalStateException.class)
    public void contructorWithEmptyRoots() {
        new SimpleWindowsFileStore( new File[]{ }, null );
    }
View Full Code Here

        new SimpleWindowsFileStore( new File[]{ }, null );
    }

    @Test(expected = UnsupportedOperationException.class)
    public void getUnallocatedSpaceUnsupportedOp() {
        new SimpleWindowsFileStore( roots, nonNullPath ).getUnallocatedSpace();
    }
View Full Code Here

        new SimpleWindowsFileStore( roots, nonNullPath ).getUnallocatedSpace();
    }

    @Test(expected = UnsupportedOperationException.class)
    public void getAttributeUnsupportedOp() {
        new SimpleWindowsFileStore( roots, nonNullPath ).getAttribute( "someValueHere" );
    }
View Full Code Here

        new SimpleWindowsFileStore( roots, nonNullPath ).getAttribute( "someValueHere" );
    }

    @Test(expected = IllegalArgumentException.class)
    public void supportsFileAttributeViewNull1() {
        new SimpleWindowsFileStore( roots, nonNullPath ).supportsFileAttributeView( (Class<? extends FileAttributeView>) null );
    }
View Full Code Here

        new SimpleWindowsFileStore( roots, nonNullPath ).supportsFileAttributeView( (Class<? extends FileAttributeView>) null );
    }

    @Test(expected = IllegalArgumentException.class)
    public void supportsFileAttributeViewNull2() {
        new SimpleWindowsFileStore( roots, nonNullPath ).supportsFileAttributeView( (String) null );
    }
View Full Code Here

        new SimpleWindowsFileStore( roots, nonNullPath ).supportsFileAttributeView( (String) null );
    }

    @Test(expected = IllegalArgumentException.class)
    public void supportsFileAttributeViewEmpty() {
        new SimpleWindowsFileStore( roots, nonNullPath ).supportsFileAttributeView( "" );
    }
View Full Code Here

        new SimpleWindowsFileStore( roots, nonNullPath ).supportsFileAttributeView( "" );
    }

    @Test(expected = IllegalArgumentException.class)
    public void getFileStoreAttributeViewNull() {
        new SimpleWindowsFileStore( roots, nonNullPath ).getFileStoreAttributeView( null );
    }
View Full Code Here

        new SimpleWindowsFileStore( roots, nonNullPath ).getFileStoreAttributeView( null );
    }

    @Test(expected = IllegalArgumentException.class)
    public void getAttributeNull() {
        new SimpleWindowsFileStore( roots, nonNullPath ).getAttribute( null );
    }
View Full Code Here

TOP

Related Classes of org.uberfire.java.nio.fs.file.SimpleWindowsFileStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.