junit4 is the "old" release
https://github.com/junit-team/junit4/wiki/Download-and-Install

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2023-10-03 16:14:42 -04:00
parent cc6cd29661
commit fadee31f21
Signed by: vbatts
GPG key ID: E30EFAA812C6E5ED
4 changed files with 44 additions and 3 deletions

View file

@ -1,20 +1,26 @@
<?xml version="1.0"?>
<project>
<project name="HelloWorld" basedir="." default="main">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="lib.dir" value="lib"/>
<property name="main-class" value="hbb.HelloWorld"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<path id="application" location="${jar.dir}/${ant.project.name}.jar"/>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac srcdir="src" destdir="${classes.dir}"/>
<javac srcdir="src" destdir="${classes.dir}" classpathref="classpath"/>
</target>
<target name="jar" depends="compile">
@ -27,7 +33,24 @@
</target>
<target name="run" depends="jar">
<java jar="${jar.dir}/HelloWorld.jar" fork="true"/>
<java fork="true" classname="${main-class}">
<classpath>
<path refid="classpath"/>
<path location="${jar.dir}/${ant.project.name}.jar"/>
</classpath>
</java>
</target>
<target name="junit" depends="jar">
<junit printsummary="yes">
<classpath>
<path refid="classpath"/>
<path refid="application"/>
</classpath>
<batchtest fork="yes">
<fileset dir="${src.dir}" includes="**/*Test.java"/>
</batchtest>
</junit>
</target>
<target name="clean-build" depends="clean,jar"/>

0
lib/.gitkeep Normal file
View file

BIN
lib/junit-4.13.2.jar Normal file

Binary file not shown.

View file

@ -0,0 +1,18 @@
package hbb;
import org.junit.Test;
import static org.junit.Assert.fail;
public class HelloWorldTest {
@Test
public void testNothing() {
}
@Test
public void testWillAlwaysFail() {
fail("An error message");
}
}