checkstyle: Also check test sources
This commit is contained in:
		
							parent
							
								
									6b573db3f4
								
							
						
					
					
						commit
						b60afa2dc0
					
				@ -190,7 +190,7 @@ android {
 | 
			
		||||
 | 
			
		||||
task checkstyle(type: Checkstyle) {
 | 
			
		||||
    configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml")
 | 
			
		||||
    source 'src'
 | 
			
		||||
    source 'src', 'test/src'
 | 
			
		||||
    include '**/*.java'
 | 
			
		||||
    exclude '**/gen/**'
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -116,7 +116,7 @@ public abstract class ProviderTestCase2MockContext<T extends ContentProvider> ex
 | 
			
		||||
        return mProvider;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    abstract protected Context createMockContext(Context delegate);
 | 
			
		||||
    protected abstract Context createMockContext(Context delegate);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Sets up the environment for the test fixture.
 | 
			
		||||
 | 
			
		||||
@ -57,7 +57,7 @@ public class ApkProviderHelperTest extends BaseApkProviderTest {
 | 
			
		||||
 | 
			
		||||
        String[] projection = {
 | 
			
		||||
            ApkProvider.DataColumns.APK_ID,
 | 
			
		||||
            ApkProvider.DataColumns.VERSION_CODE
 | 
			
		||||
            ApkProvider.DataColumns.VERSION_CODE,
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        List<Apk> knownApks = ApkProvider.Helper.knownApks(getMockContext(), apksToCheck, projection);
 | 
			
		||||
@ -181,7 +181,7 @@ public class ApkProviderHelperTest extends BaseApkProviderTest {
 | 
			
		||||
 | 
			
		||||
        String[] projection = {
 | 
			
		||||
            ApkProvider.DataColumns.APK_ID,
 | 
			
		||||
            ApkProvider.DataColumns.HASH
 | 
			
		||||
            ApkProvider.DataColumns.HASH,
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        Apk apkLessFields = ApkProvider.Helper.find(getMockContext(), "com.example", 11, projection);
 | 
			
		||||
 | 
			
		||||
@ -175,10 +175,10 @@ public class ApkProviderTest extends BaseApkProviderTest {
 | 
			
		||||
        assertCantDelete(Uri.withAppendedPath(ApkProvider.getContentUri(), "some-random-path"));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void testRepoApks() {
 | 
			
		||||
    private static final long REPO_KEEP = 1;
 | 
			
		||||
    private static final long REPO_DELETE = 2;
 | 
			
		||||
 | 
			
		||||
        final long REPO_KEEP = 1;
 | 
			
		||||
        final long REPO_DELETE = 2;
 | 
			
		||||
    public void testRepoApks() {
 | 
			
		||||
 | 
			
		||||
        // Insert apks into two repos, one of which we will later purge the
 | 
			
		||||
        // the apks from.
 | 
			
		||||
@ -280,7 +280,7 @@ public class ApkProviderTest extends BaseApkProviderTest {
 | 
			
		||||
            RepoProvider.DataColumns.ADDRESS,
 | 
			
		||||
            RepoProvider.DataColumns.FINGERPRINT,
 | 
			
		||||
            RepoProvider.DataColumns.NAME,
 | 
			
		||||
            RepoProvider.DataColumns.PUBLIC_KEY
 | 
			
		||||
            RepoProvider.DataColumns.PUBLIC_KEY,
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        for (String field : repoFields) {
 | 
			
		||||
 | 
			
		||||
@ -38,7 +38,7 @@ public class AppProviderTest extends FDroidProviderTest<AppProvider> {
 | 
			
		||||
    protected String[] getMinimalProjection() {
 | 
			
		||||
        return new String[] {
 | 
			
		||||
            AppProvider.DataColumns.APP_ID,
 | 
			
		||||
            AppProvider.DataColumns.NAME
 | 
			
		||||
            AppProvider.DataColumns.NAME,
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -217,7 +217,7 @@ public class AppProviderTest extends FDroidProviderTest<AppProvider> {
 | 
			
		||||
            // is should only ignore if "ignored version" is >= suggested
 | 
			
		||||
 | 
			
		||||
            "installed, old version, ignore all",
 | 
			
		||||
            "installed, old version, ignore latest"
 | 
			
		||||
            "installed, old version, ignore latest",
 | 
			
		||||
            // NOT "installed, old version, ignore newer, but not latest"
 | 
			
		||||
            // for the same reason as above.
 | 
			
		||||
        };
 | 
			
		||||
@ -305,7 +305,7 @@ public class AppProviderTest extends FDroidProviderTest<AppProvider> {
 | 
			
		||||
            getMockContext().getResources().getString(R.string.category_All),
 | 
			
		||||
            "Animal",
 | 
			
		||||
            "Mineral",
 | 
			
		||||
            "Vegetable"
 | 
			
		||||
            "Vegetable",
 | 
			
		||||
        };
 | 
			
		||||
        TestUtils.assertContainsOnly(categories, expected);
 | 
			
		||||
    }
 | 
			
		||||
@ -323,7 +323,7 @@ public class AppProviderTest extends FDroidProviderTest<AppProvider> {
 | 
			
		||||
 | 
			
		||||
            "Animal",
 | 
			
		||||
            "Mineral",
 | 
			
		||||
            "Vegetable"
 | 
			
		||||
            "Vegetable",
 | 
			
		||||
        };
 | 
			
		||||
        TestUtils.assertContainsOnly(categories, expected);
 | 
			
		||||
 | 
			
		||||
@ -350,7 +350,7 @@ public class AppProviderTest extends FDroidProviderTest<AppProvider> {
 | 
			
		||||
            "Blah",
 | 
			
		||||
            "Test category",
 | 
			
		||||
            "The quick brown fox jumps over the lazy dog",
 | 
			
		||||
            "With apostrophe's"
 | 
			
		||||
            "With apostrophe's",
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        TestUtils.assertContainsOnly(categoriesLonger, expectedLonger);
 | 
			
		||||
 | 
			
		||||
@ -29,7 +29,7 @@ abstract class BaseApkProviderTest extends FDroidProviderTest<ApkProvider> {
 | 
			
		||||
            ApkProvider.DataColumns.APK_ID,
 | 
			
		||||
            ApkProvider.DataColumns.VERSION_CODE,
 | 
			
		||||
            ApkProvider.DataColumns.NAME,
 | 
			
		||||
            ApkProvider.DataColumns.REPO_ID
 | 
			
		||||
            ApkProvider.DataColumns.REPO_ID,
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,7 @@ public class InstalledAppCacheTest extends FDroidProviderTest<InstalledAppProvid
 | 
			
		||||
    @Override
 | 
			
		||||
    protected String[] getMinimalProjection() {
 | 
			
		||||
        return new String[] {
 | 
			
		||||
            InstalledAppProvider.DataColumns.APP_ID
 | 
			
		||||
            InstalledAppProvider.DataColumns.APP_ID,
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -68,7 +68,7 @@ public class RepoXMLHandlerTest extends AndroidTestCase {
 | 
			
		||||
            "info.guardianproject.otr.app.im",
 | 
			
		||||
            "org.torproject.android",
 | 
			
		||||
            "org.gege.caldavsyncadapter",
 | 
			
		||||
                "info.guardianproject.checkey"
 | 
			
		||||
            "info.guardianproject.checkey",
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user