Commit 62f1ad5 1 parent cc3bc17 commit 62f1ad5 Copy full SHA for 62f1ad5
File tree 1 file changed +35
-1
lines changed
1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -49,4 +49,38 @@ this article:
49
49
50
50
https://sormuras.github.io/blog/2018-09-11-testing-in-the-modular-world.html#white-box-modular-testing-with-extra-java-command-line-options
51
51
52
- TODO: examples of adding exceptions (copy from R5 or OTP2)
52
+ In Gradle this might look like:
53
+ ``` Groovy
54
+ test {
55
+ useJUnitPlatform()
56
+ jvmArgs = ['--add-opens=java.base/java.io=ALL-UNNAMED',
57
+ '--add-opens=java.base/java.time=ALL-UNNAMED',
58
+ '--add-opens=java.base/java.time.zone=ALL-UNNAMED',
59
+ '--add-opens=java.base/java.lang=ALL-UNNAMED']
60
+ }
61
+ ```
62
+
63
+ In Maven:
64
+ ``` xml
65
+ <plugin >
66
+ <groupId >org.apache.maven.plugins</groupId >
67
+ <artifactId >maven-surefire-plugin</artifactId >
68
+ <version >3.0.0-M7</version >
69
+ <configuration >
70
+ <!-- we have to fork the JVM during tests so that the argLine is passed along -->
71
+ <forkCount >3</forkCount >
72
+ <!-- enable the restricted reflection under Java 11 so that the ObjectDiffer works
73
+ the @{argLine} part is there to allow jacoco to insert its arguments as well
74
+ -->
75
+ <argLine >
76
+ @{argLine}
77
+ -Xmx2G
78
+ -Dfile.encoding=UTF-8
79
+ --add-opens java.base/java.io=ALL-UNNAMED
80
+ --add-opens java.base/java.lang=ALL-UNNAMED
81
+ --add-opens java.base/java.math=ALL-UNNAMED
82
+ --add-opens java.base/java.net=ALL-UNNAMED
83
+ </argLine >
84
+ </configuration >
85
+ </plugin >
86
+ ```
You can’t perform that action at this time.
0 commit comments