Lines Matching refs:Query
42 public static class Query {
58 public Query(Uri uri) {
67 public Query withProjection(String... projection) {
72 public Query withDefaultProjection(String... projection) {
77 public Query withAnyProjection() {
82 public Query withSelection(String selection, String... selectionArgs) {
88 public Query withAnySelection() {
93 public Query withSortOrder(String sortOrder) {
98 public Query withAnySortOrder() {
103 public Query returnRow(ContentValues values) {
108 public Query returnRow(Object... row) {
113 public Query returnEmptyCursor() {
118 public Query anyNumberOfTimes() {
230 private ArrayList<Query> mExpectedQueries = new ArrayList<Query>();
238 public Query expectQuery(Uri contentUri) {
239 Query query = new Query(contentUri);
240 mExpectedQueries.add(query);
241 return query;
249 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
252 for (Iterator<Query> iterator = mExpectedQueries.iterator(); iterator.hasNext();) {
253 Query query = iterator.next();
254 if (query.equals(uri, projection, selection, selectionArgs, sortOrder)) {
255 query.mExecuted = true;
256 if (!query.mAnyNumberOfTimes) {
259 return query.getResult(projection);
264 Assert.fail("Unexpected query: "
272 Assert.fail("Incorrect query.\n Expected: " + sb + "\n Actual: " +
286 Assert.fail("Unexpected getType query: " + uri);
332 ArrayList<Query> mMissedQueries = Lists.newArrayList();
333 for (Query query : mExpectedQueries) {
334 if (!query.mExecuted) {
335 mMissedQueries.add(query);