GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — QueryTest: test setParameters for int[] and long[] with notIn as well. · jamesagada/objectbox-java@8868321

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • tests/objectbox-java-test/src/test/java/io/objectbox/query
    • QueryTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tests/objectbox-java-test/src/test/java/io/objectbox/query/QueryTest.java‎

Copy file name to clipboardExpand all lines: tests/objectbox-java-test/src/test/java/io/objectbox/query/QueryTest.java
+24-3Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,37 @@ public void testLongIn() {
186186
}
187187

188188
@Test
189-
public void testScalarNotIn() {
189+
public void testIntNotIn() {
190190
putTestEntitiesScalars();
191191

192192
int[] valuesInt = {1, 1, 2, 3, 2003, 2007, 2002, -1};
193-
Query<TestEntity> query = box.query().notIn(simpleInt, valuesInt).build();
193+
Query<TestEntity> query = box.query().notIn(simpleInt, valuesInt).parameterAlias("int").build();
194194
assertEquals(7, query.count());
195195

196+
int[] valuesInt2 = {2003};
197+
query.setParameters(simpleInt, valuesInt2);
198+
assertEquals(9, query.count());
199+
200+
int[] valuesInt3 = {2003, 2007};
201+
query.setParameters("int", valuesInt3);
202+
assertEquals(8, query.count());
203+
}
204+
205+
@Test
206+
public void testLongNotIn() {
207+
putTestEntitiesScalars();
208+
196209
long[] valuesLong = {1, 1, 2, 3, 3003, 3007, 3002, -1};
197-
query = box.query().notIn(simpleLong, valuesLong).build();
210+
Query<TestEntity> query = box.query().notIn(simpleLong, valuesLong).parameterAlias("long").build();
198211
assertEquals(7, query.count());
212+
213+
long[] valuesLong2 = {3003};
214+
query.setParameters(simpleLong, valuesLong2);
215+
assertEquals(9, query.count());
216+
217+
long[] valuesLong3 = {3003, 3007};
218+
query.setParameters("long", valuesLong3);
219+
assertEquals(8, query.count());
199220
}
200221

201222
@Test

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.