return this;
}
+ public ProjectDefinition resetSourceDirs() {
+ properties.remove(SOURCE_DIRS_PROPERTY);
+ return this;
+ }
+
public ProjectDefinition setSourceDir(File path) {
setSourceDir(path.getAbsolutePath());
return this;
return this;
}
+ public ProjectDefinition resetTestDirs() {
+ properties.remove(TEST_DIRS_PROPERTY);
+ return this;
+ }
+
/**
* Adding source files is possible only if no source directories have been set.
assertThat(child.getParent(), is(root));
}
+ @Test
+ public void shouldResetSourceDirs() {
+ ProjectDefinition root = new ProjectDefinition(new File("."), new File("."), new Properties());
+ root.addSourceDirs("src", "src2/main");
+ assertThat(root.getSourceDirs().size(), is(2));
+
+ root.resetSourceDirs();
+ assertThat(root.getSourceDirs().size(), is(0));
+ }
+
+ @Test
+ public void shouldResetTestDirs() {
+ ProjectDefinition root = new ProjectDefinition(new File("."), new File("."), new Properties());
+ root.addTestDirs("src", "src2/test");
+ assertThat(root.getTestDirs().size(), is(2));
+
+ root.resetTestDirs();
+ assertThat(root.getTestDirs().size(), is(0));
+ }
+
private static void assertFiles(List<String> paths, String... values) {
assertThat(paths.size(), is(values.length));
for (int i = 0; i < values.length; i++) {