Skip to content

Commit 465eae9

Browse files
committed
Implement OraclePreparedQueryTest
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
1 parent 6f19c7f commit 465eae9

File tree

2 files changed

+104
-1
lines changed

2 files changed

+104
-1
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
* Copyright (c) 2011-2021 Contributors to the Eclipse Foundation
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Eclipse Public License 2.0 which is available at
6+
* http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7+
* which is available at https://www.apache.org/licenses/LICENSE-2.0.
8+
*
9+
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10+
*/
11+
12+
package io.vertx.oracleclient.test.tck;
13+
14+
import io.vertx.ext.unit.TestContext;
15+
import io.vertx.ext.unit.junit.VertxUnitRunner;
16+
import io.vertx.oracleclient.test.junit.OracleRule;
17+
import io.vertx.sqlclient.tck.PreparedQueryTestBase;
18+
import org.junit.ClassRule;
19+
import org.junit.Ignore;
20+
import org.junit.Test;
21+
import org.junit.runner.RunWith;
22+
23+
@RunWith(VertxUnitRunner.class)
24+
public class OraclePreparedQueryTest extends PreparedQueryTestBase {
25+
26+
@ClassRule
27+
public static OracleRule rule = OracleRule.SHARED_INSTANCE;
28+
29+
@Override
30+
protected void initConnector() {
31+
connector = ClientConfig.POOLED.connect(vertx, rule.options());
32+
}
33+
34+
@Override
35+
protected String statement(String... parts) {
36+
return String.join(" ?", parts);
37+
}
38+
39+
@Override
40+
@Test
41+
@Ignore("unsupported")
42+
public void testPreparedQueryParamCoercionTypeError(TestContext ctx) {
43+
super.testPreparedQueryParamCoercionTypeError(ctx);
44+
}
45+
46+
@Override
47+
public void testPreparedQueryParamCoercionQuantityError(TestContext ctx) {
48+
msgVerifier = t -> {
49+
ctx.assertEquals("Invalid column index", t.getMessage());
50+
};
51+
super.testPreparedQueryParamCoercionQuantityError(ctx);
52+
}
53+
54+
@Override
55+
@Test
56+
@Ignore("to be investigated")
57+
public void testQueryCursor(TestContext ctx) {
58+
super.testQueryCursor(ctx);
59+
}
60+
61+
@Override
62+
@Test
63+
@Ignore("to be investigated")
64+
public void testQueryCloseCursor(TestContext ctx) {
65+
super.testQueryCloseCursor(ctx);
66+
}
67+
68+
@Override
69+
@Test
70+
@Ignore("to be investigated")
71+
public void testQueryStreamCloseCursor(TestContext ctx) {
72+
super.testQueryStreamCloseCursor(ctx);
73+
}
74+
75+
@Override
76+
@Test
77+
@Ignore("to be investigated")
78+
public void testStreamQuery(TestContext ctx) {
79+
super.testStreamQuery(ctx);
80+
}
81+
82+
@Override
83+
@Test
84+
@Ignore("to be investigated")
85+
public void testStreamQueryPauseInBatch(TestContext ctx) {
86+
super.testStreamQueryPauseInBatch(ctx);
87+
}
88+
89+
@Override
90+
@Test
91+
@Ignore("to be investigated")
92+
public void testStreamQueryPauseInBatchFromAnotherThread(TestContext ctx) {
93+
super.testStreamQueryPauseInBatchFromAnotherThread(ctx);
94+
}
95+
96+
@Override
97+
@Test
98+
@Ignore("to be investigated")
99+
public void testStreamQueryPauseResume(TestContext ctx) {
100+
super.testStreamQueryPauseResume(ctx);
101+
}
102+
}
103+

vertx-sql-client/src/test/java/io/vertx/sqlclient/tck/PreparedQueryTestBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ public void testStreamQueryPauseResume(TestContext ctx) {
385385

386386
protected void cleanTestTable(TestContext ctx) {
387387
connect(ctx.asyncAssertSuccess(conn -> {
388-
conn.preparedQuery("TRUNCATE TABLE mutable;").execute(ctx.asyncAssertSuccess(result -> {
388+
conn.preparedQuery("TRUNCATE TABLE mutable").execute(ctx.asyncAssertSuccess(result -> {
389389
conn.close();
390390
}));
391391
}));

0 commit comments

Comments
 (0)