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

feat: Update and adapt to GraalVM for JDK 23 #2069

Merged
merged 91 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
dceff5b
build(deps): update dependency com.google.cloud:native-image-shared-c…
renovate-bot Jan 25, 2025
e2c988e
disable testDisconnectShouldNotWaitToReadResponse for JDK >= 23
diegomarquezp Jan 28, 2025
d355740
fix assumption code
diegomarquezp Jan 28, 2025
2fbd4cb
fix assumption ii
diegomarquezp Jan 28, 2025
e525298
Revert "fix assumption ii"
diegomarquezp Jan 28, 2025
42958ef
Revert "fix assumption code"
diegomarquezp Jan 28, 2025
a74d12c
Revert "disable testDisconnectShouldNotWaitToReadResponse for JDK >= 23"
diegomarquezp Jan 28, 2025
e648262
Merge branch 'main' into renovate/com.google.cloud-native-image-share…
diegomarquezp Jan 28, 2025
7599092
chore: use JUnit4 in tests
diegomarquezp Jan 31, 2025
84f3f4f
use at least 1 Junit38 test
diegomarquezp Jan 31, 2025
c9eb627
Revert "use at least 1 Junit38 test"
diegomarquezp Jan 31, 2025
74d8487
fix net http response tests
diegomarquezp Jan 31, 2025
dbdba31
annotate tests with @RunWith(JUnit4.class)
diegomarquezp Feb 3, 2025
2ba8ac0
initialize static members in static block
diegomarquezp Feb 4, 2025
22e0f17
use static blocks to initialize test classes
diegomarquezp Feb 4, 2025
4c4d719
format
diegomarquezp Feb 4, 2025
905c8f3
set up class initialization
diegomarquezp Feb 4, 2025
d78c642
convert google-http-client-test to JUnit4
diegomarquezp Feb 4, 2025
f3b785e
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 4, 2025
e99ea38
use java.nio for tests
diegomarquezp Feb 5, 2025
9faa908
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 5, 2025
e7bd4e1
run with JUnit 4 explicitly
diegomarquezp Feb 5, 2025
3121f60
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 5, 2025
73ebee2
use static block
diegomarquezp Feb 5, 2025
8205011
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 5, 2025
06acc4a
Revert "use static block"
diegomarquezp Feb 5, 2025
c388a04
Reapply "use static block"
diegomarquezp Feb 5, 2025
6b0a708
initialize IS_WINDOWS at build time
diegomarquezp Feb 5, 2025
9455b69
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 5, 2025
c70dbd1
prevent cryptic message when initializing FileDataStoreFactory
diegomarquezp Feb 5, 2025
3b27435
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 5, 2025
4e507a0
fix static initialization in AbstractDatastoreFactory
diegomarquezp Feb 5, 2025
3f6483d
test no IS_WINDOWS
diegomarquezp Feb 5, 2025
e646c47
Revert "test no IS_WINDOWS"
diegomarquezp Feb 5, 2025
70b2b15
ruling out logger initialization
diegomarquezp Feb 5, 2025
0d0f4d7
add test output
diegomarquezp Feb 5, 2025
937aabf
safe initialization of ID_PATTERN
diegomarquezp Feb 5, 2025
c9fb4bf
remove provided scope depdendency
diegomarquezp Feb 5, 2025
7b5d600
convert appengine transport to JUnit 4
diegomarquezp Feb 5, 2025
25c6523
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 5, 2025
0b346a1
add clirr differences
diegomarquezp Feb 6, 2025
c5f76a1
include appengine classes in runtime
diegomarquezp Feb 6, 2025
7e35ed1
add native config
diegomarquezp Feb 6, 2025
8e90738
add reflect-config for appengine
diegomarquezp Feb 6, 2025
bf74443
use JUnit4 in GSON tests
diegomarquezp Feb 6, 2025
818da9a
fix clirr
diegomarquezp Feb 6, 2025
d6f991c
port abstract json parser test to JUnit4
diegomarquezp Feb 6, 2025
1322e42
remove unused imports
diegomarquezp Feb 6, 2025
3b8c44c
update clirr again
diegomarquezp Feb 6, 2025
bf0c6b4
add native config to gson module
diegomarquezp Feb 6, 2025
411304b
convert jackson module to JUnit4
diegomarquezp Feb 6, 2025
fff197f
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 6, 2025
dfb48fe
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 6, 2025
f787ea4
make jackson factory instantiation native friendly
diegomarquezp Feb 6, 2025
505f931
config test-only build-time initialization
diegomarquezp Feb 6, 2025
94aab38
adapt protocol buffers module to JUnit 4
diegomarquezp Feb 6, 2025
9ad8269
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 6, 2025
35543d3
initialize test classes at test time
diegomarquezp Feb 6, 2025
715fc0d
convert xml module to JUnit4
diegomarquezp Feb 6, 2025
de7a0b5
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 6, 2025
dd335e8
add test time initialization entries to xml module
diegomarquezp Feb 6, 2025
6209970
format
diegomarquezp Feb 6, 2025
3d4c01f
restore debug setup
diegomarquezp Feb 6, 2025
448d178
Merge branch 'renovate/com.google.cloud-native-image-shared-config-1.…
diegomarquezp Feb 6, 2025
17665a1
add junit test time initialization flags
diegomarquezp Feb 6, 2025
b68b0a7
add junit to gson deps
diegomarquezp Feb 6, 2025
4929c9c
Merge branch 'support-graal-jdk-23-ii' of https://github.com/googleap…
diegomarquezp Feb 6, 2025
f3cff46
add junit test-scoped dependency to jackson2 module
diegomarquezp Feb 6, 2025
048a340
add jackson factory to class initialization
diegomarquezp Feb 6, 2025
a3c6923
Merge branch 'support-graal-jdk-23-ii' of https://github.com/googleap…
diegomarquezp Feb 6, 2025
e75875b
add app engine feature
diegomarquezp Feb 6, 2025
eeb9352
try setup time feature registration
diegomarquezp Feb 6, 2025
32e38d6
Revert "try setup time feature registration"
diegomarquezp Feb 6, 2025
700b79d
Revert "add app engine feature"
diegomarquezp Feb 6, 2025
5ca0f1b
add app engine core lib for testing
diegomarquezp Feb 6, 2025
50034e7
add test-scoped dep in test module
diegomarquezp Feb 6, 2025
2407435
use -Pnative-deps
diegomarquezp Feb 6, 2025
8382068
add conflicting dep in native-deps profile for appengine
diegomarquezp Feb 6, 2025
d5b3946
include appengine in graalvm tests
diegomarquezp Feb 6, 2025
debfc15
restore static blocks in google-http-client
diegomarquezp Feb 6, 2025
245c570
Merge branch 'support-graal-jdk-23-ii' of https://github.com/googleap…
diegomarquezp Feb 6, 2025
ce1ef7a
restore static blocks in gson module
diegomarquezp Feb 6, 2025
4c29e49
restore static blocks in jackson
diegomarquezp Feb 6, 2025
da3f2c6
restore static blocks in protobuf
diegomarquezp Feb 6, 2025
03dd1b2
format
diegomarquezp Feb 6, 2025
c7bfc68
restore static initailization in xml module
diegomarquezp Feb 6, 2025
960fcbd
Merge branch 'main' into support-graal-jdk-23-ii
diegomarquezp Feb 6, 2025
f357d9a
restore static block in jackson module
diegomarquezp Feb 6, 2025
e600d33
format
diegomarquezp Feb 6, 2025
cfa4c27
Merge branch 'support-graal-jdk-23-ii' of https://github.com/googleap…
diegomarquezp Feb 6, 2025
ca885f6
remove app engine from test
diegomarquezp Feb 6, 2025
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 .kokoro/presubmit/graalvm-native-a.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ env_vars: {
}

container_properties {
docker_image: "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:1.13.0"
docker_image: "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_a:1.14.0"
}
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native-b.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ env_vars: {
}

container_properties {
docker_image: "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:1.13.0"
docker_image: "us-docker.pkg.dev/java-graalvm-ci-prod/graalvm-integration-testing/graalvm_b:1.14.0"
}
11 changes: 11 additions & 0 deletions google-http-client-appengine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,15 @@
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>native-deps</id>
<dependencies>
<dependency>
<groupId>com.google.appengine</groupId>
<artifactId>appengine-api-1.0-sdk</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"name": "com.google.apphosting.api.DatastorePb$DeleteRequest",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "com.google.apphosting.api.DatastorePb$GetRequest",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "com.google.apphosting.api.DatastorePb$NextRequest",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "com.google.apphosting.api.DatastorePb$PutRequest",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "com.google.apphosting.api.DatastorePb$Query",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@
package com.google.api.client.extensions.appengine.http;

import junit.framework.TestCase;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
* Tests {@link UrlFetchTransport}.
*
* @author Tony Aiuto
*/
@RunWith(JUnit4.class)
public class UrlFetchTransportTest extends TestCase {

@Test
public void test() {
new UrlFetchTransport();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Args=--initialize-at-build-time=org.junit.runner.RunWith,java.lang.annotation.Annotation \
5 changes: 5 additions & 0 deletions google-http-client-gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,10 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

package com.google.api.client.json.gson;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import com.google.api.client.json.GenericJson;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonObjectParser;
Expand All @@ -25,6 +29,7 @@
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import org.junit.Test;

/**
* Tests {@link GsonFactory}.
Expand Down Expand Up @@ -58,21 +63,19 @@ public class GsonFactoryTest extends AbstractJsonFactoryTest {
+ GSON_LINE_SEPARATOR
+ "}";

public GsonFactoryTest(String name) {
super(name);
}

@Override
protected JsonFactory newFactory() {
return new GsonFactory();
}

@Test
public final void testToPrettyString_entry() throws Exception {
Entry entry = new Entry();
entry.title = "foo";
assertEquals(JSON_ENTRY_PRETTY, newFactory().toPrettyString(entry));
}

@Test
public final void testToPrettyString_Feed() throws Exception {
Feed feed = new Feed();
Entry entryFoo = new Entry();
Expand All @@ -85,11 +88,13 @@ public final void testToPrettyString_Feed() throws Exception {
assertEquals(JSON_FEED_PRETTY, newFactory().toPrettyString(feed));
}

@Test
public final void testParse_directValue() throws IOException {
JsonParser parser = newFactory().createJsonParser("123");
assertEquals(123, parser.parse(Integer.class, true));
}

@Test
public final void testGetByteValue() throws IOException {
JsonParser parser = newFactory().createJsonParser("123");

Expand All @@ -101,6 +106,7 @@ public final void testGetByteValue() throws IOException {
}
}

@Test
public final void testReaderLeniency_lenient() throws IOException {
JsonObjectParser parser =
new JsonObjectParser(GsonFactory.builder().setReadLeniency(true).build());
Expand All @@ -113,6 +119,7 @@ public final void testReaderLeniency_lenient() throws IOException {
assertEquals("foo", json.get("title"));
}

@Test
public final void testReaderLeniency_not_lenient_by_default() throws IOException {
JsonObjectParser parser = new JsonObjectParser(GsonFactory.getDefaultInstance());

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Args=--initialize-at-build-time=org.junit.runner.RunWith,java.lang.annotation.Annotation
5 changes: 5 additions & 0 deletions google-http-client-jackson2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,10 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@

package com.google.api.client.json.jackson2;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;

import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.JsonParser;
import com.google.api.client.test.json.AbstractJsonFactoryTest;
import com.google.api.client.util.StringUtils;
import java.io.IOException;
import java.util.ArrayList;
import org.junit.Test;

/**
* Tests {@link JacksonFactory}.
Expand All @@ -45,21 +50,19 @@ public class JacksonFactoryTest extends AbstractJsonFactoryTest {
+ StringUtils.LINE_SEPARATOR
+ "}";

public JacksonFactoryTest(String name) {
super(name);
}

@Override
protected JsonFactory newFactory() {
return new JacksonFactory();
}

@Test
public final void testToPrettyString_entry() throws Exception {
Entry entry = new Entry();
entry.title = "foo";
assertEquals(JSON_ENTRY_PRETTY, newFactory().toPrettyString(entry));
}

@Test
public final void testToPrettyString_Feed() throws Exception {
Feed feed = new Feed();
Entry entryFoo = new Entry();
Expand All @@ -72,11 +75,13 @@ public final void testToPrettyString_Feed() throws Exception {
assertEquals(JSON_FEED_PRETTY, newFactory().toPrettyString(feed));
}

@Test
public final void testParse_directValue() throws Exception {
JsonParser parser = newFactory().createJsonParser("123");
assertEquals(123, parser.parse(Integer.class, true));
}

@Test
public final void testGetByteValue() throws IOException {
JsonParser parser = newFactory().createJsonParser("123");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Args=--initialize-at-build-time=com.google.api.client.json.jackson2.JacksonFactoryTest \
--initialize-at-build-time=com.google.api.client.json.jackson2.JacksonGeneratorTest \
--initialize-at-build-time=com.fasterxml.jackson.core.io.SerializedString \
--initialize-at-build-time=com.fasterxml.jackson.core.io.CharTypes \
--initialize-at-build-time=com.fasterxml.jackson.core.JsonFactory \
--initialize-at-build-time=com.fasterxml.jackson.core.io.JsonStringEncoder \
--initialize-at-build-time=com.google.api.client.util.StringUtils
--initialize-at-build-time=com.google.api.client.json.jackson2.JacksonFactory \
--initialize-at-build-time=com.google.api.client.util.StringUtils \
--initialize-at-build-time=com.fasterxml.jackson.core \
--initialize-at-build-time=org.junit.runner.RunWith,java.lang.annotation.Annotation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Args=--initialize-at-build-time=org.junit.runner.RunWith,java.lang.annotation.Annotation
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@

package com.google.api.client.protobuf;

import static org.junit.Assert.assertEquals;

import java.io.ByteArrayInputStream;
import junit.framework.TestCase;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/**
* Tests {@link ProtocolBuffers}.
*
* @author Yaniv Inbar
*/
public class ProtocolBuffersTest extends TestCase {
@RunWith(JUnit4.class)
public class ProtocolBuffersTest {

@Test
public void testParseAndClose() throws Exception {
SimpleProto.TestMessage mockResponse =
SimpleProto.TestMessage.newBuilder()
Expand Down
75 changes: 75 additions & 0 deletions google-http-client-test/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
<!--
[ERROR] 4001: com.google.api.client.test.json.AbstractJsonFactoryTest: Removed junit.framework.Test from the set of implemented interfaces
[ERROR] 5001: com.google.api.client.test.json.AbstractJsonFactoryTest: Removed junit.framework.Assert from the list of superclasses
[ERROR] 5001: com.google.api.client.test.json.AbstractJsonFactoryTest: Removed junit.framework.TestCase from the list of superclasses
[WARNING] 6002: com.google.api.client.test.json.AbstractJsonFactoryTest: Value of field BOOLEAN_TYPE_EMPTY is no longer a compile-time constant
[WARNING] 6002: com.google.api.client.test.json.AbstractJsonFactoryTest: Value of field BOOLEAN_TYPE_EMPTY_OUTPUT is no longer a compile-time constant
[WARNING] 6002: com.google.api.client.test.json.AbstractJsonFactoryTest: Value of field BOOLEAN_TYPE_FALSE is no longer a compile-time constant
[WARNING] 6002: com.google.api.client.test.json.AbstractJsonFactoryTest: Value of field BOOLEAN_TYPE_NULL is no longer a compile-time constant
[WARNING] 6002: com.google.api.client.test.json.AbstractJsonFactoryTest: Value of field BOOLEAN_TYPE_NULL_OUTPUT is no longer a compile-time constant
[WARNING] 6002: com.google.api.client.test.json.AbstractJsonFactoryTest: Value of field BOOLEAN_TYPE_TRUE is no longer a compile-time constant
[WARNING] 6002: com.google.api.client.test.json.AbstractJsonFactoryTest: Value of field BOOLEAN_TYPE_WRONG is no longer a compile-time constant
[ERROR] 7004: com.google.api.client.test.json.AbstractJsonFactoryTest: In method 'public AbstractJsonFactoryTest(java.lang.String)' the number of arguments has changed
[ERROR] 4001: com.google.api.client.test.json.AbstractJsonGeneratorTest: Removed junit.framework.Test from the set of implemented interfaces
[ERROR] 5001: com.google.api.client.test.json.AbstractJsonGeneratorTest: Removed junit.framework.Assert from the list of superclasses
[ERROR] 5001: com.google.api.client.test.json.AbstractJsonGeneratorTest: Removed junit.framework.TestCase from the list of superclasses
[ERROR] 4001: com.google.api.client.test.json.AbstractJsonParserTest: Removed junit.framework.Test from the set of implemented interfaces [ERROR] 5001: com.google.api.client.test.json.AbstractJsonParserTest: Removed junit.framework.Assert from the list of superclasses [ERROR] 5001: com.google.api.client.test.json.AbstractJsonParserTest: Removed junit.framework.TestCase from the list of superclasses
-->
<differences>
<difference>
<!-- migration to JUnit 4 -->
<differenceType>4001</differenceType>
<className>com/google/api/client/test/util/store/AbstractDataStoreFactoryTest</className>
<to>junit/framework/Test</to>
</difference>
<difference>
<!-- migration to JUnit 4 -->
<differenceType>4001</differenceType>
<className>com/google/api/client/test/json/AbstractJsonFactoryTest</className>
<to>junit/framework/Test</to>
</difference>
<difference>
<!-- migration to JUnit 4 -->
<differenceType>4001</differenceType>
<className>com/google/api/client/test/json/AbstractJsonGeneratorTest</className>
<to>junit/framework/Test</to>
</difference>
<difference>
<!-- migration to JUnit 4 -->
<differenceType>4001</differenceType>
<className>com/google/api/client/test/json/AbstractJsonParserTest</className>
<to>junit/framework/Test</to>
</difference>
<difference>
<!-- migration to JUnit 4 -->
<differenceType>5001</differenceType>
<className>com/google/api/client/test/util/store/AbstractDataStoreFactoryTest</className>
<to>junit/framework/*</to>
</difference>
<difference>
<!-- migration to JUnit 4 -->
<differenceType>5001</differenceType>
<className>com/google/api/client/test/json/AbstractJsonFactoryTest</className>
<to>junit/framework/*</to>
</difference>
<difference>
<!-- migration to JUnit 4 -->
<differenceType>5001</differenceType>
<className>com/google/api/client/test/json/AbstractJsonGeneratorTest</className>
<to>junit/framework/*</to>
</difference>
<difference>
<!-- migration to JUnit 4 -->
<differenceType>5001</differenceType>
<className>com/google/api/client/test/json/AbstractJsonParserTest</className>
<to>junit/framework/*</to>
</difference>
<difference>
<!-- migration to JUnit 4 -->
<differenceType>7004</differenceType>
<className>com/google/api/client/test/json/AbstractJsonFactoryTest</className>
<method>*</method>
</difference>
</differences>
Loading