final File[] roots = new File[]{ new File( "c:\\" ), new File( "a:\\" ) };
@Test
public void simpleTests() {
final FileSystem fileSystem = new SimpleWindowsFileSystem( roots, fsProvider, "c:\\" );
assertThat( fileSystem.isOpen() ).isTrue();
assertThat( fileSystem.isReadOnly() ).isFalse();
assertThat( fileSystem.getSeparator() ).isEqualTo( "\\" );
assertThat( fileSystem.provider() ).isEqualTo( fsProvider );
assertThat( fileSystem.supportedFileAttributeViews() ).isNotEmpty().hasSize( 1 ).contains( "basic" );
assertThat( fileSystem.getPath( "c:\\path\\to\\file.txt" ) ).isNotNull().isEqualTo( GeneralPathImpl.create( fileSystem, "c:\\path\\to\\file.txt", false ) );
assertThat( fileSystem.getPath( "c:\\path\\to\\file.txt", null ) ).isNotNull().isEqualTo( GeneralPathImpl.create( fileSystem, "c:\\path\\to\\file.txt", false ) );
assertThat( fileSystem.getPath( "c:\\path", "to", "file.txt" ) ).isNotNull().isEqualTo( GeneralPathImpl.create( fileSystem, "c:\\path\\to\\file.txt", false ) );
try {
fileSystem.close();
fail( "can't close this fileSystem" );
} catch ( UnsupportedOperationException ex ) {
}
assertThat( fileSystem.getFileStores() ).isNotNull().hasSize( 2 );
assertThat( fileSystem.getFileStores().iterator().next().name() ).isEqualTo( "c:\\" );
assertThat( fileSystem.getRootDirectories() ).isNotNull().hasSize( 2 );
assertThat( fileSystem.getRootDirectories().iterator().next().toString() ).isEqualTo( "c:\\" );
assertThat( fileSystem.getRootDirectories().iterator().next().isAbsolute() ).isTrue();
}