Skip to content

Commit a5485c9

Browse files
authored
Merge pull request #150 from AlexandreCarlton/bump-to-java-11
Bump to Java 11
2 parents 1bb63aa + c36f637 commit a5485c9

File tree

5 files changed

+24
-28
lines changed

5 files changed

+24
-28
lines changed

.github/workflows/master.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v1
1717
- uses: gradle/wrapper-validation-action@v1
18-
- name: Set up JDK 1.8
18+
- name: Set up JDK 11
1919
uses: actions/setup-java@v1
2020
with:
21-
java-version: '8.0.282'
21+
java-version: '11.0.23'
2222
- name: build test and publish
2323
run: ./gradlew assemble && ./gradlew check --info && ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -x check --info --stacktrace

.github/workflows/pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v1
1515
- uses: gradle/wrapper-validation-action@v1
16-
- name: Set up JDK 1.8
16+
- name: Set up JDK 11
1717
uses: actions/setup-java@v1
1818
with:
19-
java-version: '8.0.282'
19+
java-version: '11.0.23'
2020
- name: build and test
2121
run: ./gradlew assemble && ./gradlew check --info --stacktrace

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v1
2121
- uses: gradle/wrapper-validation-action@v1
22-
- name: Set up JDK 1.8
22+
- name: Set up JDK 11
2323
uses: actions/setup-java@v1
2424
with:
25-
java-version: '8.0.282'
25+
java-version: '11.0.23'
2626
- name: build test and publish
2727
run: ./gradlew assemble && ./gradlew check --info && ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -x check --info --stacktrace

build.gradle

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ plugins {
55
id 'java-library'
66
id 'maven-publish'
77
id 'signing'
8-
id "biz.aQute.bnd.builder" version "6.2.0"
8+
id "biz.aQute.bnd.builder" version "6.2.0"
99
id "io.github.gradle-nexus.publish-plugin" version "1.0.0"
1010
}
1111

12+
java {
13+
toolchain {
14+
languageVersion = JavaLanguageVersion.of(11)
15+
}
16+
}
1217

1318
def getDevelopmentVersion() {
1419
def output = new StringBuilder()
@@ -25,20 +30,11 @@ def getDevelopmentVersion() {
2530
version
2631
}
2732

28-
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
29-
def msg = String.format("This build must be run with java 1.8 - you are running %s - gradle finds the JDK via JAVA_HOME=%s",
30-
JavaVersion.current(), System.getenv("JAVA_HOME"))
31-
throw new IllegalStateException(msg)
32-
}
33-
34-
35-
sourceCompatibility = 1.8
36-
targetCompatibility = 1.8
3733
def slf4jVersion = '1.7.30'
3834
def releaseVersion = System.env.RELEASE_VERSION
3935
version = releaseVersion ? releaseVersion : getDevelopmentVersion()
4036
group = 'com.graphql-java'
41-
description = 'A pure Java 8 port of Facebook Dataloader'
37+
description = 'A pure Java 11 port of Facebook Dataloader'
4238

4339
gradle.buildFinished { buildResult ->
4440
println "*******************************"
@@ -117,7 +113,7 @@ publishing {
117113
asNode().children().last() + {
118114
resolveStrategy = Closure.DELEGATE_FIRST
119115
name 'java-dataloader'
120-
description 'A pure Java 8 port of Facebook Dataloader'
116+
description 'A pure Java 11 port of Facebook Dataloader'
121117
url 'https://github.com/graphql-java/java-dataloader'
122118
inceptionYear '2017'
123119

src/test/java/org/dataloader/DataLoaderTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -692,13 +692,13 @@ public void should_work_with_duplicate_keys_when_caching_enabled() throws Execut
692692
public void should_Accept_objects_with_a_complex_key() throws ExecutionException, InterruptedException {
693693
List<Collection<JsonObject>> loadCalls = new ArrayList<>();
694694
DataLoaderOptions options = newOptions().setCacheKeyFunction(getJsonObjectCacheMapFn());
695-
DataLoader<JsonObject, Integer> identityLoader = idLoader(options, loadCalls);
695+
DataLoader<JsonObject, JsonObject> identityLoader = idLoader(options, loadCalls);
696696

697697
JsonObject key1 = new JsonObject().put("id", 123);
698698
JsonObject key2 = new JsonObject().put("id", 123);
699699

700-
CompletableFuture<Integer> future1 = identityLoader.load(key1);
701-
CompletableFuture<Integer> future2 = identityLoader.load(key2);
700+
CompletableFuture<JsonObject> future1 = identityLoader.load(key1);
701+
CompletableFuture<JsonObject> future2 = identityLoader.load(key2);
702702
identityLoader.dispatch();
703703

704704
await().until(() -> future1.isDone() && future2.isDone());
@@ -713,18 +713,18 @@ public void should_Accept_objects_with_a_complex_key() throws ExecutionException
713713
public void should_Clear_objects_with_complex_key() throws ExecutionException, InterruptedException {
714714
List<Collection<JsonObject>> loadCalls = new ArrayList<>();
715715
DataLoaderOptions options = newOptions().setCacheKeyFunction(getJsonObjectCacheMapFn());
716-
DataLoader<JsonObject, Integer> identityLoader = idLoader(options, loadCalls);
716+
DataLoader<JsonObject, JsonObject> identityLoader = idLoader(options, loadCalls);
717717

718718
JsonObject key1 = new JsonObject().put("id", 123);
719719
JsonObject key2 = new JsonObject().put("id", 123);
720720

721-
CompletableFuture<Integer> future1 = identityLoader.load(key1);
721+
CompletableFuture<JsonObject> future1 = identityLoader.load(key1);
722722
identityLoader.dispatch();
723723

724724
await().until(future1::isDone);
725725
identityLoader.clear(key2); // clear equivalent object key
726726

727-
CompletableFuture<Integer> future2 = identityLoader.load(key1);
727+
CompletableFuture<JsonObject> future2 = identityLoader.load(key1);
728728
identityLoader.dispatch();
729729

730730
await().until(future2::isDone);
@@ -737,22 +737,22 @@ public void should_Clear_objects_with_complex_key() throws ExecutionException, I
737737
public void should_Accept_objects_with_different_order_of_keys() throws ExecutionException, InterruptedException {
738738
List<Collection<JsonObject>> loadCalls = new ArrayList<>();
739739
DataLoaderOptions options = newOptions().setCacheKeyFunction(getJsonObjectCacheMapFn());
740-
DataLoader<JsonObject, Integer> identityLoader = idLoader(options, loadCalls);
740+
DataLoader<JsonObject, JsonObject> identityLoader = idLoader(options, loadCalls);
741741

742742
JsonObject key1 = new JsonObject().put("a", 123).put("b", 321);
743743
JsonObject key2 = new JsonObject().put("b", 321).put("a", 123);
744744

745745
// Fetches as expected
746746

747-
CompletableFuture<Integer> future1 = identityLoader.load(key1);
748-
CompletableFuture<Integer> future2 = identityLoader.load(key2);
747+
CompletableFuture<JsonObject> future1 = identityLoader.load(key1);
748+
CompletableFuture<JsonObject> future2 = identityLoader.load(key2);
749749
identityLoader.dispatch();
750750

751751
await().until(() -> future1.isDone() && future2.isDone());
752752
assertThat(loadCalls, equalTo(singletonList(singletonList(key1))));
753753
assertThat(loadCalls.size(), equalTo(1));
754754
assertThat(future1.get(), equalTo(key1));
755-
assertThat(future2.get(), equalTo(key1));
755+
assertThat(future2.get(), equalTo(key2));
756756
}
757757

758758
@Test

0 commit comments

Comments
 (0)