SLIDER-334 removed java.nio.file code from some tests for JDK 6 compatability
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/32f1b6b8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/32f1b6b8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/32f1b6b8 Branch: refs/heads/feature/SLIDER-149_Support_a_YARN_service_registry Commit: 32f1b6b84ec227d85dc979fdc20161a93c4703e9 Parents: bc9766b Author: Jon Maron <jma...@hortonworks.com> Authored: Mon Aug 25 15:41:25 2014 -0400 Committer: Jon Maron <jma...@hortonworks.com> Committed: Mon Aug 25 15:41:25 2014 -0400 ---------------------------------------------------------------------- .../apache/slider/test/SliderTestBase.groovy | 2 +- .../web/rest/agent/TestAMAgentWebServices.java | 48 ++++++++++---------- 2 files changed, 26 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/32f1b6b8/slider-core/src/test/groovy/org/apache/slider/test/SliderTestBase.groovy ---------------------------------------------------------------------- diff --git a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestBase.groovy b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestBase.groovy index 28b484f..afb07d8 100644 --- a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestBase.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestBase.groovy @@ -27,7 +27,7 @@ import org.junit.BeforeClass import org.junit.Rule import org.junit.rules.TestName -import java.nio.file.Files +//import java.nio.file.Files /** * Base class for unit tests as well as ones starting mini clusters http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/32f1b6b8/slider-core/src/test/java/org/apache/slider/server/appmaster/web/rest/agent/TestAMAgentWebServices.java ---------------------------------------------------------------------- diff --git a/slider-core/src/test/java/org/apache/slider/server/appmaster/web/rest/agent/TestAMAgentWebServices.java b/slider-core/src/test/java/org/apache/slider/server/appmaster/web/rest/agent/TestAMAgentWebServices.java index 827b47a..c825fb8 100644 --- a/slider-core/src/test/java/org/apache/slider/server/appmaster/web/rest/agent/TestAMAgentWebServices.java +++ b/slider-core/src/test/java/org/apache/slider/server/appmaster/web/rest/agent/TestAMAgentWebServices.java @@ -25,6 +25,7 @@ import com.sun.jersey.api.client.config.ClientConfig; import com.sun.jersey.api.client.config.DefaultClientConfig; import com.sun.jersey.api.json.JSONConfiguration; import junit.framework.Assert; +import org.apache.commons.io.FileUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.io.IOUtils; @@ -55,12 +56,12 @@ import javax.ws.rs.core.MediaType; import java.io.File; import java.io.IOException; import java.net.URI; -import java.nio.file.FileVisitResult; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; +//import java.nio.file.FileVisitResult; +//import java.nio.file.Files; +//import java.nio.file.Path; +//import java.nio.file.Paths; +//import java.nio.file.SimpleFileVisitor; +//import java.nio.file.attribute.BasicFileAttributes; import static org.junit.Assert.assertEquals; @@ -219,22 +220,23 @@ public class TestAMAgentWebServices { @AfterClass public static void tearDownClass() throws Exception{ - Path directory = Paths.get(SecurityUtils.getSecurityDir()); - Files.walkFileTree(directory, new SimpleFileVisitor<Path>() { - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) - throws IOException { - Files.delete(file); - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, IOException exc) - throws IOException { - Files.delete(dir); - return FileVisitResult.CONTINUE; - } - - }); + FileUtils.deleteDirectory(new File(SecurityUtils.getSecurityDir())); +// Path directory = Paths.get(SecurityUtils.getSecurityDir()); +// Files.walkFileTree(directory, new SimpleFileVisitor<Path>() { +// @Override +// public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) +// throws IOException { +// Files.delete(file); +// return FileVisitResult.CONTINUE; +// } +// +// @Override +// public FileVisitResult postVisitDirectory(Path dir, IOException exc) +// throws IOException { +// Files.delete(dir); +// return FileVisitResult.CONTINUE; +// } +// +// }); } }