Skip to content

Commit

Permalink
Jakarta-fication (#48)
Browse files Browse the repository at this point in the history
Jakarta-fication
  • Loading branch information
runeflobakk authored Oct 14, 2019
2 parents 12a6777 + 54618df commit 9a398ce
Show file tree
Hide file tree
Showing 17 changed files with 287 additions and 164 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".travis"]
path = .travis
url = https://github.com/digipost/digipost-open-travis-config
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-P build-sources-and-javadoc
1 change: 1 addition & 0 deletions .travis
Submodule .travis added at e57885
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
dist: trusty
language: java

jdk:
- oraclejdk8
#- openjdk11 # will not build on JDK > 8, until we upgrade Lombok
#- openjdk12

cache:
directories:
- "$HOME/.m2"

env:
global:
- secure: dEmO9A2TvDhHBVwuMq7nUqO7IBtSwStTqZ/jwscAPdgKIB/lE/+Zojk4ovBoSKgu/sW+Zr3KOGgikrJoTinSmvlu2sZXkS0AetZoGjG9iympqOH/a9yiiIlDhSjccxWyfStHpXNYBFs8/dpQ3S8omAue2WNWrI3TK0u7Kw4XRvH0RB/byyvv6zFp6Dnyx8doK96MHXTGIWdWV99xtz5a24s/TMpND2ohFvgrtXbc9nNV/YZbui2RGhX50cBrUPoiNBGh+FnBSSjdwhTA1bGzDog0ym1aQ9/Uya5qmpHS8Z5vCRgWvYQW/l7v/y4Jvolz8sJRccf7pj8qTpmfKKP1nj1P5bX+Hn6TYKBRzBJaHxPn4XWi/E7bCbssLvEPmE2oYWvExnKaHzERJlkMoNOtiRNfm+RWQRLvEIXsbwnr8hL1GUYlokeHDiQMM896tAdmPn9kh73huThNTVn25XZPKc3o1W18pmQjpcO8rW2FDVR73vvW1kmldRJd/UU+oqM96QYwWcRFpCmRzNWIAntJo8yQXkCcUsHA9a14nuTHAeYWbczv9d9+X+ypbsjHg4PCvkkKYz6DfwElUjrShbhgUMqu4qOzgu0gW5ZhRAEQlCqF9WjgyzeYxzcKakZQxqriSOkYKL9xFDaiFe0CaQOqNL9WOaggah7cKjiopvAEgPo=
- secure: huH1J4qQxTu/ll2QmozX+QbcQBUinmOEW+UnmZzWyib8l40nmXzul8c9/9RQgk732yTkqHAJrNd6hbFwN786nRLThfTGnvTSTUwBNyBvfnnVppm5IKU0VPa5hCLCNHz/e3WG4qdOAZMnd/NnoB8diRaC9vOxaiXPumN51hx9nkahhs3JdbCU/ZW1zHTf7U+Kh6UP4V4DXimwnqwlTgrO4jvcb+pwGzVKt+BNi1lP4Xzajm400FEkbZbscr3Wc6MXNFoIawQbENbvQr4LJyh3Tys9YRTTHWF78vGnENiaz0VWQ5Zxv71DSTlMqnyk2uGyIQmbpqM1HsbOgk8dpoeMC5+EEBc4C905Q8JMjMoh7vf+7ipnAmC1HPGWicwq9MOZ60jnoiCBpsk75JuzESB909Ecxz28AnR81Kh6eKwT5q5HTy4cMUHV9yVsnMDisj8/C2yuEVRjeIIP5ebg3QACrIVty6jJIbScLWOX8Bzky38kn8faJ/DvS8Nap5f29d5hp1wGI85Zq86EgRJZYIpfjoF6EIVRGZrVGzc1+cA/9pQhBSLjwquLqOeoLuV26SHvEExZEvvtgniH7RXZ8ktVnUKKgezqiiQpiCJuhNkKHKiCy+uznEiPPccNIDcyEtHOoj87uDO/MeyvjbdzQS9xsyFax9k7UJWbauzCmn/WlyA=

install: true

before_script:
- cp .travis/maven.settings.xml ~/.m2/settings.xml

script:
- mvn clean deploy --update-snapshots
6 changes: 3 additions & 3 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ specific language governing permissions and limitations
under the License.

This project includes:
Bean Validation API under Apache License 2.0
ClassMate under The Apache Software License, Version 2.0
digipost-data-types under The Apache Software License, Version 2.0
Expression Language 3.0 under CDDL + GPLv2 with classpath exception
Digipost Data Types under The Apache Software License, Version 2.0
Hibernate Validator Engine under Apache License 2.0
Jackson datatype: JSR310 under The Apache Software License, Version 2.0
Jackson-annotations under The Apache Software License, Version 2.0
Jackson-core under The Apache Software License, Version 2.0
jackson-databind under The Apache Software License, Version 2.0
Jakarta Bean Validation API under Apache License 2.0
Jakarta Expression Language 3.0 under EPL 2.0 or GPL2 w/ CPE
JBoss Logging 3 under Apache License, version 2.0
Project Lombok under The MIT License

6 changes: 3 additions & 3 deletions datatypes.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -376,19 +376,19 @@

<xs:simpleType name="status">
<xs:restriction base="xs:string">
<xs:enumeration value="DEVIATION"/>
<xs:enumeration value="RETURNED"/>
<xs:enumeration value="PICKED_UP"/>
<xs:enumeration value="READY_FOR_PICKUP"/>
<xs:enumeration value="DEVIATION"/>
<xs:enumeration value="UNKNOWN"/>
<xs:enumeration value="PICKED_UP"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="tag">
<xs:restriction base="xs:string">
<xs:enumeration value="POSTEN"/>
<xs:enumeration value="VARSEL2"/>
<xs:enumeration value="VARSEL1"/>
<xs:enumeration value="POSTEN"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
190 changes: 137 additions & 53 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,32 @@
<parent>
<groupId>no.digipost</groupId>
<artifactId>digipost-open-super-pom</artifactId>
<version>1</version>
<version>3</version>
</parent>

<artifactId>digipost-data-types</artifactId>
<version>0.23-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>Data types for Digipost Messages</description>
<version>0.24-SNAPSHOT</version>
<name>Digipost Data Types</name>
<description>Data types for Digipost messages</description>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jackson.version>2.8.9</jackson.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>2.9.5</version>
<version>2.9.10</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.5.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -55,38 +61,48 @@
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.16.Final</version>
<version>6.0.17.Final</version>
<scope>runtime</scope>
<exclusions>
<exclusion>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>3.0.0</version>
<artifactId>jakarta.el</artifactId>
<version>3.0.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.quicktheories</groupId>
<artifactId>quicktheories</artifactId>
<version>0.26</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>java-hamcrest</artifactId>
<version>2.0.0.0</version>
<artifactId>hamcrest</artifactId>
<version>2.2-rc1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -104,7 +120,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>25.0-jre</version>
<version>28.1-jre</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -119,10 +135,81 @@
</resources>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<configuration>
<rules>
<requireMavenVersion>
<version>3.3.1</version>
</requireMavenVersion>
<bannedDependencies>
<excludes>
<exclude>javax.*</exclude>
<exclude>org.hamcrest:hamcrest-core</exclude>
</excludes>
</bannedDependencies>
</rules>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.5</version>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
</plugin>
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<version>0.14.1</version>
<configuration>
<newVersion>
<file><path>${project.build.directory}/${project.build.finalName}.${project.packaging}</path></file>
</newVersion>
<parameter>
<onlyModified>true</onlyModified>
<onlyBinaryIncompatible>true</onlyBinaryIncompatible>
<includes>
<include>no.digipost</include>
</includes>
</parameter>
</configuration>
</plugin>
</plugins>
</pluginManagement>
Expand Down Expand Up @@ -178,35 +265,33 @@
</transformSchemas>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/generated-resources/schemagen/</directory>
<includes>
<include>*.xsd</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/generated-resources/schemagen/</directory>
<includes>
<include>*.xsd</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>datatypes-documentation</id>
Expand All @@ -221,7 +306,6 @@
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/no/digipost/api/datatypes/ComplementByTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@
import no.digipost.api.datatypes.types.Appointment;
import no.digipost.api.datatypes.types.pickup.PickupNotice;
import no.digipost.api.datatypes.types.pickup.PickupNoticeStatus;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import static co.unruly.matchers.Java8Matchers.where;
import static co.unruly.matchers.Java8Matchers.whereNot;
import static org.hamcrest.MatcherAssert.assertThat;

public class ComplementByTest {
class ComplementByTest {

@Test
public void kan_komplementere() {
void kan_komplementere() {
assertThat(PickupNotice.EXAMPLE, where(s -> s.getTypeIdentifier().canBeComplementedBy(PickupNoticeStatus.EXAMPLE)));
assertThat(PickupNotice.EXAMPLE, where(s -> s.getTypeIdentifier().canBeComplementedBy(PickupNotice.EXAMPLE)));
}

@Test
public void kan_IKKE_complementere_HVIS_target_type_ikke_komplementer() {
void kan_IKKE_complementere_HVIS_target_type_ikke_komplementer() {
assertThat(PickupNotice.EXAMPLE, whereNot(s -> s.getTypeIdentifier().canBeComplementedBy(Appointment.EXAMPLE)));
}

@Test
public void kan_IKKE_complementere_HVIS_original_ikke_komplementerer() {
void kan_IKKE_complementere_HVIS_original_ikke_komplementerer() {
assertThat(Appointment.EXAMPLE, whereNot(s -> s.getTypeIdentifier().canBeComplementedBy(PickupNoticeStatus.EXAMPLE)));
}

@Test
public void kan_IKKE_complementere_seg_selv_med_mindre_eksplisitt_definert() {
void kan_IKKE_complementere_seg_selv_med_mindre_eksplisitt_definert() {
assertThat(Appointment.EXAMPLE, whereNot(s -> s.getTypeIdentifier().canBeComplementedBy(Appointment.EXAMPLE)));
assertThat(PickupNotice.EXAMPLE, where(s -> s.getTypeIdentifier().canBeComplementedBy(PickupNotice.EXAMPLE)));
}
Expand Down
Loading

0 comments on commit 9a398ce

Please sign in to comment.