hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brahma Reddy <brahmareddy.batt...@huawei.com>
Subject Re: [jira] [Created] (HADOOP-8436) NPE In getLocalPathForWrite ( path, conf ) when dfs.client.buffer.dir not configured
Date Mon, 28 May 2012 16:02:14 GMT
Adding null check...

if (null == newLocalDirs) {
        throw new IOException(contextCfgItemName + " not configured");
      }



Testcase..


/*
+   * Test when dfs.client.buffer.dir not configured and called
+   * getLocalPathForWrite
+   */
+  @Test
+  public void testShouldNotthrowNPE() throws Exception {
+
+    Configuration conf1 = new Configuration();
+    try {
+      dirAllocator.getLocalPathForWrite("/test", conf1);
+      fail("not throwing the exception");
+    } catch (IOException e) {
+      assertEquals("Incorrect exception message",
+          CONTEXT+" not configured", e.getMessage());
+    }
+  }
 }

--
View this message in context: http://lucene.472066.n3.nabble.com/jira-Created-HADOOP-8436-NPE-In-getLocalPathForWrite-path-conf-when-dfs-client-buffer-dir-not-configd-tp3986032p3986442.html
Sent from the Hadoop lucene-dev mailing list archive at Nabble.com.

Mime
View raw message