浏览代码

ZOOKEEPER-623. ClientBase in bookkeeper.util requires junit

git-svn-id: https://svn.apache.org/repos/asf/hadoop/zookeeper/trunk@891856 13f79535-47bb-0310-9956-ffa450edef68
Benjamin Reed 15 年之前
父节点
当前提交
983b66079a
共有 2 个文件被更改,包括 15 次插入1 次删除
  1. 5 1
      src/contrib/bookkeeper/build.xml
  2. 10 0
      src/contrib/build-contrib.xml

+ 5 - 1
src/contrib/bookkeeper/build.xml

@@ -60,7 +60,7 @@
 
 
   <target name="compile" depends="ivy-retrieve,zookeeperbuildcontrib.compile"/>
   <target name="compile" depends="ivy-retrieve,zookeeperbuildcontrib.compile"/>
 
 
-  <target name="test" depends="compile-test,test-init,test-category,junit.run" />
+  <target name="test" depends="checkMainTestCompiled,compile-test,test-init,test-category,junit.run" />
 
 
 	<target name="compile-test" depends="ivy-retrieve-test,compile">
 	<target name="compile-test" depends="ivy-retrieve-test,compile">
   		<property name="target.jdk" value="${ant.java.version}" />	
   		<property name="target.jdk" value="${ant.java.version}" />	
@@ -71,6 +71,9 @@
 			target="${target.jdk}" 
 			target="${target.jdk}" 
 			debug="on" >
 			debug="on" >
 			<classpath refid="classpath" />
 			<classpath refid="classpath" />
+			<classpath>
+				<pathelement location="${zk.root}/build/test/classes"/>
+			</classpath>
 		</javac>
 		</javac>
 	</target>
 	</target>
 	
 	
@@ -104,6 +107,7 @@
           <classpath refid="classpath"/>
           <classpath refid="classpath"/>
           <classpath>
           <classpath>
              <pathelement path="${build.test}" />
              <pathelement path="${build.test}" />
+             <pathelement location="${zk.root}/build/test/classes"/>
           </classpath>
           </classpath>
           <formatter type="${test.junit.output.format}" />
           <formatter type="${test.junit.output.format}" />
           <batchtest todir="${test.log.dir}" unless="testcase">
           <batchtest todir="${test.log.dir}" unless="testcase">

+ 10 - 0
src/contrib/build-contrib.xml

@@ -163,6 +163,16 @@
   </target>
   </target>
 
 
 
 
+  <target name="checkMainTestIsAvailable">
+    <available file="${zk.root}/build/test/classes/org/apache/zookeeper/test/ClientBase.class"
+               property="mainTestIsCompiled">
+    </available>
+  </target>
+
+  <target name="checkMainTestCompiled" unless="mainTestIsCompiled" depends="checkMainTestIsAvailable">
+    <fail message="ZooKeeper test must first be compiled (toplevel build.xml) using 'ant compile-test'"/>
+  </target>
+
   <!-- ====================================================== -->
   <!-- ====================================================== -->
   <!-- Ivy                                                    -->
   <!-- Ivy                                                    -->
   <!-- ====================================================== -->
   <!-- ====================================================== -->