Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ protected static String stringVersion(int ver) {
(ver % 1000);
}

private static int getMinimumKVVersion() {
protected static int getMinimumKVVersion() {
/*
* Use the minimum of the kv client and server versions to
* determine what features should be valid to test.
Expand Down
22 changes: 19 additions & 3 deletions driver/src/test/java/oracle/nosql/driver/QueryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1583,15 +1583,31 @@ public void testEvolution() {
assertEquals(10, qres.getResults().size());

/*
* evolve and try the query again. It will fail because the ???
* Evolve and try the query again. It will fail because table schema
* has been changed, the query need to be prepared again.
*
* The exception caught from query may vary depending on the
* different proxy and KV version. PrepareQueryException will be
* thrown for proxy(KVClient 25.1.1) + KV server 25.1.1 or higher.
* Otherwise, IllegalArgumentException will be thrown.
*/
tableOperation(handle, "alter table testTable(drop age)", null);

try {
qres = handle.query(qreq);
fail("Query should have failed");
} catch (IllegalArgumentException iae) {
/* success */
} catch (PrepareQueryException | IllegalArgumentException ex) {
/*
* If can't determine the versions of KV client and server, skip
* checking the specific exception.
*/
if (getMinimumKVVersion() > 0) {
if (checkKVVersion(25, 1, 1)) {
assertTrue(ex instanceof PrepareQueryException);
} else {
assertTrue(ex instanceof IllegalArgumentException);
}
}
}
}
}
Expand Down