.withNoArguments()
.will(returnValue(noChildren));
folderContentHandlerMock.expects(once())
.method("setCurrentChildren")
.with(same(noChildren));
FolderContentPoller fileMonitor = new FolderContentPoller((FolderContentHandler) folderContentHandlerMock.proxy());
fileMonitor.start();
synchronized(fileMonitor) {
fileMonitor.wait(200);
}
rootFolderMock.expects(once())
.method("close")
.withNoArguments();
rootFolderMock.expects(once())
.method("getChildren")
.withNoArguments()
.will(returnValue(newChildren));
folderContentHandlerMock.expects(once())
.method("setCurrentChildren")
.with(same(newChildren));
synchronized(fileMonitor) {
fileMonitor.notify();
fileMonitor.wait(200);
}
fileMonitor.stop();
}