Explorar el Código

Changed test.system to JUnit tests.

Winston Li hace 12 años
padre
commit
91f5f6b302
Se han modificado 2 ficheros con 36 adiciones y 6 borrados
  1. 36 4
      services/git-bridge/build.xml
  2. 0 2
      services/git-bridge/test/system/main.sh

+ 36 - 4
services/git-bridge/build.xml

@@ -202,6 +202,12 @@
       <include name="unit"/>
       <include name="unit"/>
     </dirset>
     </dirset>
   </path>
   </path>
+
+  <path id="writelatex-git-bridge.module.test.system.sourcepath">
+    <dirset dir="${module.writelatex-git-bridge.basedir}/test">
+      <include name="system"/>
+    </dirset>
+  </path>
   
   
   
   
   <target name="compile.module.writelatex-git-bridge" depends="compile.module.writelatex-git-bridge.production,compile.module.writelatex-git-bridge.tests.unit" description="Compile module writelatex-git-bridge"/>
   <target name="compile.module.writelatex-git-bridge" depends="compile.module.writelatex-git-bridge.production,compile.module.writelatex-git-bridge.tests.unit" description="Compile module writelatex-git-bridge"/>
@@ -241,6 +247,24 @@
       </fileset>
       </fileset>
     </copy>
     </copy>
   </target>
   </target>
+
+  <target name="compile.module.writelatex-git-bridge.tests.system" depends="compile.module.writelatex-git-bridge.production" description="compile module writelatex-git-bridge; test classes" unless="skip.tests">
+    <mkdir dir="${writelatex-git-bridge.testoutput.dir}"/>
+    <javac destdir="${writelatex-git-bridge.testoutput.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
+      <compilerarg line="${compiler.args.writelatex-git-bridge}"/>
+      <bootclasspath refid="writelatex-git-bridge.module.bootclasspath"/>
+      <classpath refid="writelatex-git-bridge.module.classpath"/>
+      <src refid="writelatex-git-bridge.module.test.system.sourcepath"/>
+      <patternset refid="excluded.from.compilation.writelatex-git-bridge"/>
+    </javac>
+
+    <copy todir="${writelatex-git-bridge.testoutput.dir}">
+      <fileset dir="${module.writelatex-git-bridge.basedir}/test">
+        <patternset refid="compiler.resources"/>
+        <type type="file"/>
+      </fileset>
+    </copy>
+  </target>
   
   
   <target name="clean.module.writelatex-git-bridge" description="cleanup module">
   <target name="clean.module.writelatex-git-bridge" description="cleanup module">
     <delete dir="${writelatex-git-bridge.output.dir}"/>
     <delete dir="${writelatex-git-bridge.output.dir}"/>
@@ -314,10 +338,18 @@
     </junit>
     </junit>
   </target>
   </target>
 
 
-  <target name="test.system" depends="package">
-      <property name="executable-full-path"
-                location="${module.writelatex-git-bridge.basedir}/test/system"/>
-      <exec executable="${executable-full-path}/main.sh" />
+  <target name="test.system" depends="compile.module.writelatex-git-bridge.tests.system">
+    <junit>
+      <classpath>
+        <path refid="writelatex-git-bridge.module.classpath"/>
+        <pathelement location="${writelatex-git-bridge.testoutput.dir}"/>
+      </classpath>
+      <batchtest>
+        <fileset dir="${writelatex-git-bridge.testoutput.dir}">
+        </fileset>
+      </batchtest>
+      <formatter type="brief" usefile="false"/>
+    </junit>
   </target>
   </target>
 
 
   <target name="test" depends="test.unit, test.system, clean" />
   <target name="test" depends="test.unit, test.system, clean" />

+ 0 - 2
services/git-bridge/test/system/main.sh

@@ -1,2 +0,0 @@
-echo "System tests complete."
-exit 0