Skip to content

Commit

Permalink
Removed units4j and switched to new objects4j version
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schnell committed Feb 11, 2024
1 parent bda3790 commit d6e108d
Show file tree
Hide file tree
Showing 54 changed files with 344 additions and 233 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
target
META-INF
*.log
*.iml
pom.xml.versionsBackup
28 changes: 21 additions & 7 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,19 @@

<!-- compile -->

<dependency>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-common</artifactId>
</dependency>

<dependency>
<groupId>org.fuin</groupId>
<artifactId>objects4j</artifactId>
<artifactId>utils4j</artifactId>
</dependency>

<dependency>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-core</artifactId>
</dependency>

<dependency>
Expand All @@ -42,6 +52,16 @@
<optional>true</optional>
</dependency>

<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>

<dependency>
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-api</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down Expand Up @@ -88,12 +108,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.fuin</groupId>
<artifactId>units4j</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions api/src/main/java/org/fuin/esc/api/EventId.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.Immutable;
import org.fuin.objects4j.vo.UUIDStr;
import org.fuin.objects4j.vo.UUIDStrValidator;
import org.fuin.objects4j.vo.ValueObjectWithBaseType;
import org.fuin.objects4j.core.UUIDStr;
import org.fuin.objects4j.core.UUIDStrValidator;
import org.fuin.objects4j.common.ValueObjectWithBaseType;

import java.io.Serializable;
import java.util.UUID;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.fuin.esc.api;

import jakarta.validation.constraints.NotNull;
import org.fuin.utils4j.JandexIndexFileReader;
import org.fuin.utils4j.JandexUtils;
import org.fuin.utils4j.jandex.JandexIndexFileReader;
import org.fuin.utils4j.jandex.JandexUtils;
import org.jboss.jandex.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/org/fuin/esc/api/ProjectionStreamId.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import jakarta.validation.constraints.NotNull;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.Immutable;
import org.fuin.objects4j.vo.KeyValue;
import org.fuin.objects4j.core.KeyValue;

import java.util.Collections;
import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/org/fuin/esc/api/SerializedDataType.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import jakarta.validation.constraints.NotNull;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.Immutable;
import org.fuin.objects4j.vo.AbstractStringValueObject;
import org.fuin.objects4j.core.AbstractStringValueObject;

/**
* Uniquely identifies a type of serialized data.
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/org/fuin/esc/api/SimpleStreamId.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import jakarta.validation.constraints.NotNull;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.Immutable;
import org.fuin.objects4j.vo.KeyValue;
import org.fuin.objects4j.core.KeyValue;

import java.util.Collections;
import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/org/fuin/esc/api/StreamId.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package org.fuin.esc.api;

import jakarta.validation.constraints.NotNull;
import org.fuin.objects4j.vo.KeyValue;
import org.fuin.objects4j.core.KeyValue;

import java.io.Serializable;
import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/org/fuin/esc/api/TypeName.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import jakarta.validation.constraints.NotNull;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.Immutable;
import org.fuin.objects4j.vo.AbstractStringValueObject;
import org.fuin.objects4j.core.AbstractStringValueObject;

/**
* Name that uniquely identifies a type of data.
Expand Down
31 changes: 5 additions & 26 deletions api/src/test/java/org/fuin/esc/api/BaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,48 +17,27 @@
*/
package org.fuin.esc.api;

import org.fuin.objects4j.vo.AbstractStringValueObject;
import org.fuin.objects4j.vo.ValueObjectWithBaseType;
import org.fuin.units4j.AssertCoverage;
import org.fuin.units4j.Units4JUtils;
import org.jboss.jandex.Index;
import org.jboss.jandex.Indexer;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.util.List;

import static org.fuin.units4j.JandexAssert.assertThat;

/**
* General tests for all classes.
*/
// CHECKSTYLE:OFF Test code
public class BaseTest {

@Disabled("Implement with ArchUnit!")
@Test
public final void testCoverage() {
// Make sure all classes have a test
AssertCoverage.assertEveryClassHasATest(new File("src/main/java"));
// TODO Implement!
}

@Disabled("TODO Fix failing test with new units4j version")
@Disabled("Implement with ArchUnit!")
@Test
public final void testNullability() {

// Collect all class files
final File dir = new File("target/classes");
final List<File> classFiles = Units4JUtils.findAllClasses(dir);
final Indexer indexer = new Indexer();
Units4JUtils.indexAllClasses(indexer, classFiles);
Units4JUtils.index(indexer, this.getClass().getClassLoader(), ValueObjectWithBaseType.class.getName());
Units4JUtils.index(indexer, this.getClass().getClassLoader(), AbstractStringValueObject.class.getName());
final Index index = indexer.complete();

// Verify that all methods make a statement if null is allowed or not
assertThat(index).hasNullabilityInfoOnAllMethods();

// Make sure all public/protected methods have either @Nullable or @NotNull
// TODO Implement!
}

}
Expand Down
2 changes: 1 addition & 1 deletion api/src/test/java/org/fuin/esc/api/EscApiUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
package org.fuin.esc.api;

import org.fuin.units4j.TestOmitted;
import org.fuin.utils4j.TestOmitted;

/**
* Test for {@link EscApiUtils}.
Expand Down
5 changes: 2 additions & 3 deletions api/src/test/java/org/fuin/esc/api/JsonbDeSerializerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
*/
package org.fuin.esc.api;

import org.fuin.esc.api.JsonbDeSerializer;
import org.fuin.units4j.TestOmitted;
import org.fuin.utils4j.TestOmitted;

/**
* Tests the {@link JsonbDeSerializer} class.
*/
@TestOmitted("Already tested with the other tests")
@TestOmitted("Already tested with the other tests")
public class JsonbDeSerializerTest {

// Nothing to do
Expand Down
10 changes: 2 additions & 8 deletions esgrpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
</dependency>

<dependency>
<groupId>org.fuin</groupId>
<artifactId>objects4j</artifactId>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-core</artifactId>
</dependency>

<dependency>
Expand Down Expand Up @@ -112,12 +112,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.fuin</groupId>
<artifactId>units4j</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand Down
15 changes: 7 additions & 8 deletions jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
</dependency>

<dependency>
<groupId>org.fuin</groupId>
<artifactId>objects4j</artifactId>
<groupId>org.fuin.objects4j</groupId>
<artifactId>objects4j-core</artifactId>
</dependency>

<dependency>
Expand All @@ -52,6 +52,11 @@
<optional>true</optional>
</dependency>

<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down Expand Up @@ -81,12 +86,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.fuin</groupId>
<artifactId>units4j</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.smallrye</groupId>
<artifactId>jandex</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.fuin.esc.spi.*;
import org.fuin.objects4j.common.ConstraintViolationException;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.vo.KeyValue;
import org.fuin.objects4j.core.KeyValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
2 changes: 1 addition & 1 deletion jpa/src/main/java/org/fuin/esc/jpa/JpaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.fuin.esc.spi.SerializedData;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.Immutable;
import org.fuin.objects4j.vo.ValueObject;
import org.fuin.objects4j.common.ValueObject;

import java.io.Serializable;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import jakarta.validation.constraints.NotNull;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.Immutable;
import org.fuin.objects4j.vo.KeyValue;
import org.fuin.objects4j.core.KeyValue;

import java.util.Collections;
import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion jpa/src/main/java/org/fuin/esc/jpa/SimpleJpaStreamId.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import jakarta.validation.constraints.NotNull;
import org.fuin.objects4j.common.Contract;
import org.fuin.objects4j.common.Immutable;
import org.fuin.objects4j.vo.KeyValue;
import org.fuin.objects4j.core.KeyValue;

import java.util.Collections;
import java.util.List;
Expand Down
Loading

0 comments on commit d6e108d

Please sign in to comment.