commit 89a159224ef46ae9d6b89ca9f387a79036243135 Author: dadgam3er Date: Mon Sep 9 17:58:15 2024 -0400 Fix: 1 diff --git a/.gitea/workflows/mvn-demo.yml b/.gitea/workflows/mvn-demo.yml new file mode 100644 index 0000000..1482583 --- /dev/null +++ b/.gitea/workflows/mvn-demo.yml @@ -0,0 +1,29 @@ +name: Gitea Actions Demo +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: [push] + +jobs: + Explore-Gitea-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ gitea.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." + + GoBuild: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + java-version: '17' + distribution: 'temurin' + - run: mvn test diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..f9fe345 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.jdt.apt.core.prefs b/.settings/org.eclipse.jdt.apt.core.prefs new file mode 100644 index 0000000..d4313d4 --- /dev/null +++ b/.settings/org.eclipse.jdt.apt.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.apt.aptEnabled=false diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..1b6e1ef --- /dev/null +++ b/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.processAnnotations=disabled +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..b79a544 --- /dev/null +++ b/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + + PrepSession + MvnDemo + 1.0-SNAPSHOT + jar + + MvnDemo + http://maven.apache.org + + + UTF-8 + + + + + junit + junit + 3.8.1 + test + + + junit + junit + 4.13.2 + test + + + diff --git a/src/main/java/PrepSession/App.java b/src/main/java/PrepSession/App.java new file mode 100644 index 0000000..9957678 --- /dev/null +++ b/src/main/java/PrepSession/App.java @@ -0,0 +1,13 @@ +package PrepSession; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/src/main/java/PrepSession/Attack.java b/src/main/java/PrepSession/Attack.java new file mode 100644 index 0000000..ebf02c0 --- /dev/null +++ b/src/main/java/PrepSession/Attack.java @@ -0,0 +1,5 @@ +package PrepSession; + +public interface Attack { + void Attacking(); +} diff --git a/src/main/java/PrepSession/Breed.java b/src/main/java/PrepSession/Breed.java new file mode 100644 index 0000000..04fa612 --- /dev/null +++ b/src/main/java/PrepSession/Breed.java @@ -0,0 +1,14 @@ +package PrepSession; + +public abstract class Breed { + + public abstract void Breeding(); + + int lifeNum = 1; + String enviroment = "home"; + + public void Mating() { + System.out.println("Male and Female has to mate"); + } + +} diff --git a/src/main/java/PrepSession/Eagle.java b/src/main/java/PrepSession/Eagle.java new file mode 100644 index 0000000..3beb8a8 --- /dev/null +++ b/src/main/java/PrepSession/Eagle.java @@ -0,0 +1,18 @@ +package PrepSession; + +public class Eagle extends Breed implements Attack{ + public static void main(String[] args) { + Eagle eagle = new Eagle(); + System.out.println(eagle.lifeNum); + } + + @Override + public void Attacking() { + System.out.println("The Eagle is going crazy and I can't fucking find his prey."); + } + + @Override + public void Breeding() { + System.out.println("Breeding through laying eggs... Oviparous"); + } +} diff --git a/src/main/java/PrepSession/Fish.java b/src/main/java/PrepSession/Fish.java new file mode 100644 index 0000000..0dd4d1d --- /dev/null +++ b/src/main/java/PrepSession/Fish.java @@ -0,0 +1,22 @@ +package PrepSession; + +public class Fish extends Breed implements Hide, Attack{ + public static void main(String[] args) { + + } + + @Override + public void Hiding() { + System.out.println("The fish is going deeper to hide from the Eagle"); + } + + @Override + public void Attacking() { + System.out.println("The fish attacked a smaller fish"); + } + + @Override + public void Breeding() { + System.out.println("Breeding through laying eggs... Oviparous"); + } +} \ No newline at end of file diff --git a/src/main/java/PrepSession/Hide.java b/src/main/java/PrepSession/Hide.java new file mode 100644 index 0000000..cb3a625 --- /dev/null +++ b/src/main/java/PrepSession/Hide.java @@ -0,0 +1,5 @@ +package PrepSession; + +public interface Hide { + void Hiding(); +} diff --git a/src/main/java/PrepSession/MainClass.java b/src/main/java/PrepSession/MainClass.java new file mode 100644 index 0000000..98da750 --- /dev/null +++ b/src/main/java/PrepSession/MainClass.java @@ -0,0 +1,23 @@ +package PrepSession; + +public class MainClass { + public static void main(String[] args) { + + Fish fish = new Fish(); + fish.Hiding(); + fish.Attacking(); + fish.Breeding(); + System.out.println(""); + + Rabbit rabbit = new Rabbit(); + rabbit.Hiding(); + rabbit.Mating(); + rabbit.Breeding(); + System.out.println(""); + + Eagle hawk = new Eagle(); + hawk.Attacking(); + hawk.Mating(); + hawk.Breeding(); + } +} diff --git a/src/main/java/PrepSession/Rabbit.java b/src/main/java/PrepSession/Rabbit.java new file mode 100644 index 0000000..424a217 --- /dev/null +++ b/src/main/java/PrepSession/Rabbit.java @@ -0,0 +1,17 @@ +package PrepSession; + +public class Rabbit extends Breed implements Hide{ + public static void main(String[] args) { + + } + + @Override + public void Hiding() { + System.out.println("The Rabbit is running like crazy to hide."); + } + + @Override + public void Breeding() { + System.out.println("Breeding by having small baby rabbits... Mammals"); + } +} \ No newline at end of file diff --git a/src/test/java/PrepSession/AppTest.java b/src/test/java/PrepSession/AppTest.java new file mode 100644 index 0000000..b1f153e --- /dev/null +++ b/src/test/java/PrepSession/AppTest.java @@ -0,0 +1,38 @@ +package PrepSession; + +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} diff --git a/src/test/java/PrepSession/EagleTestCase.java b/src/test/java/PrepSession/EagleTestCase.java new file mode 100644 index 0000000..50cf8ef --- /dev/null +++ b/src/test/java/PrepSession/EagleTestCase.java @@ -0,0 +1,21 @@ +package PrepSession; + +import org.junit.Test; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + +import static org.junit.Assert.assertEquals; + +public class EagleTestCase { + @Test + public void Eagle_testATTACK(){ + Eagle hawk = new Eagle(); + ByteArrayOutputStream eagAttack = new ByteArrayOutputStream(); + System.setOut(new PrintStream(eagAttack)); + hawk.Attacking(); + assertEquals("The Eagle is going crazy and I can't fucking find his prey.\n", eagAttack.toString()); + assertEquals(1, hawk.lifeNum); + + } +} diff --git a/src/test/java/PrepSession/FishTestCase.java b/src/test/java/PrepSession/FishTestCase.java new file mode 100644 index 0000000..7a69e0b --- /dev/null +++ b/src/test/java/PrepSession/FishTestCase.java @@ -0,0 +1,31 @@ +package PrepSession; + +import org.junit.Test; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + +import static org.junit.Assert.assertEquals; + +public class FishTestCase { + // Fish hides successfully + @Test + public void test_fish_hides_successfully() { + Fish fish = new Fish(); + // Assuming the output is checked via console output, we can use System.out to capture it. + // This is a simple example, in real scenarios, we might use a logging framework or mock the output. + ByteArrayOutputStream outContent = new ByteArrayOutputStream(); + System.setOut(new PrintStream(outContent)); + fish.Hiding(); + assertEquals("The fish is going deeper to hide from the Eagle\n", outContent.toString()); + } + + @Test + public void test_fishAttack(){ + Fish fish = new Fish(); + ByteArrayOutputStream attckOut = new ByteArrayOutputStream(); + System.setOut(new PrintStream(attckOut)); + fish.Attacking(); + assertEquals("The fish attacked a smaller fish\n", attckOut.toString()); + } +} diff --git a/src/test/java/PrepSession/RabbitTestCase.java b/src/test/java/PrepSession/RabbitTestCase.java new file mode 100644 index 0000000..cc9b0ec --- /dev/null +++ b/src/test/java/PrepSession/RabbitTestCase.java @@ -0,0 +1,19 @@ +package PrepSession; + +import org.junit.Test; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + +import static org.junit.Assert.assertEquals; + +public class RabbitTestCase { + @Test + public void Rabbit_TestCase(){ + Rabbit rabbit = new Rabbit(); + ByteArrayOutputStream outContent = new ByteArrayOutputStream(); + System.setOut(new PrintStream(outContent)); + rabbit.Hiding(); + assertEquals("The Rabbit is running like crazy to hide.\n", outContent.toString()); + } +} diff --git a/target/classes/PrepSession/App.class b/target/classes/PrepSession/App.class new file mode 100644 index 0000000..92e6b9d Binary files /dev/null and b/target/classes/PrepSession/App.class differ diff --git a/target/classes/PrepSession/Attack.class b/target/classes/PrepSession/Attack.class new file mode 100644 index 0000000..206e387 Binary files /dev/null and b/target/classes/PrepSession/Attack.class differ diff --git a/target/classes/PrepSession/Breed.class b/target/classes/PrepSession/Breed.class new file mode 100644 index 0000000..f21f263 Binary files /dev/null and b/target/classes/PrepSession/Breed.class differ diff --git a/target/classes/PrepSession/Eagle.class b/target/classes/PrepSession/Eagle.class new file mode 100644 index 0000000..6700326 Binary files /dev/null and b/target/classes/PrepSession/Eagle.class differ diff --git a/target/classes/PrepSession/Fish.class b/target/classes/PrepSession/Fish.class new file mode 100644 index 0000000..4936ffe Binary files /dev/null and b/target/classes/PrepSession/Fish.class differ diff --git a/target/classes/PrepSession/Hide.class b/target/classes/PrepSession/Hide.class new file mode 100644 index 0000000..ecec038 Binary files /dev/null and b/target/classes/PrepSession/Hide.class differ diff --git a/target/classes/PrepSession/MainClass.class b/target/classes/PrepSession/MainClass.class new file mode 100644 index 0000000..fa5c5e8 Binary files /dev/null and b/target/classes/PrepSession/MainClass.class differ diff --git a/target/classes/PrepSession/Rabbit.class b/target/classes/PrepSession/Rabbit.class new file mode 100644 index 0000000..aec6094 Binary files /dev/null and b/target/classes/PrepSession/Rabbit.class differ diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..714d24c --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,7 @@ +PrepSession/Hide.class +PrepSession/Rabbit.class +PrepSession/App.class +PrepSession/Attack.class +PrepSession/Eagle.class +PrepSession/MainClass.class +PrepSession/Fish.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..06e47ec --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,8 @@ +/home/ilyes/mvnAction/MvnDemo/src/main/java/PrepSession/App.java +/home/ilyes/mvnAction/MvnDemo/src/main/java/PrepSession/Eagle.java +/home/ilyes/mvnAction/MvnDemo/src/main/java/PrepSession/Rabbit.java +/home/ilyes/mvnAction/MvnDemo/src/main/java/PrepSession/Hide.java +/home/ilyes/mvnAction/MvnDemo/src/main/java/PrepSession/Fish.java +/home/ilyes/mvnAction/MvnDemo/src/main/java/PrepSession/MainClass.java +/home/ilyes/mvnAction/MvnDemo/src/main/java/PrepSession/Attack.java +/home/ilyes/mvnAction/MvnDemo/src/main/java/PrepSession/Breed.java diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..04b6c8f --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst @@ -0,0 +1,4 @@ +PrepSession/AppTest.class +PrepSession/EagleTestCase.class +PrepSession/RabbitTestCase.class +PrepSession/FishTestCase.class diff --git a/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..edf31f9 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1,4 @@ +/home/ilyes/mvnAction/MvnDemo/src/test/java/PrepSession/FishTestCase.java +/home/ilyes/mvnAction/MvnDemo/src/test/java/PrepSession/EagleTestCase.java +/home/ilyes/mvnAction/MvnDemo/src/test/java/PrepSession/RabbitTestCase.java +/home/ilyes/mvnAction/MvnDemo/src/test/java/PrepSession/AppTest.java diff --git a/target/surefire-reports/PrepSession.AppTest.txt b/target/surefire-reports/PrepSession.AppTest.txt new file mode 100644 index 0000000..22a58a5 --- /dev/null +++ b/target/surefire-reports/PrepSession.AppTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: PrepSession.AppTest +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s -- in PrepSession.AppTest diff --git a/target/surefire-reports/PrepSession.EagleTestCase.txt b/target/surefire-reports/PrepSession.EagleTestCase.txt new file mode 100644 index 0000000..4d71723 --- /dev/null +++ b/target/surefire-reports/PrepSession.EagleTestCase.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: PrepSession.EagleTestCase +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.039 s -- in PrepSession.EagleTestCase diff --git a/target/surefire-reports/PrepSession.FishTestCase.txt b/target/surefire-reports/PrepSession.FishTestCase.txt new file mode 100644 index 0000000..5f696be --- /dev/null +++ b/target/surefire-reports/PrepSession.FishTestCase.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: PrepSession.FishTestCase +------------------------------------------------------------------------------- +Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s -- in PrepSession.FishTestCase diff --git a/target/surefire-reports/PrepSession.RabbitTestCase.txt b/target/surefire-reports/PrepSession.RabbitTestCase.txt new file mode 100644 index 0000000..7497b47 --- /dev/null +++ b/target/surefire-reports/PrepSession.RabbitTestCase.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: PrepSession.RabbitTestCase +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s -- in PrepSession.RabbitTestCase diff --git a/target/surefire-reports/TEST-PrepSession.AppTest.xml b/target/surefire-reports/TEST-PrepSession.AppTest.xml new file mode 100644 index 0000000..872743c --- /dev/null +++ b/target/surefire-reports/TEST-PrepSession.AppTest.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-PrepSession.EagleTestCase.xml b/target/surefire-reports/TEST-PrepSession.EagleTestCase.xml new file mode 100644 index 0000000..47ff850 --- /dev/null +++ b/target/surefire-reports/TEST-PrepSession.EagleTestCase.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-PrepSession.FishTestCase.xml b/target/surefire-reports/TEST-PrepSession.FishTestCase.xml new file mode 100644 index 0000000..9ceab0f --- /dev/null +++ b/target/surefire-reports/TEST-PrepSession.FishTestCase.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/TEST-PrepSession.RabbitTestCase.xml b/target/surefire-reports/TEST-PrepSession.RabbitTestCase.xml new file mode 100644 index 0000000..840c31b --- /dev/null +++ b/target/surefire-reports/TEST-PrepSession.RabbitTestCase.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/test-classes/PrepSession/AppTest.class b/target/test-classes/PrepSession/AppTest.class new file mode 100644 index 0000000..d028e58 Binary files /dev/null and b/target/test-classes/PrepSession/AppTest.class differ diff --git a/target/test-classes/PrepSession/EagleTestCase.class b/target/test-classes/PrepSession/EagleTestCase.class new file mode 100644 index 0000000..e04aeaf Binary files /dev/null and b/target/test-classes/PrepSession/EagleTestCase.class differ diff --git a/target/test-classes/PrepSession/FishTestCase.class b/target/test-classes/PrepSession/FishTestCase.class new file mode 100644 index 0000000..647a256 Binary files /dev/null and b/target/test-classes/PrepSession/FishTestCase.class differ diff --git a/target/test-classes/PrepSession/RabbitTestCase.class b/target/test-classes/PrepSession/RabbitTestCase.class new file mode 100644 index 0000000..9d80c9c Binary files /dev/null and b/target/test-classes/PrepSession/RabbitTestCase.class differ