This is an automated email from the ASF dual-hosted git repository.

isapego pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-nodejs-thin-client.git

commit 790e2538c9c8116085c85b000bc3f26fe71fd546
Author: tledkov-gridgain <[email protected]>
AuthorDate: Sun Feb 17 18:50:10 2019 +0300

    IGNITE-9171: SQL: redesigned lazy mode. This closes #5473.
---
 spec/query/SqlFieldsQuery.spec.js | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/spec/query/SqlFieldsQuery.spec.js 
b/spec/query/SqlFieldsQuery.spec.js
index c81838a..bf75759 100644
--- a/spec/query/SqlFieldsQuery.spec.js
+++ b/spec/query/SqlFieldsQuery.spec.js
@@ -77,12 +77,31 @@ describe('sql fields query test suite >', () => {
             catch(error => done.fail(error));
     });
 
-    it('get all with page size', (done) => {
+    it('get all with page size lazy true', (done) => {
         Promise.resolve().
             then(async () => {
                 let cache = igniteClient.getCache(CACHE_NAME);
                 const cursor = await cache.query(
-                    new SqlFieldsQuery(`SELECT * FROM 
${TABLE_NAME}`).setPageSize(1));
+                    new SqlFieldsQuery(`SELECT * FROM 
${TABLE_NAME}`).setPageSize(1).setLazy(true));
+                const set = new Set();
+                for (let fields of await cursor.getAll()) {
+                    expect(fields.length).toBe(2);
+                    expect(generateValue(fields[0]) === fields[1]).toBe(true);
+                    set.add(fields[0]);
+                    expect(fields[0] >= 0 && fields[0] < 
ELEMENTS_NUMBER).toBe(true);
+                }
+                expect(set.size).toBe(ELEMENTS_NUMBER);
+            }).
+            then(done).
+            catch(error => done.fail(error));
+    });
+
+    it('get all with page size lazy false', (done) => {
+        Promise.resolve().
+            then(async () => {
+                let cache = igniteClient.getCache(CACHE_NAME);
+                const cursor = await cache.query(
+                    new SqlFieldsQuery(`SELECT * FROM 
${TABLE_NAME}`).setPageSize(1).setLazy(false));
                 const set = new Set();
                 for (let fields of await cursor.getAll()) {
                     expect(fields.length).toBe(2);

Reply via email to