5152535455565758
public void init() { Preconditions.checkNotNull(initialFiles); Preconditions.checkState(!initialFiles.isEmpty()); for (File file : initialFiles) { queue.add(new FileTask(file, 0)); } }
3435363738394041424344
validator.setMaxDepth(5); } @Test public void whenTaskBelowMaxDepthIsValidated_thenTaskIsValid() throws Exception { final FileTask task = new FileTask(new File(""), 3); boolean isValid = validator.validate(task); Assert.assertTrue(isValid); }
4344454647484950515253
Assert.assertTrue(isValid); } @Test public void whenTaskEqualToMaxDepthIsValidated_thenTaskIsValid() throws Exception { final FileTask task = new FileTask(new File(""), 5); boolean isValid = validator.validate(task); Assert.assertTrue(isValid); }
5253545556575859606162
Assert.assertTrue(isValid); } @Test public void whenTaskOverMaxDepthIsValidated_thenTaskIsNotValid() throws Exception { final FileTask task = new FileTask(new File(""), 7); boolean isValid = validator.validate(task); Assert.assertFalse(isValid); }