File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
driver/src/test/java/oracle/nosql/driver Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -678,7 +678,7 @@ protected static String stringVersion(int ver) {
678678 (ver % 1000 );
679679 }
680680
681- private static int getMinimumKVVersion () {
681+ protected static int getMinimumKVVersion () {
682682 /*
683683 * Use the minimum of the kv client and server versions to
684684 * determine what features should be valid to test.
Original file line number Diff line number Diff line change @@ -1583,15 +1583,31 @@ public void testEvolution() {
15831583 assertEquals (10 , qres .getResults ().size ());
15841584
15851585 /*
1586- * evolve and try the query again. It will fail because the ???
1586+ * Evolve and try the query again. It will fail because table schema
1587+ * has been changed, the query need to be prepared again.
15871588 *
1589+ * The exception caught from query may vary depending on the
1590+ * different proxy and KV version. PrepareQueryException will be
1591+ * thrown for proxy(KVClient 25.1.1) + KV server 25.1.1 or higher.
1592+ * Otherwise, IllegalArgumentException will be thrown.
15881593 */
15891594 tableOperation (handle , "alter table testTable(drop age)" , null );
1595+
15901596 try {
15911597 qres = handle .query (qreq );
15921598 fail ("Query should have failed" );
1593- } catch (IllegalArgumentException iae ) {
1594- /* success */
1599+ } catch (PrepareQueryException | IllegalArgumentException ex ) {
1600+ /*
1601+ * If can't determine the versions of KV client and server, skip
1602+ * checking the specific exception.
1603+ */
1604+ if (getMinimumKVVersion () > 0 ) {
1605+ if (checkKVVersion (25 , 1 , 1 )) {
1606+ assertTrue (ex instanceof PrepareQueryException );
1607+ } else {
1608+ assertTrue (ex instanceof IllegalArgumentException );
1609+ }
1610+ }
15951611 }
15961612 }
15971613 }
You can’t perform that action at this time.
0 commit comments