diff --git a/.github/workflows/ant.yml b/.github/workflows/ant.yml new file mode 100644 index 0000000..06fc807 --- /dev/null +++ b/.github/workflows/ant.yml @@ -0,0 +1,25 @@ +# This workflow will build a Java project with Ant +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant + +name: Java CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 11 + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + - name: Build with Ant + run: ant -noinput -buildfile build.xml diff --git a/jenkinsfile b/jenkinsfile new file mode 100644 index 0000000..31069da --- /dev/null +++ b/jenkinsfile @@ -0,0 +1,31 @@ +pipeline { + agent any + + stages { + stage('Checkout') { + steps { + // Jenkins automatically checks out the repo, but this ensures clarity + git url: 'git url: 'https://github.com/Ramesh-Gt966/java-code-sample-with-unit-test-cases.git', branch: 'main', branch: 'main' + } + } + + stage('Build & Test') { + steps { + // Use 'bat' if Jenkins is running on Windows + sh 'mvn clean test' + } + } + } + + post { + always { + echo 'Pipeline execution completed.' + } + success { + echo 'Build and tests succeeded!' + } + failure { + echo 'Build or tests failed. Check console output for details.' + } + } +} diff --git a/target/classes/com/example/App.class b/target/classes/com/example/App.class new file mode 100644 index 0000000..20a7382 Binary files /dev/null and b/target/classes/com/example/App.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..e69de29 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..80b4ff3 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1 @@ +C:\Users\Lenovo\Documents\GitHub\java-code-sample-with-unit-test-cases\src\main\java\com\example\App.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..e69de29 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..10fdcf8 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1 @@ +C:\Users\Lenovo\Documents\GitHub\java-code-sample-with-unit-test-cases\src\test\java\com\example\AppTest.java diff --git a/target/surefire-reports/2025-09-28T02-15-05_649-jvmRun1-commands.bin b/target/surefire-reports/2025-09-28T02-15-05_649-jvmRun1-commands.bin new file mode 100644 index 0000000..07ff0ca --- /dev/null +++ b/target/surefire-reports/2025-09-28T02-15-05_649-jvmRun1-commands.bin @@ -0,0 +1 @@ +:maven-surefire-command::noop::maven-surefire-command::bye-ack: \ No newline at end of file diff --git a/target/surefire-reports/2025-09-28T02-15-05_649-jvmRun1.dump b/target/surefire-reports/2025-09-28T02-15-05_649-jvmRun1.dump new file mode 100644 index 0000000..a8c3da7 --- /dev/null +++ b/target/surefire-reports/2025-09-28T02-15-05_649-jvmRun1.dump @@ -0,0 +1,3 @@ +# Created at 2025-09-28T02:15:06.396 +Found Maven process ID 4024 for the fork 1. + diff --git a/target/surefire-reports/TEST-com.example.AppTest.xml b/target/surefire-reports/TEST-com.example.AppTest.xml new file mode 100644 index 0000000..98019ac --- /dev/null +++ b/target/surefire-reports/TEST-com.example.AppTest.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/target/surefire-reports/com.example.AppTest.txt b/target/surefire-reports/com.example.AppTest.txt new file mode 100644 index 0000000..a0df294 --- /dev/null +++ b/target/surefire-reports/com.example.AppTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: com.example.AppTest +------------------------------------------------------------------------------- +Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.088 s -- in com.example.AppTest diff --git a/target/test-classes/com/example/AppTest.class b/target/test-classes/com/example/AppTest.class new file mode 100644 index 0000000..ffbcfb9 Binary files /dev/null and b/target/test-classes/com/example/AppTest.class differ