Skip to content

Commit 90c0d10

Browse files
committed
ADD SUPPORT TO JDK25 WHILE SUPPORTING TEST CASES SUPPORT IN JDK 17.
1 parent c271449 commit 90c0d10

File tree

4 files changed

+53
-1
lines changed

4 files changed

+53
-1
lines changed

pom.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,37 @@
5757
</plugin>
5858
</plugins>
5959
</build>
60+
61+
62+
<profiles>
63+
<profile>
64+
<!-- TO DISABLE, GATHERER TEST CASES IN JDK 17. -->
65+
<id>skip-jdk25-tests</id>
66+
<activation>
67+
<jdk>[1.6, 25)</jdk>
68+
</activation>
69+
<build>
70+
<plugins>
71+
<plugin>
72+
<artifactId>maven-compiler-plugin</artifactId>
73+
<executions>
74+
<execution>
75+
<id>default-testCompile</id>
76+
<phase>test-compile</phase>
77+
<goals>
78+
<goal>testCompile</goal>
79+
</goals>
80+
<configuration>
81+
<testExcludes>
82+
<testExclude>**/gatherers/*.java</testExclude>
83+
</testExcludes>
84+
</configuration>
85+
</execution>
86+
</executions>
87+
</plugin>
88+
</plugins>
89+
</build>
90+
</profile>
91+
92+
</profiles>
6093
</project>

src/test/java/com/github/streams/learn/b_advanced/gatherers/C_When to use Custom gatherer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ You should avoid using custom gatherers unless you're required to do so.
55
1. When you're not able to solve the problem using filter, map or flatMap.
66
2. When there exists no solution in the Gatherers even in latest JDK.
77
3. When you're sure that's what you need.
8+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.github.streams.practice.gatherers;
2+
3+
import org.junit.jupiter.api.Test;
4+
import org.junit.jupiter.api.condition.EnabledOnJre;
5+
import org.junit.jupiter.api.condition.JRE;
6+
7+
import java.util.stream.Gatherers;
8+
import java.util.stream.Stream;
9+
10+
class ScanTest {
11+
@Test
12+
@EnabledOnJre(JRE.JAVA_25)
13+
void scan() {
14+
Stream.of(1, 2, 3, 4, 5, 6, 7, 8)
15+
.gather(Gatherers.windowFixed(3)).toList();
16+
}
17+
}

src/test/java/module-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
requires net.datafaker;
55
requires static lombok;
66

7-
87
// LEARN
98
opens com.github.streams.practice.functional_interfaces to
109
org.junit.platform.commons;
@@ -18,6 +17,8 @@
1817
org.junit.platform.commons;
1918
opens com.github.streams.practice.b_medium_problems.employee to
2019
org.junit.platform.commons;
20+
// opens com.github.streams.practice.gatherers to
21+
// org.junit.platform.commons;
2122

2223
// PRACTICE MEDIUM
2324
opens com.github.streams.practice.b_medium_problems.strings to

0 commit comments

Comments
 (0)