Code example for Cursor

Methods: closegetBlobgetIntgetStringmoveToFirst

0
 
        Cursor cur = mDB.rawQuery("SELECT "
                + join(Consumers.PACKAGE_NAME, Consumers.IS_SERVICE_PUBLIC, 
                        Consumers.OWNS_CONSUMER_KEY, Consumers.REGISTRY_ID, Consumers.SIGNATURE) 
                + " FROM consumers", null); 
        assertTrue(cur.moveToFirst());
        assertEquals(PACKAGE_UNDER_TEST, cur.getString(0));
        assertEquals(0, cur.getInt(1));
        assertEquals(1, cur.getInt(2));
        assertEquals(1, cur.getInt(3));
        assertEquals(new Signature(SIGNATURE_FOR_PACKAGE), new Signature(cur.getBlob(4)));
        cur.close();
    } 
 
    public void testShouldUpdateCorrectly() throws Exception { 
        setPackage(PACKAGE_UNDER_TEST);
        setSignature(SIGNATURE_FOR_PACKAGE);
 
        ContentValues value = new ContentValues();
        value.put(Registry.ACCESS_TOKEN_URL, "http://access");
        value.put(Registry.REQUEST_TOKEN_URL, "http://request");