Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/selected-java-modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Ausgewählte Java-Module

on:
pull_request:
paths:
- "java-16-collections/**"
- "java-19-optional/**"
- "java-20-exceptions-try-catch-finally/**"
- "java-21-concurrency-multi-thread/**"
- "UnitTest_PropertyBasedTest/**"
- ".github/workflows/selected-java-modules.yml"
push:
branches:
- main
paths:
- "java-16-collections/**"
- "java-19-optional/**"
- "java-20-exceptions-try-catch-finally/**"
- "java-21-concurrency-multi-thread/**"
- "UnitTest_PropertyBasedTest/**"
- ".github/workflows/selected-java-modules.yml"
workflow_dispatch:

permissions:
contents: read

jobs:
maven-verify:
name: ${{ matrix.module }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
module:
- java-16-collections
- java-19-optional
- java-20-exceptions-try-catch-finally
- java-21-concurrency-multi-thread
- UnitTest_PropertyBasedTest

steps:
- name: Repository auschecken
uses: actions/checkout@v7

- name: Java 22 einrichten
uses: actions/setup-java@v6
with:
distribution: temurin
java-version: "22"
cache: maven
cache-dependency-path: ${{ matrix.module }}/pom.xml

- name: Modul kompilieren und testen
working-directory: ${{ matrix.module }}
run: mvn --batch-mode --no-transfer-progress verify
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Java-Lernrepository

[![Ausgewählte Java-Module](https://github.com/hakanmtn/Java-2024/actions/workflows/selected-java-modules.yml/badge.svg)](https://github.com/hakanmtn/Java-2024/actions/workflows/selected-java-modules.yml)

Dieses Repository dokumentiert meine praktische Java-Weiterbildung und eigene
Übungen – von den Grundlagen der Sprache bis zu Datenbankzugriffen mit JDBC und
objektrelationaler Abbildung mit JPA/Hibernate.
Expand Down Expand Up @@ -46,6 +48,12 @@ objektrelationaler Abbildung mit JPA/Hibernate.
- JPA und Hibernate ORM
- Git und GitHub

## Automatische Prüfung

GitHub Actions kompiliert und testet fünf ausgewählte, datenbankfreie Module
mit Java 22. Dazu gehören Collections, Optional, Exceptions, Nebenläufigkeit
sowie die Beispiele für Unit- und Property-based Testing.

## Verwendung

Repository klonen:
Expand Down
33 changes: 23 additions & 10 deletions UnitTest_PropertyBasedTest/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.hakanmetin</groupId>
Expand All @@ -12,37 +12,43 @@
<maven.compiler.source>22</maven.compiler.source>
<maven.compiler.target>22</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.13.1</junit.version>
<jqwik.version>1.9.3</jqwik.version>
</properties>


<dependencies>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.12.0</version>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.pholser</groupId>
<artifactId>junit-quickcheck-core</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.pholser</groupId>
<artifactId>junit-quickcheck-generators</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>

<!-- jqwik -->
<dependency>
<groupId>net.jqwik</groupId>
<artifactId>jqwik</artifactId>
<version>1.9.2</version>
<version>${jqwik.version}</version>
<scope>test</scope>
</dependency>

Expand All @@ -53,6 +59,13 @@
</dependency>
</dependencies>



</project>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
</plugin>
</plugins>
</build>
</project>