@@ -135,26 +135,26 @@ public void testFindStrings_wrongPropertyType() {
135
135
public void testFindString () {
136
136
Query <TestEntity > query = box .query ().greater (simpleLong , 1002 ).build ();
137
137
PropertyQuery propertyQuery = query .property (simpleString );
138
- assertNull (propertyQuery .findFirstString ());
139
- assertNull (propertyQuery .reset ().findUniqueString ());
138
+ assertNull (propertyQuery .findString ());
139
+ assertNull (propertyQuery .reset ().unique (). findString ());
140
140
putTestEntities (5 );
141
- assertEquals ("foo3" , propertyQuery .reset ().findFirstString ());
141
+ assertEquals ("foo3" , propertyQuery .reset ().findString ());
142
142
143
143
query = box .query ().greater (simpleLong , 1004 ).build ();
144
144
propertyQuery = query .property (simpleString );
145
- assertEquals ("foo5" , propertyQuery .reset ().findUniqueString ());
145
+ assertEquals ("foo5" , propertyQuery .reset ().unique (). findString ());
146
146
147
147
putTestEntity (null , 6 );
148
148
// TODO XXX enable me after fixing combination of unique and distinct: putTestEntity(null, 7);
149
149
query .setParameter (simpleLong , 1005 );
150
- assertEquals ("nope" , propertyQuery .reset ().distinct ().nullValue ("nope" ).findUniqueString ());
150
+ assertEquals ("nope" , propertyQuery .reset ().distinct ().nullValue ("nope" ).unique (). findString ());
151
151
}
152
152
153
153
@ Test (expected = DbException .class )
154
154
public void testFindString_uniqueFails () {
155
155
putTestEntity ("foo" , 1 );
156
156
putTestEntity ("foo" , 2 );
157
- box .query ().build ().property (simpleString ).findUniqueString ();
157
+ box .query ().build ().property (simpleString ).unique (). findString ();
158
158
}
159
159
160
160
@ Test
@@ -177,32 +177,32 @@ public void testFindLongs() {
177
177
@ Test
178
178
public void testFindLong () {
179
179
Query <TestEntity > query = box .query ().greater (simpleLong , 1002 ).build ();
180
- assertNull (query .property (simpleLong ).findFirstLong ());
181
- assertNull (query .property (simpleLong ).findUniqueLong ());
180
+ assertNull (query .property (simpleLong ).findLong ());
181
+ assertNull (query .property (simpleLong ).findLong ());
182
182
putTestEntities (5 );
183
- assertEquals (1003 , (long ) query .property (simpleLong ).findFirstLong ());
183
+ assertEquals (1003 , (long ) query .property (simpleLong ).findLong ());
184
184
185
185
query = box .query ().greater (simpleLong , 1004 ).build ();
186
- assertEquals (1005 , (long ) query .property (simpleLong ).distinct ().findUniqueLong ());
186
+ assertEquals (1005 , (long ) query .property (simpleLong ).distinct ().findLong ());
187
187
}
188
188
189
189
@ Test (expected = DbException .class )
190
190
public void testFindLong_uniqueFails () {
191
191
putTestEntity (null , 1 );
192
192
putTestEntity (null , 1 );
193
- box .query ().build ().property (simpleLong ).findUniqueLong ();
193
+ box .query ().build ().property (simpleLong ).unique (). findLong ();
194
194
}
195
195
196
196
@ Test
197
197
public void testFindInt () {
198
198
Query <TestEntity > query = box .query ().greater (simpleLong , 1002 ).build ();
199
- assertNull (query .property (simpleInt ).findFirstInt ());
200
- assertNull (query .property (simpleInt ).findUniqueInt ());
199
+ assertNull (query .property (simpleInt ).findInt ());
200
+ assertNull (query .property (simpleInt ).unique (). findInt ());
201
201
putTestEntities (5 );
202
- assertEquals (3 , (int ) query .property (simpleInt ).findFirstInt ());
202
+ assertEquals (3 , (int ) query .property (simpleInt ).findInt ());
203
203
204
204
query = box .query ().greater (simpleLong , 1004 ).build ();
205
- assertEquals (5 , (int ) query .property (simpleInt ).distinct ().findUniqueInt ());
205
+ assertEquals (5 , (int ) query .property (simpleInt ).distinct ().unique (). findInt ());
206
206
207
207
TestEntityCursor .INT_NULL_HACK = true ;
208
208
try {
@@ -211,26 +211,26 @@ public void testFindInt() {
211
211
TestEntityCursor .INT_NULL_HACK = false ;
212
212
}
213
213
query .setParameter (simpleLong , 1005 );
214
- assertEquals (-99 , (int ) query .property (simpleInt ).nullValue (-99 ).findUniqueInt ());
214
+ assertEquals (-99 , (int ) query .property (simpleInt ).nullValue (-99 ).unique (). findInt ());
215
215
}
216
216
217
217
@ Test (expected = DbException .class )
218
218
public void testFindInt_uniqueFails () {
219
219
putTestEntity (null , 1 );
220
220
putTestEntity (null , 1 );
221
- box .query ().build ().property (simpleInt ).findUniqueInt ();
221
+ box .query ().build ().property (simpleInt ).unique (). findInt ();
222
222
}
223
223
224
224
@ Test
225
225
public void testFindDouble () {
226
226
Query <TestEntity > query = box .query ().greater (simpleLong , 1002 ).build ();
227
- assertNull (query .property (simpleDouble ).findFirstDouble ());
228
- assertNull (query .property (simpleDouble ).findUniqueDouble ());
227
+ assertNull (query .property (simpleDouble ).findDouble ());
228
+ assertNull (query .property (simpleDouble ).unique (). findDouble ());
229
229
putTestEntities (5 );
230
- assertEquals (2000.03 , query .property (simpleDouble ).findFirstDouble (), 0.001 );
230
+ assertEquals (2000.03 , query .property (simpleDouble ).findDouble (), 0.001 );
231
231
232
232
query = box .query ().greater (simpleLong , 1004 ).build ();
233
- assertEquals (2000.05 , query .property (simpleDouble ).distinct ().findUniqueDouble (), 0.001 );
233
+ assertEquals (2000.05 , query .property (simpleDouble ).distinct ().unique (). findDouble (), 0.001 );
234
234
}
235
235
236
236
// TODO add test for other types of single object find methods
0 commit comments