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 @@ -46,9 +46,6 @@ public class IndexQueryPaginationTest extends GridCommonAbstractTest {
/** */
private static final int NODES = 2;

/** */
private Ignite grid;

/** */
private IgniteCache<Integer, Person> cache;

Expand All @@ -64,11 +61,13 @@ public static Object[] params() {

/** {@inheritDoc} */
@Override protected void beforeTest() throws Exception {
grid = startGrids(NODES);
Ignite srv = startGrids(NODES);

cache = srv.cache("cache");

cache = grid.cache("cache");
awaitPartitionMapExchange();

insertData(grid, cache, entries);
insertData(srv, cache, entries);
}

/** {@inheritDoc} */
Expand Down Expand Up @@ -119,7 +118,7 @@ public void nextPageTest() {
QueryCursor<Cache.Entry<Integer, Person>> cursor = cache.query(
new IndexQuery<Integer, Person>(Person.class).setPageSize(PAGE_SIZE));

assert entries == cursor.getAll().size();
assertEquals(entries, cursor.getAll().size());

List<Object> msgs = new ArrayList<>();

Expand All @@ -131,18 +130,19 @@ public void nextPageTest() {

int reqsSize = reqs.size();

assert reqsSize == reqsExpected && reqsSize == resp.size();
assertEquals(reqsExpected, reqsSize);
assertEquals(reqsSize, resp.size());

for (int i = 0; i < reqsSize; i++) {
int reqPage = reqs.get(i).pageSize();
int respData = resp.get(i).data().size();

assert reqPage == PAGE_SIZE;
assertEquals(PAGE_SIZE, reqPage);

if (i == reqsSize - 1 && remNodeLastPageEntries != 0)
assert respData == remNodeLastPageEntries;
assertEquals(remNodeLastPageEntries, respData);
else
assert respData == reqPage;
assertEquals(respData, reqPage);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public static Collection<Object[]> testParams() {
ignite = startGrids(nodesCnt);

cache = ignite.cache(CACHE);

awaitPartitionMapExchange();
}

/** {@inheritDoc} */
Expand Down
Loading