Skip to content

Commit

Permalink
Renamed poms
Browse files Browse the repository at this point in the history
  - Deactivated test for #3 for now as it is not working reliably.
  • Loading branch information
bmarwell committed May 20, 2019
1 parent 6edfaf4 commit 83f9b88
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 9 deletions.
3 changes: 2 additions & 1 deletion compressedint/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>compressedint</artifactId>
<artifactId>zchunk-compressedint</artifactId>
<name>compressedint</name>

<dependencies>
<!-- 3rd party -->
Expand Down
5 changes: 3 additions & 2 deletions compression/compression-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>compression-api</artifactId>
<artifactId>zchunk-compression-api</artifactId>
<name>compressoin/compresion-api</name>

<dependencies>
<dependency>
<groupId>io.github.zchunk</groupId>
<artifactId>compressedint</artifactId>
<artifactId>zchunk-compressedint</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package io.github.zchunk.compression.api;

import static java.util.Collections.unmodifiableMap;
import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toMap;

Expand All @@ -42,6 +43,10 @@ private CompressionAlgorithmFactory() {
// util class.
}

public static Map<Long, Class<CompressionAlgorithm>> getKnownAlgorithms() {
return unmodifiableMap(getTypeMappings());
}

private static Map.@Nullable Entry<Long, Class<CompressionAlgorithm>> mapEntryOrNull(final Class<CompressionAlgorithm> clazz) {
return ReflectionUtil.newInstance(clazz)
.map(compInstance -> new AbstractMap.SimpleEntry<>(compInstance.getCompressionTypeValue().getUnsignedLongValue(), clazz))
Expand Down
5 changes: 3 additions & 2 deletions compression/compression-none/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>zchunk-compression-none</artifactId>
<name>compression/compresion-none</name>

<dependencies>
<dependency>
<groupId>io.github.zchunk</groupId>
<artifactId>compression-api</artifactId>
<artifactId>zchunk-compression-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>


</project>
</project>
5 changes: 3 additions & 2 deletions compression/compression-zstd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>zchunk-compression-zstd</artifactId>
<name>compression/compresion-zstd</name>

<dependencies>
<dependency>
<groupId>io.github.zchunk</groupId>
<artifactId>compression-api</artifactId>
<artifactId>zchunk-compression-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>

Expand All @@ -30,4 +31,4 @@
</dependencies>


</project>
</project>
5 changes: 3 additions & 2 deletions fileformat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@
<modelVersion>4.0.0</modelVersion>

<artifactId>zchunk-fileformat</artifactId>
<name>fileformat</name>

<dependencies>
<!-- reactor modules -->
<dependency>
<groupId>io.github.zchunk</groupId>
<artifactId>compressedint</artifactId>
<artifactId>zchunk-compressedint</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>

<!-- reactor modules -->
<dependency>
<groupId>io.github.zchunk</groupId>
<artifactId>compression-api</artifactId>
<artifactId>zchunk-compression-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
import io.github.zchunk.compression.api.CompressionAlgorithm;
import io.github.zchunk.compression.api.CompressionAlgorithmFactory;
import io.github.zchunk.compression.api.err.DecompressionException;
import java.util.Map;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

@Disabled(value = "does not work with test-only dependencies. "
+ "Move into separate test module or create zchunk-all / zchunk-lib.")
public class ZChunkCompressionSupportTest {

@Test
public void testCompressionImplementations() {
final Map<Long, Class<CompressionAlgorithm>> algorithms = CompressionAlgorithmFactory.getKnownAlgorithms();
Assertions.assertTrue(algorithms.size() >= 3);
}

@Test
public void testCompressionSupport_unknown() {
final CompressionAlgorithm compressionAlgorithm = CompressionAlgorithmFactory.forType(4);
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<version>1.0.0-SNAPSHOT</version>

<packaging>pom</packaging>
<name>parent</name>

<modules>
<module>compressedint</module>
Expand Down

0 comments on commit 83f9b88

Please # to comment.