* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
public class DirectoryMonitorTest extends TestCase {
private static final String REGEX = "^.*\\.txt$";
public class DirectoryMonitorTest extends TestCase {
private static final String REGEX = "^.*\\.txt$";
public void testEmptyDir() {
// Nothing is expected to be called.
for (int i = 0; i < 10; i++) {
public void testEmptyDir() {
// Nothing is expected to be called.
for (int i = 0; i < 10; i++) {
}
public void testFileDeleted() {
_data.createFile(FILE1, "hello");
_monitor.poll();
}
public void testFileDeleted() {
_data.createFile(FILE1, "hello");
_monitor.poll();
public void testExceptionsWIllLeadToRepeatedNotifications() {
_monitor.poll();
_data.createFile(FILE1, "hello");
public void testExceptionsWIllLeadToRepeatedNotifications() {
_monitor.poll();
_data.createFile(FILE1, "hello");
- _listener.fileCreated(_data.getFile(FILE1));
- EasyMock.expectLastCall().andThrow(new RuntimeException());
- EasyMock.replay(_listener);
+ stubVoid(_listener).toThrow(new RuntimeException()).on().
+ fileCreated(_data.getFile(FILE1));
+