This commit is contained in:
Phillip Webb
2014-06-23 19:41:22 -07:00
parent ed3df32cdd
commit c713c8091d
5 changed files with 76 additions and 79 deletions

View File

@@ -27,7 +27,7 @@ import org.springframework.util.FileSystemUtils;
/**
* Tests for using the Gradle plugin's support for flat directory repos
*
*
* @author Dave Syer
*/
public class FlatdirTests {
@@ -36,26 +36,26 @@ public class FlatdirTests {
private File libs = new File("target/flatdir/lib");
private static final String BOOT_VERSION = ManagedDependencies.get().find(
"spring-boot").getVersion();
private static final String BOOT_VERSION = ManagedDependencies.get()
.find("spring-boot").getVersion();
@Before
public void init() {
if (libs.exists()) {
FileSystemUtils.deleteRecursively(libs);
if (this.libs.exists()) {
FileSystemUtils.deleteRecursively(this.libs);
}
}
@Test
public void flatdir() throws Exception {
project = new ProjectCreator().createProject("flatdir");
if (!libs.exists()) {
libs.mkdirs();
this.project = new ProjectCreator().createProject("flatdir");
if (!this.libs.exists()) {
this.libs.mkdirs();
}
FileCopyUtils.copy(new File("src/test/resources/foo.jar"),
new File(libs, "foo-1.0.0.jar"));
project.newBuild().forTasks("build").withArguments(
"-PbootVersion=" + BOOT_VERSION, "--stacktrace").run();
FileCopyUtils.copy(new File("src/test/resources/foo.jar"), new File(this.libs,
"foo-1.0.0.jar"));
this.project.newBuild().forTasks("build")
.withArguments("-PbootVersion=" + BOOT_VERSION, "--stacktrace").run();
}
}