Author: cos
Date: Mon Oct 19 21:52:38 2009
New Revision: 826823
URL: http://svn.apache.org/viewvc?rev=826823&view=rev
Log:
HDFS-713. Need to properly check the type of the test class from an aspect.
Contributed by Konstantin Boudnik
Modified:
hadoop/hdfs/trunk/CHANGES.txt
hadoop/hdfs/trunk/src/test/aop/org/apache/hadoop/hdfs/HFlushAspects.aj
Modified: hadoop/hdfs/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=826823&r1=826822&r2=826823&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Mon Oct 19 21:52:38 2009
@@ -288,6 +288,9 @@
tests and changed SleepAction to support uniform random sleeping over an
interval. (szetszwo)
+ HDFS-713. Need to properly check the type of the test class from an aspect
+ (cos)
+
BUG FIXES
HDFS-76. Better error message to users when commands fail because of
Modified: hadoop/hdfs/trunk/src/test/aop/org/apache/hadoop/hdfs/HFlushAspects.aj
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/test/aop/org/apache/hadoop/hdfs/HFlushAspects.aj?rev=826823&r1=826822&r2=826823&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/test/aop/org/apache/hadoop/hdfs/HFlushAspects.aj
(original)
+++ hadoop/hdfs/trunk/src/test/aop/org/apache/hadoop/hdfs/HFlushAspects.aj Mon
Oct 19 21:52:38 2009
@@ -23,6 +23,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.fi.DataTransferTestUtil;
+import org.apache.hadoop.fi.PipelineTest;
import org.apache.hadoop.fi.FiHFlushTestUtil.HFlushTest;
import org.apache.hadoop.hdfs.DFSClient.DFSOutputStream;
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
@@ -46,12 +47,14 @@
LOG.info("No pipeline is built");
return;
}
- if (DataTransferTestUtil.getPipelineTest() == null) {
+ PipelineTest pt = DataTransferTestUtil.getPipelineTest();
+ if (pt == null) {
LOG.info("No test has been initialized");
return;
}
- for (int i=0; i<nodes.length; i++) {
-
((HFlushTest)DataTransferTestUtil.getPipelineTest()).fiCallHFlush.run(nodes[i]);
- }
+ if (pt instanceof HFlushTest)
+ for (int i=0; i<nodes.length; i++) {
+ ((HFlushTest)pt).fiCallHFlush.run(nodes[i]);
+ }
}
}