Skip to content

Commit

Permalink
chore: initial commit of ee10 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
hantsy committed Oct 22, 2023
2 parents ff13ff7 + e04f4ed commit ad85139
Show file tree
Hide file tree
Showing 15 changed files with 110 additions and 174 deletions.
44 changes: 0 additions & 44 deletions .circleci/config.yml

This file was deleted.

7 changes: 2 additions & 5 deletions .github/workflows/arq-glassfish-managed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,12 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'zulu'
distribution: 'temurin'
cache: maven
- name: Set up Database
run: |
docker-compose up -d postgres
sleep 5
docker ps -a
- name: Build with Maven
run: |
mvn -B -q clean verify -Parq-glassfish-managed
run: mvn clean verify -Parq-glassfish-managed
4 changes: 2 additions & 2 deletions .github/workflows/arq-glassfish-remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'zulu'
distribution: 'temurin'
cache: maven
- name: Set up Database
run: |
Expand Down Expand Up @@ -59,6 +59,6 @@ jobs:
#
- name: Build with Maven
run: |
mvn -B -q clean verify -Parq-glassfish-remote
mvn clean verify -Parq-glassfish-remote

2 changes: 1 addition & 1 deletion .github/workflows/arq-wildfly-managed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
distribution: 'temurin'
java-version: '21'
cache: "maven"
- name: Set up Database
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/arq-wildfly-remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up JDKs
uses: actions/setup-java@v3
with:
distribution: 'zulu'
distribution: 'temurin'
java-version: '21'
cache: "maven"
- name: Set up Database
Expand Down
37 changes: 33 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ jobs:
# Recommended: latest versions of Google Java Format require JDK 11+
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: "21"
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- uses: axel-op/googlejavaformat-action@v3
with:
args: "--aosp --skip-reflowing-long-strings --skip-sorting-imports --replace"
Expand All @@ -43,8 +44,36 @@ jobs:
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Build with Maven
run: |
mvn clean package --file pom.xml
coverage:
runs-on: ubuntu-latest
needs: [ formatting, build ]
steps:
- uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Set up Database
run: |
docker-compose up -d postgres
sleep 5
docker ps -a
- name: Build with Maven
run: mvn clean package --file pom.xml
run: |
mvn clean package
mvn verify -Parq-wildfly-managed,coverage jacoco:report \
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login=$SONAR_TOKEN \
-Dsonar.organization=hantsy \
-Dsonar.projectKey=hantsy_cargotracker \
-Dsonar.coverage.exclusions=**/dto/*,**/*Configuration.*,**/SampleDataGenerator.*
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
![Integration Test with Arquillian WildFly Managed Container](https://github.com/hantsy/cargotracker/workflows/arq-wildfly-managed/badge.svg)
![Integration Test with Arquillian WildFly Remote Container](https://github.com/hantsy/cargotracker/workflows/arq-wildfly-remote/badge.svg)


[![CircleCI](https://circleci.com/gh/hantsy/cargotracker.svg?style=svg)](https://circleci.com/gh/hantsy/cargotracker)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=hantsy_cargotracker&metric=alert_status)](https://sonarcloud.io/dashboard?id=hantsy_cargotracker)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=hantsy_cargotracker&metric=coverage)](https://sonarcloud.io/dashboard?id=hantsy_cargotracker)

Expand Down
79 changes: 30 additions & 49 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<glassfish.version>7.0.9</glassfish.version>
<jersey.version>3.1.3</jersey.version>
<eclipselink.version>4.0.1</eclipselink.version>
<tyrus.version>2.1.3</tyrus.version>
<arquillian-glassfish-jakarta.version>7.0.9</arquillian-glassfish-jakarta.version>

<!-- Wildfly server -->
Expand All @@ -69,6 +70,7 @@
<wildfly-arquillian.version>5.0.1.Final</wildfly-arquillian.version>
<!-- aligned to Wildfly version. -->
<resteasy.version>6.2.5.Final</resteasy.version>
<undertow-websockets-jsr.version>2.3.10.Final</undertow-websockets-jsr.version>

<!-- Application properties -->
<webapp.databaseTempDir>/tmp</webapp.databaseTempDir>
Expand Down Expand Up @@ -532,6 +534,13 @@
<version>${jersey.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.tyrus.bundles/tyrus-standalone-client -->
<dependency>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-standalone-client</artifactId>
<version>${tyrus.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.hantsy.arquillian-container-glassfish-jakarta</groupId>
<artifactId>arquillian-glassfish-managed-jakarta</artifactId>
Expand Down Expand Up @@ -644,6 +653,14 @@
<version>${jersey.version}</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.tyrus.bundles/tyrus-standalone-client -->
<dependency>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-standalone-client</artifactId>
<version>${tyrus.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.github.hantsy.arquillian-container-glassfish-jakarta</groupId>
<artifactId>arquillian-glassfish-remote-jakarta</artifactId>
Expand Down Expand Up @@ -689,18 +706,14 @@
<serverRoot>${project.build.directory}/wildfly-${wildfly.version}</serverRoot>
</properties>
<dependencies>
<!--<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-websockets-jsr</artifactId>
<version>${undertow-websockets-jsr.version}</version>
<!-- https://mvnrepository.com/artifact/org.glassfish.tyrus.bundles/tyrus-standalone-client -->
<dependency>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-standalone-client</artifactId>
<version>${tyrus.version}</version>
<scope>test</scope>
</dependency>-->
</dependency>

<!-- TESTS -->
<!-- JAXRS test need the dependency:resteasy-client -->
<!-- Import the RestEasy Client and jackson2/json-binding/json-p provider, we use
test scope
as we need that for test purposes -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
Expand All @@ -713,26 +726,6 @@
<version>${resteasy.version}</version>
<scope>test</scope>
</dependency>

<!-- use Jersey client instead -->
<!--<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-binding</artifactId>
<version>${jersey.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${jersey.version}</version>
<scope>test</scope>
</dependency>-->
<dependency>
<groupId>org.wildfly.arquillian</groupId>
<artifactId>wildfly-arquillian-container-managed</artifactId>
Expand Down Expand Up @@ -809,6 +802,13 @@
<skip.integration.tests>false</skip.integration.tests>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.glassfish.tyrus.bundles/tyrus-standalone-client -->
<dependency>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-standalone-client</artifactId>
<version>${tyrus.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
Expand All @@ -821,25 +821,6 @@
<version>${resteasy.version}</version>
<scope>test</scope>
</dependency>
<!-- use Jersey client instead -->
<!--<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-binding</artifactId>
<version>${jersey.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${jersey.version}</version>
<scope>test</scope>
</dependency>-->

<dependency>
<groupId>org.wildfly.arquillian</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;

// TODO [Jakarta EE 8] Adopt the Date-Time API.
@Stateless
public class DefaultBookingService implements BookingService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;

// TODO [Jakarta EE 8] Adopt the Date-Time API.
@Stateless
public class DefaultCargoInspectionService implements CargoInspectionService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;

// TODO [Jakarta EE 8] Adopt the Date-Time API.
@Stateless
public class DefaultHandlingEventService implements HandlingEventService {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.eclipse.cargotracker.application.util;

import org.eclipse.cargotracker.application.internal.DefaultCargoInspectionService;
import org.eclipse.cargotracker.domain.model.cargo.*;
import org.eclipse.cargotracker.domain.model.handling.*;
import org.eclipse.cargotracker.domain.model.location.SampleLocations;
Expand All @@ -24,7 +25,7 @@
@Startup
public class SampleDataGenerator {

@Inject private Logger logger;
private static final Logger LOGGER = Logger.getLogger(SampleDataGenerator.class.getName());

@PersistenceContext private EntityManager entityManager;
@Inject private HandlingEventFactory handlingEventFactory;
Expand All @@ -33,7 +34,7 @@ public class SampleDataGenerator {
@PostConstruct
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void loadSampleData() {
logger.info("Loading sample data.");
LOGGER.info("Loading sample data.");
unLoadAll(); // Fail-safe in case of application restart that does not trigger a JPA schema
// drop.
loadSampleLocations();
Expand All @@ -42,7 +43,7 @@ public void loadSampleData() {
}

private void unLoadAll() {
logger.info("Unloading all existing data.");
LOGGER.info("Unloading all existing data.");
// In order to remove handling events, must remove references in cargo.
// Dropping cargo first won't work since handling events have references
// to it.
Expand All @@ -66,7 +67,7 @@ private void unLoadAll() {
}

private void loadSampleLocations() {
logger.info("Loading sample locations.");
LOGGER.info("Loading sample locations.");

entityManager.persist(SampleLocations.HONGKONG);
entityManager.persist(SampleLocations.MELBOURNE);
Expand All @@ -84,7 +85,7 @@ private void loadSampleLocations() {
}

private void loadSampleVoyages() {
logger.info("Loading sample voyages.");
LOGGER.info("Loading sample voyages.");

entityManager.persist(SampleVoyages.HONGKONG_TO_NEW_YORK);
entityManager.persist(SampleVoyages.NEW_YORK_TO_DALLAS);
Expand All @@ -94,7 +95,7 @@ private void loadSampleVoyages() {
}

private void loadSampleCargos() {
logger.info("Loading sample cargo data.");
LOGGER.info("Loading sample cargo data.");

// Cargo ABC123. This one is en-route.
TrackingId trackingId1 = new TrackingId("ABC123");
Expand Down
Loading

0 comments on commit ad85139

Please sign in to comment.