Skip to content

Commit

Permalink
CAY-2814 Select query iterator() and batchIterator() methods return i…
Browse files Browse the repository at this point in the history
…ncorrect results

 - fix tests
  • Loading branch information
stariy95 committed Nov 6, 2023
1 parent 5a3ac74 commit d0d8e90
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void prefetchWithBatchIterator() {
assertEquals("Test1", painting.getToArtist().readPropertyDirectly("artistName"));
}
}
assertEquals(2,count);
assertEquals(2, count);
}
}

Expand All @@ -111,11 +111,11 @@ public void queryPrefetchJointWithIterator() {
while (iterator.hasNextRow()) {
count++;
Painting painting = iterator.nextRow();
//noinspection ConstantConditions
assertTrue(painting instanceof Painting);
assertEquals("Test1", painting.getToArtist().readPropertyDirectly("artistName"));
//noinspection ConstantConditions
assertTrue(painting instanceof Painting);
assertEquals("Test1", painting.getToArtist().readPropertyDirectly("artistName"));
}
assertEquals(20,count);
assertEquals(20, count);
}
}

Expand Down Expand Up @@ -165,14 +165,14 @@ public void queryPrefetchDisjointByIdWithBIterator() {
assertTrue(painting instanceof Painting);
assertEquals("Test1", painting.getToArtist().readPropertyDirectly("artistName"));
}
assertEquals(20,count);
assertEquals(20, count);
}
}

@Test
public void queryPrefetchJointWithBatchIterator() {
try (ResultBatchIterator<Painting> iterator = ObjectSelect
.query(Painting.class,"Painting")
.query(Painting.class, "Painting")
.prefetch(Painting.TO_ARTIST.joint())
.batchIterator(context, 5)) {
int count = 0;
Expand Down Expand Up @@ -226,7 +226,7 @@ public void mappingWithBatchIterator() {
}
}
assertEquals(5, iterator.getBatchSize());
assertEquals(4,count);
assertEquals(4, count);
}
}

Expand Down Expand Up @@ -308,6 +308,7 @@ public void dbQueryWithIterator() {
public void dbQueryWithBatchIterator() {
try (ResultBatchIterator<?> iterator = ObjectSelect
.dbQuery("PAINTING")
.orderBy("db:" + Painting.PAINTING_ID_PK_COLUMN)
.batchIterator(context, 5)) {
int count = 0;
int paintingCounter = 0;
Expand Down Expand Up @@ -342,7 +343,7 @@ static class DTO {
private final Long estimatedPrice;

public DTO(Object[] data) {
this.title = "dto_" + (String) data[0];
this.title = "dto_" + data[0];
this.estimatedPrice = ((Number) data[1]).longValue();
}

Expand Down

0 comments on commit d0d8e90

Please sign in to comment.