-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
133 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Java | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
Ant: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 11 for x64 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
architecture: x64 | ||
- name: Prepare | ||
run: find / -name "*.jar" 2>/dev/null| grep -P '(junit|hamcrest)' | ||
- name: Run the Ant 'junit' target | ||
run: ant -noinput -buildfile build.xml junit | ||
- name: Debug | ||
run: ls -lAh build |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<project name="MyProject" default="junit" basedir="."> | ||
<description> | ||
simple example build file | ||
</description> | ||
|
||
<property name="src" location="src" /> | ||
<property name="test" location="test" /> | ||
<property name="build" location="build" /> | ||
|
||
<target name="init"> | ||
<tstamp /> | ||
<mkdir dir="${build}" /> | ||
</target> | ||
|
||
<target name="compile" depends="init" description="compile the source"> | ||
<javac destdir="${build}" includeantruntime="false"> | ||
<src path="${src}" /> | ||
<src path="${test}" /> | ||
<classpath> | ||
<pathelement location="/usr/share/java/junit.jar"/> | ||
</classpath> | ||
</javac> | ||
</target> | ||
|
||
<target name="junit" depends="compile"> | ||
<junit haltonerror="true" printsummary="true"> | ||
<classpath> | ||
<pathelement location="/usr/share/java/junit.jar"/> | ||
<pathelement location="/usr/share/java/hamcrest-core.jar"/> | ||
<pathelement location="${build}"/> | ||
</classpath> | ||
<formatter type="xml"/> | ||
<batchtest fork="false" todir="${build}"> | ||
<fileset dir="${test}"> | ||
<include name="**/*Test.java"/> | ||
<include name="**/AllTests.java"/> | ||
</fileset> | ||
</batchtest> | ||
</junit> | ||
</target> | ||
|
||
<target name="clean" description="clean up"> | ||
<delete dir="${build}" /> | ||
<delete dir="${dist}" /> | ||
</target> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package my.pack; | ||
|
||
public class MyClass { | ||
boolean returnTrue() { | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package my.pack; | ||
|
||
public class OtherClass { | ||
int returnThree() { | ||
return 3; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package my; | ||
|
||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Suite; | ||
import org.junit.runners.Suite.SuiteClasses; | ||
|
||
@RunWith(Suite.class) | ||
@SuiteClasses({ my.pack.AllTests.class }) | ||
public class AllTests { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package my.pack; | ||
|
||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Suite; | ||
import org.junit.runners.Suite.SuiteClasses; | ||
|
||
@RunWith(Suite.class) | ||
@SuiteClasses({ MyClassTest.class, OtherClassTest.class }) | ||
public class AllTests { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package my.pack; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.junit.Test; | ||
|
||
public class MyClassTest { | ||
|
||
@Test | ||
public void testReturnTrue() { | ||
assertTrue(new MyClass().returnTrue()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package my.pack; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.junit.Test; | ||
|
||
public class OtherClassTest { | ||
|
||
@Test | ||
public void testReturnThree() { | ||
assertEquals(3, new OtherClass().returnThree()); | ||
} | ||
|
||
} |