Skip to content

Commit 93a87b0

Browse files
authored
Merge pull request #373 from alex268/fix_jdk21
Fix JDK 21 build
2 parents 4d2ad34 + e2fa0ef commit 93a87b0

File tree

8 files changed

+146
-19
lines changed

8 files changed

+146
-19
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
java: [ '8', '11', '17']
19+
java: [ '8', '11', '17', '21']
2020

2121
env:
2222
MAVEN_ARGS: --batch-mode --update-snapshots -Dstyle.color=always -DYDB_DOCKER_ISOLATION=true

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575

7676
strategy:
7777
matrix:
78-
java: [ '8', '11', '17']
78+
java: [ '8', '11', '17', '21']
7979

8080
env:
8181
MAVEN_ARGS: --batch-mode -Dstyle.color=always -DYDB_DOCKER_ISOLATION=true

auth-providers/oauth2-provider/pom.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
<dependency>
5555
<groupId>org.mockito</groupId>
56-
<artifactId>mockito-inline</artifactId>
56+
<artifactId>mockito-core</artifactId>
5757
<scope>test</scope>
5858
</dependency>
5959

@@ -82,4 +82,26 @@
8282
<version>1.78.1</version>
8383
</dependency>
8484
</dependencies>
85+
86+
<profiles>
87+
<profile>
88+
<id>jdk8-build</id>
89+
<activation>
90+
<jdk>1.8</jdk>
91+
</activation>
92+
93+
<properties>
94+
<!-- Downgrade Mockito to 4 version -->
95+
<mockito.version>4.11.0</mockito.version>
96+
</properties>
97+
98+
<dependencies>
99+
<dependency>
100+
<groupId>org.mockito</groupId>
101+
<artifactId>mockito-inline</artifactId>
102+
<version>${mockito.version}</version>
103+
</dependency>
104+
</dependencies>
105+
</profile>
106+
</profiles>
85107
</project>

coordination/pom.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,30 @@
3737
</dependency>
3838
<dependency>
3939
<groupId>org.mockito</groupId>
40-
<artifactId>mockito-inline</artifactId>
40+
<artifactId>mockito-core</artifactId>
4141
<scope>test</scope>
4242
</dependency>
4343
</dependencies>
44+
45+
<profiles>
46+
<profile>
47+
<id>jdk8-build</id>
48+
<activation>
49+
<jdk>1.8</jdk>
50+
</activation>
51+
52+
<properties>
53+
<!-- Downgrade Mockito to 4 version -->
54+
<mockito.version>4.11.0</mockito.version>
55+
</properties>
56+
57+
<dependencies>
58+
<dependency>
59+
<groupId>org.mockito</groupId>
60+
<artifactId>mockito-inline</artifactId>
61+
<version>${mockito.version}</version>
62+
</dependency>
63+
</dependencies>
64+
</profile>
65+
</profiles>
4466
</project>

core/pom.xml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
<dependency>
5858
<groupId>org.mockito</groupId>
59-
<artifactId>mockito-inline</artifactId>
59+
<artifactId>mockito-core</artifactId>
6060
<scope>test</scope>
6161
</dependency>
6262

@@ -95,18 +95,30 @@
9595

9696
<profiles>
9797
<profile>
98-
<!-- https://github.com/grpc/grpc-java/blob/master/SECURITY.md#tls-on-non-android -->
99-
<id>jdk8-netty-ssl</id>
98+
<id>jdk8-build</id>
10099
<activation>
101100
<jdk>1.8</jdk>
102101
</activation>
102+
103+
<properties>
104+
<!-- Downgrade Mockito to 4 version -->
105+
<mockito.version>4.11.0</mockito.version>
106+
</properties>
107+
103108
<dependencies>
109+
<!-- https://github.com/grpc/grpc-java/blob/master/SECURITY.md#tls-on-non-android -->
104110
<dependency>
105111
<groupId>io.netty</groupId>
106112
<artifactId>netty-tcnative-boringssl-static</artifactId>
107113
<!-- Depends of grpc-netty version -->
108114
<version>2.0.61.Final</version>
109115
</dependency>
116+
117+
<dependency>
118+
<groupId>org.mockito</groupId>
119+
<artifactId>mockito-inline</artifactId>
120+
<version>${mockito.version}</version>
121+
</dependency>
110122
</dependencies>
111123
</profile>
112124
</profiles>

pom.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<junit5.version>5.9.3</junit5.version>
4040
<log4j2.version>2.17.2</log4j2.version>
4141
<gson.version>2.8.9</gson.version>
42-
<mockito.version>4.11.0</mockito.version>
42+
<mockito.version>5.11.0</mockito.version>
4343
<testcontainers.version>1.19.3</testcontainers.version>
4444
</properties>
4545

@@ -108,7 +108,7 @@
108108

109109
<dependency>
110110
<groupId>org.mockito</groupId>
111-
<artifactId>mockito-inline</artifactId>
111+
<artifactId>mockito-core</artifactId>
112112
<version>${mockito.version}</version>
113113
</dependency>
114114
<dependency>
@@ -124,7 +124,7 @@
124124
<plugin>
125125
<groupId>org.apache.maven.plugins</groupId>
126126
<artifactId>maven-dependency-plugin</artifactId>
127-
<version>3.5.0</version>
127+
<version>3.8.1</version>
128128
</plugin>
129129
<plugin>
130130
<groupId>org.apache.maven.plugins</groupId>
@@ -137,7 +137,7 @@
137137
<plugin>
138138
<groupId>org.apache.maven.plugins</groupId>
139139
<artifactId>maven-compiler-plugin</artifactId>
140-
<version>3.11.0</version>
140+
<version>3.13.0</version>
141141
<configuration>
142142
<target>1.8</target>
143143
<source>1.8</source>
@@ -152,7 +152,7 @@
152152
<plugin>
153153
<groupId>org.apache.maven.plugins</groupId>
154154
<artifactId>maven-source-plugin</artifactId>
155-
<version>3.2.1</version>
155+
<version>3.3.1</version>
156156
<executions>
157157
<execution>
158158
<id>attach-sources</id>
@@ -165,7 +165,7 @@
165165
<plugin>
166166
<groupId>org.apache.maven.plugins</groupId>
167167
<artifactId>maven-surefire-plugin</artifactId>
168-
<version>3.1.0</version>
168+
<version>3.5.2</version>
169169
<configuration>
170170
<environmentVariables>
171171
<TESTCONTAINERS_REUSE_ENABLE>true</TESTCONTAINERS_REUSE_ENABLE>
@@ -175,7 +175,7 @@
175175
<plugin>
176176
<groupId>org.apache.maven.plugins</groupId>
177177
<artifactId>maven-checkstyle-plugin</artifactId>
178-
<version>3.2.2</version>
178+
<version>3.6.0</version>
179179
<configuration>
180180
<configLocation>config/ydb.checkstyle.xml</configLocation>
181181
<suppressionsFileExpression>config/ydb.suppressions.xml</suppressionsFileExpression>
@@ -193,7 +193,7 @@
193193
<plugin>
194194
<groupId>org.apache.maven.plugins</groupId>
195195
<artifactId>maven-javadoc-plugin</artifactId>
196-
<version>3.5.0</version>
196+
<version>3.11.2</version>
197197
<configuration>
198198
<source>8</source>
199199
</configuration>
@@ -211,7 +211,7 @@
211211
<plugin>
212212
<groupId>org.jacoco</groupId>
213213
<artifactId>jacoco-maven-plugin</artifactId>
214-
<version>0.8.10</version>
214+
<version>0.8.12</version>
215215
<executions>
216216
<execution>
217217
<id>jacoco-prepare-agent</id>
@@ -268,7 +268,7 @@
268268
<plugin>
269269
<groupId>org.apache.maven.plugins</groupId>
270270
<artifactId>maven-gpg-plugin</artifactId>
271-
<version>1.6</version>
271+
<version>3.2.7</version>
272272
<executions>
273273
<execution>
274274
<id>sign-artifacts</id>
@@ -288,7 +288,7 @@
288288
<plugin>
289289
<groupId>org.sonatype.plugins</groupId>
290290
<artifactId>nexus-staging-maven-plugin</artifactId>
291-
<version>1.6.8</version>
291+
<version>1.7.0</version>
292292
<extensions>true</extensions>
293293
<configuration>
294294
<serverId>ossrh-s01</serverId>

query/src/test/java/tech/ydb/query/impl/QueryIntegrationTest.java

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.slf4j.LoggerFactory;
1717

1818
import tech.ydb.common.transaction.TxMode;
19+
import tech.ydb.core.Issue;
1920
import tech.ydb.core.Result;
2021
import tech.ydb.core.Status;
2122
import tech.ydb.core.StatusCode;
@@ -519,4 +520,52 @@ public void testMultiStatement() {
519520
}
520521
}
521522
}
523+
524+
@Test
525+
public void testNoTxStatement() {
526+
try (QueryClient client = QueryClient.newClient(ydbTransport).build()) {
527+
try (QuerySession session = client.createSession(Duration.ofSeconds(5)).join().getValue()) {
528+
String query = ""
529+
+ "DECLARE $s1 AS Int32;"
530+
+ "DECLARE $s2 AS Int32;"
531+
+ "DECLARE $id1 AS Int32;"
532+
+ "DECLARE $id2 AS Int32;"
533+
+ "DECLARE $name1 AS Text;"
534+
+ "DECLARE $name2 AS Text;"
535+
+ "SELECT * FROM `" + TEST_TABLE + "` WHERE id = $s1;"
536+
+ "INSERT INTO `" + TEST_TABLE + "` (id, name) VALUES ($id1, $name1);"
537+
+ "SELECT * FROM `" + TEST_TABLE + "` WHERE id = $s2;"
538+
+ "INSERT INTO `" + TEST_TABLE + "` (id, name) VALUES ($id2, $name2);"
539+
+ "SELECT * FROM `" + TEST_TABLE + "` ORDER BY id";
540+
541+
Params params = Params.of(
542+
"$s1", PrimitiveValue.newInt32(100),
543+
"$s2", PrimitiveValue.newInt32(100),
544+
"$id1", PrimitiveValue.newInt32(100),
545+
"$name1", PrimitiveValue.newText("TEST1"),
546+
"$id2", PrimitiveValue.newInt32(100),
547+
"$name2", PrimitiveValue.newText("TEST2")
548+
);
549+
550+
Result<QueryReader> result = QueryReader.readFrom(
551+
session.createQuery(query, TxMode.NONE, params)
552+
).join();
553+
554+
Assert.assertFalse(result.isSuccess());
555+
Assert.assertEquals(StatusCode.PRECONDITION_FAILED, result.getStatus().getCode());
556+
Assert.assertArrayEquals(
557+
new Issue[] { Issue.of(2012, "Conflict with existing key.", Issue.Severity.ERROR)},
558+
result.getStatus().getIssues()
559+
);
560+
561+
Iterator<ResultSetReader> rsIter = QueryReader.readFrom(
562+
session.createQuery("SELECT id, name FROM " + TEST_TABLE + " ORDER BY id", TxMode.NONE)
563+
).join().getValue().iterator();
564+
565+
Assert.assertTrue(rsIter.hasNext());
566+
ResultSetReader rs = rsIter.next();
567+
Assert.assertFalse(rs.next());
568+
}
569+
}
570+
}
522571
}

tests/common/pom.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
<dependency>
4949
<groupId>org.mockito</groupId>
50-
<artifactId>mockito-inline</artifactId>
50+
<artifactId>mockito-core</artifactId>
5151
<scope>test</scope>
5252
</dependency>
5353
</dependencies>
@@ -72,4 +72,26 @@
7272
</plugin>
7373
</plugins>
7474
</build>
75+
76+
<profiles>
77+
<profile>
78+
<id>jdk8-build</id>
79+
<activation>
80+
<jdk>1.8</jdk>
81+
</activation>
82+
83+
<properties>
84+
<!-- Downgrade Mockito to 4 version -->
85+
<mockito.version>4.11.0</mockito.version>
86+
</properties>
87+
88+
<dependencies>
89+
<dependency>
90+
<groupId>org.mockito</groupId>
91+
<artifactId>mockito-inline</artifactId>
92+
<version>${mockito.version}</version>
93+
</dependency>
94+
</dependencies>
95+
</profile>
96+
</profiles>
7597
</project>

0 commit comments

Comments
 (0)