You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ra...@apache.org on 2008/05/09 19:44:24 UTC
svn commit: r654897 - in /hadoop/core/trunk: CHANGES.txt
src/test/org/apache/hadoop/fs/TestUrlStreamHandler.java
Author: rangadi
Date: Fri May 9 10:44:23 2008
New Revision: 654897
URL: http://svn.apache.org/viewvc?rev=654897&view=rev
Log:
HADOOP-3348. TestUrlStreamHandler should set URLStreamFactory after
DataNodes are initialized. (Lohit Vijayarenu via rangadi)
Modified:
hadoop/core/trunk/CHANGES.txt
hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestUrlStreamHandler.java
Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=654897&r1=654896&r2=654897&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri May 9 10:44:23 2008
@@ -206,6 +206,9 @@
HADOOP-3309. Lower io.sort.mb and fs.inmemory.size.mb for MiniMRDFSSort
unit test so it passes on Windows. (lohit vijayarenu via cdouglas)
+ HADOOP-3348. TestUrlStreamHandler should set URLStreamFactory after
+ DataNodes are initialized. (Lohit Vijayarenu via rangadi)
+
Release 0.17.0 - Unreleased
INCOMPATIBLE CHANGES
Modified: hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestUrlStreamHandler.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestUrlStreamHandler.java?rev=654897&r1=654896&r2=654897&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestUrlStreamHandler.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/fs/TestUrlStreamHandler.java Fri May 9 10:44:23 2008
@@ -38,13 +38,6 @@
*/
public class TestUrlStreamHandler extends TestCase {
- static {
- // Setup our own factory
- FsUrlStreamHandlerFactory factory =
- new org.apache.hadoop.fs.FsUrlStreamHandlerFactory();
- java.net.URL.setURLStreamHandlerFactory(factory);
- }
-
/**
* Test opening and reading from an InputStream through a hdfs:// URL.
* <p>
@@ -59,6 +52,14 @@
MiniDFSCluster cluster = new MiniDFSCluster(conf, 2, true, null);
FileSystem fs = cluster.getFileSystem();
+ // Setup our own factory
+ // setURLSteramHandlerFactor is can be set at most once in the JVM
+ // the new URLStreamHandler is valid for all tests cases
+ // in TestStreamHandler
+ FsUrlStreamHandlerFactory factory =
+ new org.apache.hadoop.fs.FsUrlStreamHandlerFactory();
+ java.net.URL.setURLStreamHandlerFactory(factory);
+
Path filePath = new Path("/thefile");
try {
@@ -104,7 +105,7 @@
* @throws URISyntaxException
*/
public void testFileUrls() throws IOException, URISyntaxException {
-
+ // URLStreamHandler is already set in JVM by testDfsUrls()
Configuration conf = new Configuration();
// Locate the test temporary directory.