@@ -0,0 +1,1938 @@
+/*%0A * Copyright (C) 2017 JDBX%0A * %0A * https://github.com/jdlib/JDBX%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at %0A * http://www.apache.org/licenses/LICENSE-2.0.%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.jdbx.test;%0A%0A%0Aimport org.jdbx.Jdbx;%0Aimport org.jdbx.JdbxException;%0Aimport org.jdbx.QueryResult;%0Aimport org.jdbx.ResultConcurrency;%0Aimport org.jdbx.ResultType;%0Aimport org.jdbx.StaticStmt;%0Aimport org.junit.Before;%0Aimport org.junit.BeforeClass;%0Aimport org.junit.Test;%0A%0A%0Apublic class QueryResultTest extends JdbxTest%0A%7B%0A%09@BeforeClass public static void beforeClass() throws JdbxException%0A%09%7B%0A%09%09Jdbx.update(con(), %22CREATE TABLE STest (id INTEGER IDENTITY PRIMARY KEY, name VARCHAR(30))%22);%0A%09%09Jdbx.update(con(), %22INSERT INTO STest (name) VALUES ('A'), ('B'), ('C'), ('D')%22);%0A%09%7D%0A%0A%0A%09@Before public void before() throws JdbxException%0A%09%7B%0A%09%09stmt_ = new StaticStmt(con());%0A%09%7D%0A%09%0A%09%0A%09@Test public void testAdvanced()%0A%09%7B%0A%09%09stmt_.init().resultType(ResultType.SCROLL_INSENSITIVE).resultConcurrency(ResultConcurrency.CONCUR_UPDATABLE);%0A%09%09try (QueryResult result = stmt_.createQuery(%22SELECT name FROM STest ORDER BY name%22).result())%0A%09%09%7B%0A%09%09%09assertTrue(result.position().isBeforeFirst());%0A%09%09%09assertTrue(result.move().absolute(2));%0A%09%09%09assertEquals(%22B%22, result.col().getString());%0A%09%09%09assertTrue(result.move().relative(2));%0A%09%09%09assertEquals(%22D%22, result.col().getString());%0A%09%09%09assertTrue(result.position().isLast());%0A%09%09%09result.move().afterLast();%0A%09%09%09assertTrue(result.position().isAfterLast());%0A%09%09%7D%0A%09%7D%0A%0A%0A%09private StaticStmt stmt_;%0A%7D%0A

add test for QueryResult