Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module-info.java, fixes #2 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
language: java
jdk: oraclejdk8
jdk: oraclejdk9
53 changes: 37 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<url>https://github.com/rzymek/opczip</url>

<scm>
<url>${project.url}</url>
<url>https://github.com/rzymek/opczip</url>
</scm>

<licenses>
Expand All @@ -32,15 +32,15 @@
</developers>

<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>8</maven.compiler.release>
</properties>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.6.0</version>
<version>5.7.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -52,13 +52,13 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.15.0</version>
<version>3.19.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.7.0-M1</version>
<version>5.7.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -70,24 +70,45 @@
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.23</version>
<version>1.29</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<version>3.0.0-M5</version>
<configuration>
<argLine>
--add-opens com.github.rzymek.opczip/com.github.rzymek.opczip=ALL-UNNAMED
--add-opens com.github.rzymek.opczip/com.github.rzymek.opczip.reader=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
<version>3.8.1</version>
<executions>
<execution>
<id>default-compile</id>
<configuration>
<release>9</release>
</configuration>
</execution>
<execution>
<id>base-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<excludes>
<exclude>module-info.java</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand All @@ -100,7 +121,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<version>3.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -113,7 +134,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -140,7 +161,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module com.github.rzymek.opczip {
exports com.github.rzymek.opczip;
exports com.github.rzymek.opczip.reader;
exports com.github.rzymek.opczip.reader.skipping;
}
36 changes: 15 additions & 21 deletions src/test/java/com/github/rzymek/opczip/reader/FileListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

Expand Down Expand Up @@ -86,26 +90,16 @@ private InputStream open(String filename) {

@Override
public Stream<? extends Arguments> provideArguments(ExtensionContext extensionContext) {
InputStream resource = FileListTest.class.getResourceAsStream(XLSX_DIR);
Scanner scanner = new Scanner(resource);
return StreamSupport.stream(
Spliterators.spliteratorUnknownSize(new Iterator<Arguments>() {
@Override
public boolean hasNext() {
boolean hasNext = scanner.hasNext();
if (!hasNext) {
scanner.close();
}
return hasNext;
}

@Override
public Arguments next() {
return Arguments.of(scanner.nextLine());
}
}, Spliterator.ORDERED),
false
);
try {
URI resource = FileListTest.class.getResource(XLSX_DIR).toURI();
zimmi marked this conversation as resolved.
Show resolved Hide resolved
Path path = Paths.get(resource);
return Files.list(path)
.map(Path::getFileName)
.map(Path::toString)
.map(Arguments::of);
} catch (URISyntaxException | IOException ex) {
throw new IllegalStateException(ex);
}
}

@FunctionalInterface
Expand Down