Code example for MockContentResolver

Methods: query

0
    public void testShouldOnlyReturnPublicAndOwned() throws Exception { 
        standardInsert(); 
 
        setPackage(PACKAGE_UNDER_TEST);
        setSignature(SIGNATURE_FOR_PACKAGE);
        Cursor cur = mResolver.query(REGISTRY_URI, new String[] {
            "_id" 
        }, null, null, null); 
        assertNotNull(cur);
 
        // should only return the owned and public ones... (e.g. not 6 but 2 for 
        // the owned one and 1 for the public) 
        assertEquals(3, cur.getCount());
        cur.close();
    } 
 
    public void testShouldReturnAllIfPermissionMet() throws Exception { 
        standardInsert(); 
        setPermission(true); 
        Cursor cur = mResolver.query(REGISTRY_URI, new String[] {
Experience pair programming with AI  Get Codota for Java