Author: cos
Date: Tue Nov 30 05:31:30 2010
New Revision: 1040411
URL: http://svn.apache.org/viewvc?rev=1040411&view=rev
Log:
HDFS-1503. TestSaveNamespace fails. Contributed by Todd Lipcon.
Modified:
hadoop/hdfs/trunk/CHANGES.txt
hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSaveNamespace.java
Modified: hadoop/hdfs/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1040411&r1=1040410&r2=1040411&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Tue Nov 30 05:31:30 2010
@@ -27,6 +27,8 @@ Trunk (unreleased changes)
HDFS-1516. mvn-install is broken after 0.22 branch creation. (cos)
+ HDFS-1503. TestSaveNamespace fails. (Todd Lipcon via cos)
+
Release 0.22.0 - Unreleased
NEW FEATURES
Modified:
hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSaveNamespace.java
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSaveNamespace.java?rev=1040411&r1=1040410&r2=1040411&view=diff
==============================================================================
---
hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSaveNamespace.java
(original)
+++
hadoop/hdfs/trunk/src/test/hdfs/org/apache/hadoop/hdfs/server/namenode/TestSaveNamespace.java
Tue Nov 30 05:31:30 2010
@@ -59,13 +59,8 @@ public class TestSaveNamespace {
private static class FaultySaveImage implements Answer<Void> {
int count = 0;
- FSImage origImage;
- public FaultySaveImage(FSImage origImage) {
- this.origImage = origImage;
- }
-
- public Void answer(InvocationOnMock invocation) throws Exception {
+ public Void answer(InvocationOnMock invocation) throws Throwable {
Object[] args = invocation.getArguments();
File f = (File)args[0];
@@ -74,8 +69,7 @@ public class TestSaveNamespace {
throw new RuntimeException("Injected fault: saveFSImage second time");
}
LOG.info("Not injecting fault for file: " + f);
- origImage.saveFSImage(f);
- return null;
+ return (Void)invocation.callRealMethod();
}
}
@@ -103,7 +97,7 @@ public class TestSaveNamespace {
switch(fault) {
case SAVE_FSIMAGE:
// The spy throws a RuntimeException when writing to the second directory
- doAnswer(new FaultySaveImage(spyImage)).
+ doAnswer(new FaultySaveImage()).
when(spyImage).saveFSImage((File)anyObject());
break;
case MOVE_CURRENT: