final FileSystemProvider fsProvider = mock( FileSystemProvider.class );
@Test
public void simpleTests() {
final FileSystem fileSystem = new SimpleUnixFileSystem( fsProvider, "/" );
assertThat( fileSystem.isOpen() ).isTrue();
assertThat( fileSystem.isReadOnly() ).isFalse();
assertThat( fileSystem.getSeparator() ).isEqualTo( System.getProperty( "file.separator" ) );
assertThat( fileSystem.provider() ).isEqualTo( fsProvider );
assertThat( fileSystem.supportedFileAttributeViews() ).isNotEmpty().hasSize( 1 ).contains( "basic" );
assertThat( fileSystem.getPath( "/path/to/file.txt" ) ).isNotNull().isEqualTo( GeneralPathImpl.create( fileSystem, "/path/to/file.txt", false ) );
assertThat( fileSystem.getPath( "/path/to/file.txt", null ) ).isNotNull().isEqualTo( GeneralPathImpl.create( fileSystem, "/path/to/file.txt", false ) );
assertThat( fileSystem.getPath( "/path", "to", "file.txt" ) ).isNotNull().isEqualTo( GeneralPathImpl.create( fileSystem, "/path/to/file.txt", false ) );
try {
fileSystem.close();
fail( "can't close this fileSystem" );
} catch ( UnsupportedOperationException ex ) {
}
assertThat( fileSystem.getFileStores() ).isNotNull().hasSize( 1 );
assertThat( fileSystem.getFileStores().iterator().next().name() ).isEqualTo( "/" );
assertThat( fileSystem.getRootDirectories() ).isNotNull().hasSize( 1 );
assertThat( fileSystem.getRootDirectories().iterator().next().toString() ).isEqualTo( "/" );
assertThat( fileSystem.getRootDirectories().iterator().next().isAbsolute() ).isTrue();
}