瀏覽代碼

HADOOP-6347. svn merge -c 832157 from trunk to branch 0.21

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.21@832162 13f79535-47bb-0310-9956-ffa450edef68
Konstantin Boudnik 15 年之前
父節點
當前提交
3357118cd6
共有 3 個文件被更改,包括 14 次插入5 次删除
  1. 3 0
      CHANGES.txt
  2. 7 3
      build.xml
  3. 4 2
      src/test/aop/build/aop.xml

+ 3 - 0
CHANGES.txt

@@ -1106,6 +1106,9 @@ Trunk (unreleased changes)
     HADOOP-6344. Fix rm and rmr immediately delete files rather than sending 
     to trash, if a user is over-quota. (Jakob Homan via suresh)
 
+    HADOOP-6347. run-test-core-fault-inject runs a test case twice if
+    -Dtestcase is set (cos)
+
 Release 0.20.2 - Unreleased
 
   NEW FEATURES

+ 7 - 3
build.xml

@@ -443,7 +443,8 @@
   <!-- Compile test code                                                  --> 
   <!-- ================================================================== -->
   <!-- This is a wrapper for fault-injection needs-->
-  <target name="compile-tests" depends="compile-core-test"/> 
+  <target name="-classes-compilation"
+    depends="compile-core-classes, compile-core-test"/> 
 
   <target name="compile-core-test" depends="compile-core-classes, ivy-retrieve-test, generate-test-records, generate-avro-records">
     <mkdir dir="${test.core.build.classes}"/>
@@ -573,10 +574,14 @@
       <isset property="testcase" />
     </and>
   </condition>
+  <condition property="tests.testcaseonly">
+    <istrue value="${special.fi.testcasesonly}" />
+  </condition>
   <condition property="tests.testcase.fi">
     <and>
       <istrue value="${test.fault.inject}" />
       <isset property="testcase" />
+      <isfalse value="${special.fi.testcasesonly}" />
     </and>
   </condition>
 	     
@@ -643,8 +648,7 @@
       </batchtest>
       <!--The following batch is for very special occasions only when
       a non-FI tests are needed to be executed against FI-environment -->
-      <batchtest todir="${test.build.dir}" if="special.fi.testcasesonly">
-        <fileset dir="${test.src.dir}/aop" includes="**/${testcase}.java"/>
+      <batchtest todir="${test.build.dir}" if="tests.testcaseonly">
         <fileset dir="${test.src.dir}/core" includes="**/${testcase}.java"/>
       </batchtest>
     </junit>

+ 4 - 2
src/test/aop/build/aop.xml

@@ -31,8 +31,10 @@
   	Later on one can run 'ant jar-fault-inject' to create
   	Hadoop jar file with instrumented classes
   -->
-  <target name="compile-fault-inject" 
-  	depends="compile-core-classes, compile-tests">
+  <!-- Target -classes-compilation has to be defined in build.xml and
+  needs to depend on classes compilation and test classes compilation
+  targets. This is a poor man parametrization for targets -->
+  <target name="compile-fault-inject" depends="-classes-compilation" >
     <!-- AspectJ task definition -->
     <taskdef
       resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">