{
List<WatchEvent<?>> events = ws.poll().pollEvents();
assertEquals( 3, events.size() ); //adds files
final VersionAttributeView v = ioService.getFileAttributeView( f1, VersionAttributeView.class );
assertNotNull( v );
assertEquals( 2, v.readAttributes().history().records().size() );
final VersionAttributeView v2 = ioService.getFileAttributeView( f2, VersionAttributeView.class );
assertNotNull( v2 );
assertEquals( 2, v2.readAttributes().history().records().size() );
final VersionAttributeView v3 = ioService.getFileAttributeView( f3, VersionAttributeView.class );
assertNotNull( v3 );
assertEquals( 1, v3.readAttributes().history().records().size() );
}
ioService.startBatch( new FileSystem[]{ f1.getFileSystem() } );
ioService.write( f1, "f1-u1!" );
assertNull( ws.poll() );
ioService.write( f2, "f2-u2!" );
assertNull( ws.poll() );
ioService.write( f3, "f3-u2!" );
assertNull( ws.poll() );
ioService.endBatch();
{
List<WatchEvent<?>> events = ws.poll().pollEvents();
assertEquals( 2, events.size() ); //adds files
final VersionAttributeView v = ioService.getFileAttributeView( f1, VersionAttributeView.class );
assertNotNull( v );
assertEquals( 2, v.readAttributes().history().records().size() );
final VersionAttributeView v2 = ioService.getFileAttributeView( f2, VersionAttributeView.class );
assertNotNull( v2 );
assertEquals( 3, v2.readAttributes().history().records().size() );
final VersionAttributeView v3 = ioService.getFileAttributeView( f3, VersionAttributeView.class );
assertNotNull( v3 );
assertEquals( 2, v3.readAttributes().history().records().size() );
}
}