Skip to content

Commit

Permalink
chore: modified pom.xml not to skip jacoco execution, etc. (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
sttk authored Nov 12, 2023
2 parents de5ba11 + 9f91979 commit f25b6ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
22 changes: 13 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,31 @@
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!--
For changing environment variables in unit tests.
This setting is for maven-surefire-plugin but moved here for jacoco.
See: https://www.eclemma.org/jacoco/trunk/doc/prepare-agent-mojo.html
-->
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
</properties>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.3</version>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.3</version>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.9.3</version>
<version>1.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -93,10 +99,6 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<configuration>
<!-- for changing environment variables in unit tests. -->
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
</configuration>
</plugin>
</plugins>
</build>
Expand Down Expand Up @@ -132,9 +134,11 @@
</executions>
<configuration>
<fallback>false</fallback>
<!-- for changing environment variables in unit tests. -->
<!-- For changing environment variables in unit tests. -->
<buildArgs>
-J--add-opens=java.base/java.lang=ALL-UNNAMED
<buildArg>-J--add-opens=java.base/java.lang=ALL-UNNAMED</buildArg>
<buildArg>--initialize-at-build-time=org.junit.platform.launcher.core.LauncherConfig</buildArg>
<buildArg>--initialize-at-build-time=org.junit.jupiter.engine.config.InstantiatingConfigurationParameterConverter</buildArg>
</buildArgs>
</configuration>
</plugin>
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/github/sttk/sabi/errs/ErrHandlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void should_notify_that_errs_are_created() {
err.getReason().toString(), occ.getFile(), occ.getLine()));
});
Err.addAsyncHandler((err, occ) -> {
try { Thread.sleep(20); } catch (Exception e) {}
try { Thread.sleep(50); } catch (Exception e) {}
asyncLogger.add(String.format("4. %s (%s:%d)",
err.getReason().toString(), occ.getFile(), occ.getLine()));
});
Expand All @@ -60,7 +60,7 @@ public void should_notify_that_errs_are_created() {
assertThat(e.getReason()).isInstanceOf(FailToDoSomething.class);

try {
Thread.sleep(100);
Thread.sleep(200);
} catch (Exception e2) {}

assertThat(syncLogger).hasSize(2);
Expand Down

0 comments on commit f25b6ec

Please sign in to comment.