diff options
25 files changed, 294 insertions, 279 deletions
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg index d6d3133..948fa79 100644 --- a/PREUPLOAD.cfg +++ b/PREUPLOAD.cfg @@ -1,3 +1,10 @@ [Builtin Hooks] +bpfmt = true google_java_format = true -pylint = true
\ No newline at end of file +pylint = true +xmllint = true + +[Hook Scripts] +checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py + --sha ${PREUPLOAD_COMMIT} + --config_xml config/checkstyle/checkstyle.xml diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml new file mode 100644 index 0000000..1eb7457 --- /dev/null +++ b/config/checkstyle/checkstyle.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd" [ + <!ENTITY defaultCopyrightCheck SYSTEM "../../../../../prebuilts/checkstyle/default-copyright-check.xml"> + <!ENTITY defaultJavadocChecks SYSTEM "../../../../../prebuilts/checkstyle/default-javadoc-checks.xml"> + <!ENTITY defaultTreewalkerChecks SYSTEM "../../../../../prebuilts/checkstyle/default-treewalker-checks.xml"> + <!ENTITY defaultModuleChecks SYSTEM "../../../../../prebuilts/checkstyle/default-module-checks.xml"> +]> + +<module name="Checker"> + &defaultModuleChecks; + &defaultCopyrightCheck; + <module name="TreeWalker"> + &defaultJavadocChecks; + &defaultTreewalkerChecks; + </module> + <module name="SuppressionFilter"> + <property name="file" value="config/checkstyle/suppressions.xml" /> + </module> +</module> diff --git a/config/checkstyle/suppressions.xml b/config/checkstyle/suppressions.xml new file mode 100644 index 0000000..218bc02 --- /dev/null +++ b/config/checkstyle/suppressions.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN" "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd"> +<suppressions> + + <!-- Let google-java-format handle the indentation. --> + <suppress files=".*" checks="Indentation" /> + +</suppressions> diff --git a/harness/Android.bp b/harness/Android.bp new file mode 100644 index 0000000..2dec437 --- /dev/null +++ b/harness/Android.bp @@ -0,0 +1,43 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +java_library_host { + name: "csuite-harness", + srcs: [ + "src/main/java/**/*.java", + ], + java_resource_dirs: [ + "src/main/resources", + ], + libs: [ + "tradefed", + ], +} + +java_test_host { + name: "csuite-harness-tests", + srcs: [ + "src/test/java/**/*.java", + ], + libs: [ + "csuite-harness", + "tradefed", + ], + static_libs: [ + "mockito-host", + "objenesis", + "testng", + ], + test_suites: ["general-tests"], +} diff --git a/harness/Android.mk b/harness/Android.mk deleted file mode 100644 index aad6044..0000000 --- a/harness/Android.mk +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright (C) 2019 The Android Open Source Project. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH:= $(call my-dir) - -############################ -# csuite-harness -############################ - -include $(CLEAR_VARS) - -LOCAL_JAVA_RESOURCE_DIRS := src/main/resources - -LOCAL_SRC_FILES := $(call all-java-files-under, src/main/java) - -LOCAL_JAVA_LIBRARIES := tradefed -LOCAL_MODULE := csuite-harness - -include $(BUILD_HOST_JAVA_LIBRARY) - -############################ -# csuite-harness-tests -############################ - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES = $(call all-java-files-under, src/test/java) - -LOCAL_JAVA_LIBRARIES := tradefed csuite-harness - -LOCAL_STATIC_JAVA_LIBRARIES := mockito-host objenesis testng - -LOCAL_MODULE := csuite-harness-tests - -LOCAL_COMPATIBILITY_SUITE := general-tests - -include $(BUILD_HOST_JAVA_LIBRARY) diff --git a/harness/src/main/java/com/android/compatibility/AppCompatibilityTest.java b/harness/src/main/java/com/android/compatibility/AppCompatibilityTest.java index ff0fba9..74c4907 100644 --- a/harness/src/main/java/com/android/compatibility/AppCompatibilityTest.java +++ b/harness/src/main/java/com/android/compatibility/AppCompatibilityTest.java @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License + * limitations under the License. */ package com.android.compatibility; @@ -39,8 +39,8 @@ import com.android.tradefed.result.TestDescription; import com.android.tradefed.testtype.IDeviceTest; import com.android.tradefed.testtype.IRemoteTest; import com.android.tradefed.testtype.IShardableTest; -import com.android.tradefed.testtype.InstrumentationTest; import com.android.tradefed.testtype.ITestFilterReceiver; +import com.android.tradefed.testtype.InstrumentationTest; import com.android.tradefed.util.AaptParser; import com.android.tradefed.util.FileUtil; import com.android.tradefed.util.IRunUtil; @@ -61,9 +61,9 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.HashSet; /** * Test that determines application compatibility. The test iterates through the apks in a given @@ -137,15 +137,15 @@ public abstract class AppCompatibilityTest private int mShardCount = 1; private int mShardIndex = 0; - protected final String launcherPackage; - protected final String runnerClass; - protected final String packageBeingTestedKey; + protected final String mLauncherPackage; + protected final String mRunnerClass; + protected final String mPackageBeingTestedKey; protected AppCompatibilityTest( String launcherPackage, String runnerClass, String packageBeingTestedKey) { - this.launcherPackage = launcherPackage; - this.runnerClass = runnerClass; - this.packageBeingTestedKey = packageBeingTestedKey; + this.mLauncherPackage = launcherPackage; + this.mRunnerClass = runnerClass; + this.mPackageBeingTestedKey = packageBeingTestedKey; } /** @@ -158,10 +158,10 @@ public abstract class AppCompatibilityTest protected final InstrumentationTest createDefaultInstrumentationTest( String packageBeingTested) { InstrumentationTest instrTest = new InstrumentationTest(); - instrTest.setPackageName(launcherPackage); + instrTest.setPackageName(mLauncherPackage); instrTest.setConfiguration(mConfiguration); - instrTest.addInstrumentationArg(packageBeingTestedKey, packageBeingTested); - instrTest.setRunnerName(runnerClass); + instrTest.addInstrumentationArg(mPackageBeingTestedKey, packageBeingTested); + instrTest.setRunnerName(mRunnerClass); return instrTest; } @@ -221,7 +221,7 @@ public abstract class AppCompatibilityTest listener.testRunEnded( System.currentTimeMillis() - start, new HashMap<String, Metric>()); } - } + } /** * Downloads and tests all the APKs in the apk list. @@ -515,7 +515,7 @@ public abstract class AppCompatibilityTest private File mDownloadedFile = null; - public ApkDownloadRunnable(File kharonDir, ApkInfo apkInfo) { + ApkDownloadRunnable(File kharonDir, ApkInfo apkInfo) { mKharonDir = kharonDir; mApkInfo = apkInfo; } @@ -614,7 +614,7 @@ public abstract class AppCompatibilityTest * TestDescription(launcher package, package being run). */ private TestDescription createTestDescription(String packageBeingTested) { - return new TestDescription(launcherPackage, packageBeingTested); + return new TestDescription(mLauncherPackage, packageBeingTested); } /** {@inheritDoc} */ diff --git a/harness/src/main/java/com/android/compatibility/AppCrawlerCompatibilityTest.java b/harness/src/main/java/com/android/compatibility/AppCrawlerCompatibilityTest.java index bb239c2..5c0fe11 100644 --- a/harness/src/main/java/com/android/compatibility/AppCrawlerCompatibilityTest.java +++ b/harness/src/main/java/com/android/compatibility/AppCrawlerCompatibilityTest.java @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License + * limitations under the License. */ package com.android.compatibility; @@ -65,7 +65,7 @@ public final class AppCrawlerCompatibilityTest extends AppCompatibilityTest { instrTest.addInstrumentationArg(WALKMAN_RUN_MS_LABEL, Integer.toString(mWalkmanRunMs)); instrTest.addInstrumentationArg(WALKMAN_STEPS_LABEL, Integer.toString(mWalkmanSteps)); - String launcherClass = launcherPackage + ".WalkmanInstrumentationEntry"; + String launcherClass = mLauncherPackage + ".WalkmanInstrumentationEntry"; instrTest.setClassName(launcherClass); /* * InstrumentationTest can't deduce the exact test to run, so we specify it diff --git a/harness/src/main/java/com/android/compatibility/AppLaunchCompatibilityTest.java b/harness/src/main/java/com/android/compatibility/AppLaunchCompatibilityTest.java index 8592980..dd1f648 100644 --- a/harness/src/main/java/com/android/compatibility/AppLaunchCompatibilityTest.java +++ b/harness/src/main/java/com/android/compatibility/AppLaunchCompatibilityTest.java @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License + * limitations under the License. */ package com.android.compatibility; diff --git a/harness/src/main/java/com/android/compatibility/FailureCollectingListener.java b/harness/src/main/java/com/android/compatibility/FailureCollectingListener.java index 92434b3..d022231 100644 --- a/harness/src/main/java/com/android/compatibility/FailureCollectingListener.java +++ b/harness/src/main/java/com/android/compatibility/FailureCollectingListener.java @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License + * limitations under the License. */ package com.android.compatibility; diff --git a/harness/src/main/java/com/android/compatibility/targetprep/AppSetupPreparer.java b/harness/src/main/java/com/android/compatibility/targetprep/AppSetupPreparer.java index a929bfd..b742c2f 100644 --- a/harness/src/main/java/com/android/compatibility/targetprep/AppSetupPreparer.java +++ b/harness/src/main/java/com/android/compatibility/targetprep/AppSetupPreparer.java @@ -33,10 +33,8 @@ import com.google.common.annotations.VisibleForTesting; import java.io.File; import java.io.IOException; - import java.nio.file.Files; import java.nio.file.Paths; - import java.util.List; import java.util.stream.Collectors; @@ -48,7 +46,7 @@ public final class AppSetupPreparer implements ITargetPreparer { @Option(name = "package-name", description = "Package name of the app being tested.") private String mPackageName; - private final TestAppInstallSetup appInstallSetup; + private final TestAppInstallSetup mAppInstallSetup; public AppSetupPreparer() { this(null, new TestAppInstallSetup()); @@ -57,7 +55,7 @@ public final class AppSetupPreparer implements ITargetPreparer { @VisibleForTesting public AppSetupPreparer(String packageName, TestAppInstallSetup appInstallSetup) { this.mPackageName = packageName; - this.appInstallSetup = appInstallSetup; + this.mAppInstallSetup = appInstallSetup; } /** {@inheritDoc} */ @@ -78,7 +76,7 @@ public final class AppSetupPreparer implements ITargetPreparer { packageDir.isDirectory(), String.format("Package directory %s is not a directory", packageDir)); - appInstallSetup.setAltDir(packageDir); + mAppInstallSetup.setAltDir(packageDir); List<String> apkFilePaths; try { @@ -94,18 +92,18 @@ public final class AppSetupPreparer implements ITargetPreparer { } if (apkFilePaths.size() == 1) { - appInstallSetup.addTestFileName(apkFilePaths.get(0)); + mAppInstallSetup.addTestFileName(apkFilePaths.get(0)); } else { - appInstallSetup.addSplitApkFileNames(String.join(",", apkFilePaths)); + mAppInstallSetup.addSplitApkFileNames(String.join(",", apkFilePaths)); } - appInstallSetup.setUp(device, buildInfo); + mAppInstallSetup.setUp(device, buildInfo); } /** {@inheritDoc} */ @Override public void tearDown(TestInformation testInfo, Throwable e) throws DeviceNotAvailableException { - appInstallSetup.tearDown(testInfo, e); + mAppInstallSetup.tearDown(testInfo, e); } private List<String> listApkFilePaths(File downloadDir) throws IOException { @@ -114,4 +112,4 @@ public final class AppSetupPreparer implements ITargetPreparer { .filter(s -> s.endsWith(".apk")) .collect(Collectors.toList()); } - } +} diff --git a/harness/src/main/java/com/android/compatibility/targetprep/AppSetupPreparerConfigurationReceiver.java b/harness/src/main/java/com/android/compatibility/targetprep/AppSetupPreparerConfigurationReceiver.java index ffdae37..7e50f3f 100644 --- a/harness/src/main/java/com/android/compatibility/targetprep/AppSetupPreparerConfigurationReceiver.java +++ b/harness/src/main/java/com/android/compatibility/targetprep/AppSetupPreparerConfigurationReceiver.java @@ -20,7 +20,9 @@ import com.android.tradefed.build.IBuildInfo; import com.android.tradefed.config.Option; import com.android.tradefed.device.ITestDevice; import com.android.tradefed.targetprep.ITargetPreparer; + import com.google.common.annotations.VisibleForTesting; + import java.io.File; /** diff --git a/harness/src/main/java/com/android/compatibility/testtype/AppLaunchTest.java b/harness/src/main/java/com/android/compatibility/testtype/AppLaunchTest.java index 75b165a..fb34dbf 100644 --- a/harness/src/main/java/com/android/compatibility/testtype/AppLaunchTest.java +++ b/harness/src/main/java/com/android/compatibility/testtype/AppLaunchTest.java @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License + * limitations under the License. */ package com.android.compatibility.testtype; @@ -37,8 +37,8 @@ import com.android.tradefed.result.LogDataType; import com.android.tradefed.result.TestDescription; import com.android.tradefed.testtype.IDeviceTest; import com.android.tradefed.testtype.IRemoteTest; -import com.android.tradefed.testtype.InstrumentationTest; import com.android.tradefed.testtype.ITestFilterReceiver; +import com.android.tradefed.testtype.InstrumentationTest; import com.android.tradefed.util.CommandResult; import com.android.tradefed.util.CommandStatus; import com.android.tradefed.util.StreamUtil; @@ -53,8 +53,8 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Collections; import java.util.HashMap; -import java.util.Set; import java.util.HashSet; +import java.util.Set; /** A test that verifies that a single app can be successfully launched. */ public class AppLaunchTest @@ -66,6 +66,7 @@ public class AppLaunchTest @Option(name = "test-label", description = "Unique test identifier label.") private String mTestLabel = "AppCompatibility"; + /** @deprecated */ @Deprecated @Option( name = "retry-count", @@ -142,7 +143,7 @@ public class AppLaunchTest if (!inFilter(testDescription.toString())) { CLog.d("Test case %s doesn't match any filter", testDescription); return; - } + } CLog.d("Complete filtering test case: %s", testDescription); long start = System.currentTimeMillis(); @@ -150,7 +151,7 @@ public class AppLaunchTest mLogcat = new LogcatReceiver(getDevice(), LOGCAT_SIZE_BYTES, 0); mLogcat.start(); - try { + try { testPackage(testInfo, testDescription, listener); } catch (InterruptedException e) { CLog.e(e); @@ -159,7 +160,7 @@ public class AppLaunchTest mLogcat.stop(); listener.testRunEnded( System.currentTimeMillis() - start, new HashMap<String, Metric>()); - } + } } /** @@ -289,7 +290,7 @@ public class AppLaunchTest listener.testLog("logcat_" + result.packageName, LogDataType.LOGCAT, stream); } finally { StreamUtil.cancel(stream); - } + } } /** @@ -412,4 +413,4 @@ public class AppLaunchTest public Set<String> getExcludeFilters() { return Collections.unmodifiableSet(mExcludeFilters); } - } +} diff --git a/harness/src/main/java/com/android/tradefed/result/CompatibilityTestResult.java b/harness/src/main/java/com/android/tradefed/result/CompatibilityTestResult.java index 5a4b970..e1f92b9 100644 --- a/harness/src/main/java/com/android/tradefed/result/CompatibilityTestResult.java +++ b/harness/src/main/java/com/android/tradefed/result/CompatibilityTestResult.java @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License + * limitations under the License. */ package com.android.tradefed.result; diff --git a/harness/src/main/java/com/android/tradefed/util/PublicApkUtil.java b/harness/src/main/java/com/android/tradefed/util/PublicApkUtil.java index 65b5947..3e2915e 100644 --- a/harness/src/main/java/com/android/tradefed/util/PublicApkUtil.java +++ b/harness/src/main/java/com/android/tradefed/util/PublicApkUtil.java @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License + * limitations under the License. */ package com.android.tradefed.util; @@ -221,5 +221,5 @@ public class PublicApkUtil { "Package: %s v%s (%s), rank: %d, file: %s", packageName, versionCode, versionString, rank, fileName); } - } } +} diff --git a/harness/src/test/java/com/android/compatibility/AppCompatibilityTestTest.java b/harness/src/test/java/com/android/compatibility/AppCompatibilityTestTest.java index 780dfe5..18f3368 100644 --- a/harness/src/test/java/com/android/compatibility/AppCompatibilityTestTest.java +++ b/harness/src/test/java/com/android/compatibility/AppCompatibilityTestTest.java @@ -37,11 +37,11 @@ import java.util.TreeSet; @RunWith(JUnit4.class) public final class AppCompatibilityTestTest { - private ConcreteAppCompatibilityTest sut; + private ConcreteAppCompatibilityTest mSut; private class ConcreteAppCompatibilityTest extends AppCompatibilityTest { - public ConcreteAppCompatibilityTest() { + ConcreteAppCompatibilityTest() { super(null, null, null); } @@ -53,29 +53,29 @@ public final class AppCompatibilityTestTest { @Before public void setUp() { - sut = new ConcreteAppCompatibilityTest(); + mSut = new ConcreteAppCompatibilityTest(); } @Test(expected = IllegalArgumentException.class) public void addIncludeFilter_nullIncludeFilter_throwsException() { - sut.addIncludeFilter(null); + mSut.addIncludeFilter(null); } @Test(expected = IllegalArgumentException.class) public void addIncludeFilter_emptyIncludeFilter_throwsException() { - sut.addIncludeFilter(""); + mSut.addIncludeFilter(""); } @Test public void addIncludeFilter_validIncludeFilter() { - sut.addIncludeFilter("test_filter"); + mSut.addIncludeFilter("test_filter"); - assertTrue(sut.mIncludeFilters.contains("test_filter")); + assertTrue(mSut.mIncludeFilters.contains("test_filter")); } @Test(expected = NullPointerException.class) public void addAllIncludeFilters_nullIncludeFilter_throwsException() { - sut.addAllIncludeFilters(null); + mSut.addAllIncludeFilters(null); } @Test @@ -84,48 +84,48 @@ public final class AppCompatibilityTestTest { test_filters.add("filter_one"); test_filters.add("filter_two"); - sut.addAllIncludeFilters(test_filters); + mSut.addAllIncludeFilters(test_filters); - assertTrue(sut.mIncludeFilters.contains("filter_one")); - assertTrue(sut.mIncludeFilters.contains("filter_two")); + assertTrue(mSut.mIncludeFilters.contains("filter_one")); + assertTrue(mSut.mIncludeFilters.contains("filter_two")); } @Test public void clearIncludeFilters() { - sut.addIncludeFilter("filter_test"); + mSut.addIncludeFilter("filter_test"); - sut.clearIncludeFilters(); + mSut.clearIncludeFilters(); - assertTrue(sut.mIncludeFilters.isEmpty()); + assertTrue(mSut.mIncludeFilters.isEmpty()); } @Test public void getIncludeFilters() { - sut.addIncludeFilter("filter_test"); + mSut.addIncludeFilter("filter_test"); - assertEquals(sut.mIncludeFilters, sut.getIncludeFilters()); + assertEquals(mSut.mIncludeFilters, mSut.getIncludeFilters()); } @Test(expected = IllegalArgumentException.class) public void addExcludeFilter_nullExcludeFilter_throwsException() { - sut.addExcludeFilter(null); + mSut.addExcludeFilter(null); } @Test(expected = IllegalArgumentException.class) public void addExcludeFilter_emptyExcludeFilter_throwsException() { - sut.addExcludeFilter(""); + mSut.addExcludeFilter(""); } @Test public void addExcludeFilter_validExcludeFilter() { - sut.addExcludeFilter("test_filter"); + mSut.addExcludeFilter("test_filter"); - assertTrue(sut.mExcludeFilters.contains("test_filter")); + assertTrue(mSut.mExcludeFilters.contains("test_filter")); } @Test(expected = NullPointerException.class) public void addAllExcludeFilters_nullExcludeFilters_throwsException() { - sut.addAllExcludeFilters(null); + mSut.addAllExcludeFilters(null); } @Test @@ -134,33 +134,33 @@ public final class AppCompatibilityTestTest { test_filters.add("filter_one"); test_filters.add("filter_two"); - sut.addAllExcludeFilters(test_filters); + mSut.addAllExcludeFilters(test_filters); - assertTrue(sut.mExcludeFilters.contains("filter_one")); - assertTrue(sut.mExcludeFilters.contains("filter_two")); + assertTrue(mSut.mExcludeFilters.contains("filter_one")); + assertTrue(mSut.mExcludeFilters.contains("filter_two")); } @Test public void clearExcludeFilters() { - sut.addExcludeFilter("filter_test"); + mSut.addExcludeFilter("filter_test"); - sut.clearExcludeFilters(); + mSut.clearExcludeFilters(); - assertTrue(sut.mExcludeFilters.isEmpty()); + assertTrue(mSut.mExcludeFilters.isEmpty()); } @Test public void getExcludeFilters() { - sut.addExcludeFilter("filter_test"); + mSut.addExcludeFilter("filter_test"); - assertEquals(sut.mExcludeFilters, sut.getExcludeFilters()); + assertEquals(mSut.mExcludeFilters, mSut.getExcludeFilters()); } @Test public void filterApk_withNoFilter() { List<ApkInfo> testList = createApkList(); - List<ApkInfo> filteredList = sut.filterApk(testList); + List<ApkInfo> filteredList = mSut.filterApk(testList); assertEquals(filteredList, testList); } @@ -168,9 +168,9 @@ public final class AppCompatibilityTestTest { @Test public void filterApk_withRelatedIncludeFilters() { List<ApkInfo> testList = createApkList(); - sut.addIncludeFilter("filter_one"); + mSut.addIncludeFilter("filter_one"); - List<ApkInfo> filteredList = sut.filterApk(testList); + List<ApkInfo> filteredList = mSut.filterApk(testList); assertEquals(convertList(filteredList), Arrays.asList("filter_one")); } @@ -178,9 +178,9 @@ public final class AppCompatibilityTestTest { @Test public void filterApk_withUnrelatedIncludeFilters() { List<ApkInfo> testList = createApkList(); - sut.addIncludeFilter("filter_three"); + mSut.addIncludeFilter("filter_three"); - List<ApkInfo> filteredList = sut.filterApk(testList); + List<ApkInfo> filteredList = mSut.filterApk(testList); assertTrue(filteredList.isEmpty()); } @@ -188,9 +188,9 @@ public final class AppCompatibilityTestTest { @Test public void filterApk_withRelatedExcludeFilters() { List<ApkInfo> testList = createApkList(); - sut.addExcludeFilter("filter_one"); + mSut.addExcludeFilter("filter_one"); - List<ApkInfo> filteredList = sut.filterApk(testList); + List<ApkInfo> filteredList = mSut.filterApk(testList); assertEquals(convertList(filteredList), Arrays.asList("filter_two")); } @@ -198,9 +198,9 @@ public final class AppCompatibilityTestTest { @Test public void filterApk_withUnrelatedExcludeFilters() { List<ApkInfo> testList = createApkList(); - sut.addExcludeFilter("filter_three"); + mSut.addExcludeFilter("filter_three"); - List<ApkInfo> filteredList = sut.filterApk(testList); + List<ApkInfo> filteredList = mSut.filterApk(testList); assertEquals(filteredList, testList); } @@ -208,10 +208,10 @@ public final class AppCompatibilityTestTest { @Test public void filterApk_withSameIncludeAndExcludeFilters() { List<ApkInfo> testList = createApkList(); - sut.addIncludeFilter("filter_one"); - sut.addExcludeFilter("filter_one"); + mSut.addIncludeFilter("filter_one"); + mSut.addExcludeFilter("filter_one"); - List<ApkInfo> filteredList = sut.filterApk(testList); + List<ApkInfo> filteredList = mSut.filterApk(testList); assertTrue(filteredList.isEmpty()); } @@ -219,11 +219,11 @@ public final class AppCompatibilityTestTest { @Test public void filterApk_withDifferentIncludeAndExcludeFilter() { List<ApkInfo> testList = createApkList(); - sut.addIncludeFilter("filter_one"); - sut.addIncludeFilter("filter_two"); - sut.addExcludeFilter("filter_two"); + mSut.addIncludeFilter("filter_one"); + mSut.addIncludeFilter("filter_two"); + mSut.addExcludeFilter("filter_two"); - List<ApkInfo> filteredList = sut.filterApk(testList); + List<ApkInfo> filteredList = mSut.filterApk(testList); assertEquals(convertList(filteredList), Arrays.asList("filter_one")); } @@ -231,10 +231,10 @@ public final class AppCompatibilityTestTest { @Test public void filterApk_withUnrelatedIncludeFilterAndRelatedExcludeFilter() { List<ApkInfo> testList = createApkList(); - sut.addIncludeFilter("filter_three"); - sut.addExcludeFilter("filter_two"); + mSut.addIncludeFilter("filter_three"); + mSut.addExcludeFilter("filter_two"); - List<ApkInfo> filteredList = sut.filterApk(testList); + List<ApkInfo> filteredList = mSut.filterApk(testList); assertTrue(filteredList.isEmpty()); } @@ -242,10 +242,10 @@ public final class AppCompatibilityTestTest { @Test public void filterApk_withRelatedIncludeFilterAndUnrelatedExcludeFilter() { List<ApkInfo> testList = createApkList(); - sut.addIncludeFilter("filter_one"); - sut.addExcludeFilter("filter_three"); + mSut.addIncludeFilter("filter_one"); + mSut.addExcludeFilter("filter_three"); - List<ApkInfo> filteredList = sut.filterApk(testList); + List<ApkInfo> filteredList = mSut.filterApk(testList); assertEquals(convertList(filteredList), Arrays.asList("filter_one")); } @@ -269,66 +269,66 @@ public final class AppCompatibilityTestTest { @Test public void filterTest_withEmptyFilter() { - assertTrue(sut.filterTest("filter_one")); + assertTrue(mSut.filterTest("filter_one")); } @Test public void filterTest_withRelatedIncludeFilter() { - sut.addIncludeFilter("filter_one"); + mSut.addIncludeFilter("filter_one"); - assertTrue(sut.filterTest("filter_one")); + assertTrue(mSut.filterTest("filter_one")); } @Test public void filterTest_withUnrelatedIncludeFilter() { - sut.addIncludeFilter("filter_two"); + mSut.addIncludeFilter("filter_two"); - assertFalse(sut.filterTest("filter_one")); + assertFalse(mSut.filterTest("filter_one")); } @Test public void filterTest_withRelatedExcludeFilter() { - sut.addExcludeFilter("filter_one"); + mSut.addExcludeFilter("filter_one"); - assertFalse(sut.filterTest("filter_one")); + assertFalse(mSut.filterTest("filter_one")); } @Test public void filterTest_withUnrelatedExcludeFilter() { - sut.addExcludeFilter("filter_two"); + mSut.addExcludeFilter("filter_two"); - assertTrue(sut.filterTest("filter_one")); + assertTrue(mSut.filterTest("filter_one")); } @Test public void filterTest_withSameIncludeAndExcludeFilters() { - sut.addIncludeFilter("filter_one"); - sut.addExcludeFilter("filter_one"); + mSut.addIncludeFilter("filter_one"); + mSut.addExcludeFilter("filter_one"); - assertFalse(sut.filterTest("filter_one")); + assertFalse(mSut.filterTest("filter_one")); } @Test public void filterTest_withUnrelatedIncludeFilterAndRelatedExcludeFilter() { - sut.addIncludeFilter("filter_one"); - sut.addExcludeFilter("filter_two"); + mSut.addIncludeFilter("filter_one"); + mSut.addExcludeFilter("filter_two"); - assertFalse(sut.filterTest("filter_two")); + assertFalse(mSut.filterTest("filter_two")); } @Test public void filterTest_withRelatedIncludeFilterAndUnrelatedExcludeFilter() { - sut.addIncludeFilter("filter_one"); - sut.addExcludeFilter("filter_two"); + mSut.addIncludeFilter("filter_one"); + mSut.addExcludeFilter("filter_two"); - assertTrue(sut.filterTest("filter_one")); + assertTrue(mSut.filterTest("filter_one")); } @Test public void filterTest_withUnRelatedIncludeFilterAndUnrelatedExcludeFilter() { - sut.addIncludeFilter("filter_one"); - sut.addExcludeFilter("filter_two"); + mSut.addIncludeFilter("filter_one"); + mSut.addExcludeFilter("filter_two"); - assertFalse(sut.filterTest("filter_three")); + assertFalse(mSut.filterTest("filter_three")); } - } +} diff --git a/harness/src/test/java/com/android/compatibility/CSuiteUnitTests.java b/harness/src/test/java/com/android/compatibility/CSuiteUnitTests.java index 010bca8..b87402e 100644 --- a/harness/src/test/java/com/android/compatibility/CSuiteUnitTests.java +++ b/harness/src/test/java/com/android/compatibility/CSuiteUnitTests.java @@ -15,8 +15,8 @@ */ package com.android.compatibility; -import com.android.compatibility.targetprep.AppSetupPreparerTest; import com.android.compatibility.targetprep.AppSetupPreparerConfigurationReceiverTest; +import com.android.compatibility.targetprep.AppSetupPreparerTest; import com.android.compatibility.testtype.AppLaunchTestTest; import org.junit.runner.RunWith; diff --git a/harness/src/test/java/com/android/compatibility/targetprep/AppSetupPreparerConfigurationReceiverTest.java b/harness/src/test/java/com/android/compatibility/targetprep/AppSetupPreparerConfigurationReceiverTest.java index 1879d2c..e708a67 100644 --- a/harness/src/test/java/com/android/compatibility/targetprep/AppSetupPreparerConfigurationReceiverTest.java +++ b/harness/src/test/java/com/android/compatibility/targetprep/AppSetupPreparerConfigurationReceiverTest.java @@ -15,14 +15,16 @@ */ package com.android.compatibility.targetprep; -import com.android.tradefed.build.IBuildInfo; import com.android.tradefed.build.BuildInfo; +import com.android.tradefed.build.IBuildInfo; + +import static com.google.common.truth.Truth.assertThat; + import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -import java.io.File; -import static com.google.common.truth.Truth.assertThat; +import java.io.File; @RunWith(JUnit4.class) public final class AppSetupPreparerConfigurationReceiverTest { diff --git a/harness/src/test/java/com/android/compatibility/targetprep/AppSetupPreparerTest.java b/harness/src/test/java/com/android/compatibility/targetprep/AppSetupPreparerTest.java index b154adb..7614f05 100644 --- a/harness/src/test/java/com/android/compatibility/targetprep/AppSetupPreparerTest.java +++ b/harness/src/test/java/com/android/compatibility/targetprep/AppSetupPreparerTest.java @@ -15,22 +15,20 @@ */ package com.android.compatibility.targetprep; -import static org.testng.Assert.assertThrows; - -import static org.mockito.ArgumentMatchers.any; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -import com.android.tradefed.build.IBuildInfo; import com.android.tradefed.build.BuildInfo; +import com.android.tradefed.build.IBuildInfo; import com.android.tradefed.device.DeviceNotAvailableException; import com.android.tradefed.device.ITestDevice; import com.android.tradefed.invoker.TestInformation; import com.android.tradefed.targetprep.TargetSetupError; import com.android.tradefed.targetprep.TestAppInstallSetup; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.testng.Assert.assertThrows; + import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -51,16 +49,16 @@ public class AppSetupPreparerTest { @Rule public final TemporaryFolder tempFolder = new TemporaryFolder(); private final IBuildInfo mBuildInfo = new BuildInfo(); - private final TestAppInstallSetup mockAppInstallSetup = mock(TestAppInstallSetup.class); - private final AppSetupPreparer preparer = - new AppSetupPreparer("package_name", mockAppInstallSetup); + private final TestAppInstallSetup mMockAppInstallSetup = mock(TestAppInstallSetup.class); + private final AppSetupPreparer mPreparer = + new AppSetupPreparer("package_name", mMockAppInstallSetup); @Test public void setUp_gcsApkDirIsNull_throwsException() throws DeviceNotAvailableException, TargetSetupError { mBuildInfo.addBuildAttribute(OPTION_GCS_APK_DIR, null); - assertThrows(NullPointerException.class, () -> preparer.setUp(NULL_DEVICE, mBuildInfo)); + assertThrows(NullPointerException.class, () -> mPreparer.setUp(NULL_DEVICE, mBuildInfo)); } @Test @@ -69,7 +67,8 @@ public class AppSetupPreparerTest { File tempFile = tempFolder.newFile("temp_file_name"); mBuildInfo.addBuildAttribute(OPTION_GCS_APK_DIR, tempFile.getPath()); - assertThrows(IllegalArgumentException.class, () -> preparer.setUp(NULL_DEVICE, mBuildInfo)); + assertThrows( + IllegalArgumentException.class, () -> mPreparer.setUp(NULL_DEVICE, mBuildInfo)); } @Test @@ -78,7 +77,8 @@ public class AppSetupPreparerTest { File gcsApkDir = tempFolder.newFolder("gcs_apk_dir"); mBuildInfo.addBuildAttribute(OPTION_GCS_APK_DIR, gcsApkDir.getPath()); - assertThrows(IllegalArgumentException.class, () -> preparer.setUp(NULL_DEVICE, mBuildInfo)); + assertThrows( + IllegalArgumentException.class, () -> mPreparer.setUp(NULL_DEVICE, mBuildInfo)); } @Test @@ -87,7 +87,7 @@ public class AppSetupPreparerTest { createPackageFile(gcsApkDir, "package_name", "non_apk_file"); mBuildInfo.addBuildAttribute(OPTION_GCS_APK_DIR, gcsApkDir.getPath()); - assertThrows(TargetSetupError.class, () -> preparer.setUp(NULL_DEVICE, mBuildInfo)); + assertThrows(TargetSetupError.class, () -> mPreparer.setUp(NULL_DEVICE, mBuildInfo)); } @Test @@ -98,11 +98,11 @@ public class AppSetupPreparerTest { createPackageFile(gcsApkDir, "package_name", "apk_name_2.apk"); mBuildInfo.addBuildAttribute(OPTION_GCS_APK_DIR, gcsApkDir.getPath()); - preparer.setUp(NULL_DEVICE, mBuildInfo); + mPreparer.setUp(NULL_DEVICE, mBuildInfo); - verify(mockAppInstallSetup).setAltDir(packageDir); - verify(mockAppInstallSetup).addSplitApkFileNames("apk_name_2.apk,apk_name_1.apk"); - verify(mockAppInstallSetup).setUp(any(), any()); + verify(mMockAppInstallSetup).setAltDir(packageDir); + verify(mMockAppInstallSetup).addSplitApkFileNames("apk_name_2.apk,apk_name_1.apk"); + verify(mMockAppInstallSetup).setUp(any(), any()); } @Test @@ -112,25 +112,27 @@ public class AppSetupPreparerTest { createPackageFile(gcsApkDir, "package_name", "apk_name_1.apk"); mBuildInfo.addBuildAttribute(OPTION_GCS_APK_DIR, gcsApkDir.getPath()); - preparer.setUp(NULL_DEVICE, mBuildInfo); + mPreparer.setUp(NULL_DEVICE, mBuildInfo); - verify(mockAppInstallSetup).setAltDir(packageDir); - verify(mockAppInstallSetup).addTestFileName("apk_name_1.apk"); - verify(mockAppInstallSetup).setUp(any(), any()); + verify(mMockAppInstallSetup).setAltDir(packageDir); + verify(mMockAppInstallSetup).addTestFileName("apk_name_1.apk"); + verify(mMockAppInstallSetup).setUp(any(), any()); } @Test public void tearDown() throws Exception { TestInformation testInfo = TestInformation.newBuilder().build(); - preparer.tearDown(testInfo, null); + mPreparer.tearDown(testInfo, null); - verify(mockAppInstallSetup, times(1)).tearDown(testInfo, null); + verify(mMockAppInstallSetup, times(1)).tearDown(testInfo, null); } private File createPackageFile(File parentDir, String packageName, String apkName) throws IOException { - File packageDir = Files.createDirectories(Paths.get(parentDir.getAbsolutePath(), packageName)).toFile(); + File packageDir = + Files.createDirectories(Paths.get(parentDir.getAbsolutePath(), packageName)) + .toFile(); return Files.createFile(Paths.get(packageDir.getAbsolutePath(), apkName)).toFile(); } diff --git a/harness/src/test/java/com/android/compatibility/testtype/AppLaunchTestTest.java b/harness/src/test/java/com/android/compatibility/testtype/AppLaunchTestTest.java index c1da259..4f9aa35 100644 --- a/harness/src/test/java/com/android/compatibility/testtype/AppLaunchTestTest.java +++ b/harness/src/test/java/com/android/compatibility/testtype/AppLaunchTestTest.java @@ -15,41 +15,39 @@ */ package com.android.compatibility.testtype; +import com.android.tradefed.device.DeviceNotAvailableException; +import com.android.tradefed.device.ITestDevice; +import com.android.tradefed.invoker.TestInformation; +import com.android.tradefed.metrics.proto.MetricMeasurement.Metric; +import com.android.tradefed.result.ITestInvocationListener; +import com.android.tradefed.result.TestDescription; +import com.android.tradefed.testtype.InstrumentationTest; +import com.android.tradefed.util.CommandResult; +import com.android.tradefed.util.CommandStatus; + import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; - +import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyObject; import static org.mockito.ArgumentMatchers.anyString; - import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.when; -import com.android.tradefed.device.DeviceNotAvailableException; -import com.android.tradefed.device.ITestDevice; -import com.android.tradefed.invoker.TestInformation; -import com.android.tradefed.metrics.proto.MetricMeasurement.Metric; -import com.android.tradefed.result.ITestInvocationListener; -import com.android.tradefed.result.TestDescription; -import com.android.tradefed.testtype.InstrumentationTest; -import com.android.tradefed.util.CommandResult; -import com.android.tradefed.util.CommandStatus; - -import java.util.Map; -import java.util.HashMap; -import java.util.Set; -import java.util.HashSet; - -import org.mockito.InOrder; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; +import org.mockito.InOrder; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; @RunWith(JUnit4.class) public final class AppLaunchTestTest { @@ -355,16 +353,16 @@ public final class AppLaunchTestTest { private InstrumentationTest createPassingInstrumentationTestAfterFailing(int failedCount) { InstrumentationTest instrumentation = new InstrumentationTest() { - private int retryCount = 0; + private int mRetryCount = 0; @Override public void run( final TestInformation testInfo, final ITestInvocationListener listener) throws DeviceNotAvailableException { - if (retryCount < failedCount) { + if (mRetryCount < failedCount) { listener.testFailed(new TestDescription("", ""), "test failed"); } - retryCount++; + mRetryCount++; } }; return instrumentation; @@ -432,4 +430,4 @@ public final class AppLaunchTestTest { .testEnded(anyObject(), anyLong(), (Map<String, String>) any()); inOrder.verify(listener, times(1)).testRunEnded(anyLong(), (HashMap<String, Metric>) any()); } - } +} diff --git a/instrumentation/launch/Android.bp b/instrumentation/launch/Android.bp index efa882e..22255f6 100644 --- a/instrumentation/launch/Android.bp +++ b/instrumentation/launch/Android.bp @@ -20,6 +20,6 @@ android_test { platform_apis: true, manifest: "src/main/AndroidManifest.xml", test_suites: [ - "csuite" + "csuite", ], } diff --git a/instrumentation/launch/src/main/java/com/android/compatibilitytest/AppCompatibility.java b/instrumentation/launch/src/main/java/com/android/compatibilitytest/AppCompatibility.java index d1fbc8a..5918a62 100644 --- a/instrumentation/launch/src/main/java/com/android/compatibilitytest/AppCompatibility.java +++ b/instrumentation/launch/src/main/java/com/android/compatibilitytest/AppCompatibility.java @@ -176,7 +176,8 @@ public final class AppCompatibility { "app package \"" + packageName + "\" no longer found in running " - + "tasks, but no explicit crashes were detected; check logcat for details", + + "tasks, but no explicit crashes were detected; check logcat for " + + "details", processStillUp(packageName)); } finally { returnHome(); @@ -188,7 +189,7 @@ public final class AppCompatibility { + PACKAGE_TO_LAUNCH + " to specify the package to launch"); } - } + } /** * Truncate the text to at most the specified number of lines, and append a marker at the end diff --git a/instrumentation/launch/src/main/java/com/android/compatibilitytest/AppCompatibilityRunner.java b/instrumentation/launch/src/main/java/com/android/compatibilitytest/AppCompatibilityRunner.java index 960ea49..943cea9 100644 --- a/instrumentation/launch/src/main/java/com/android/compatibilitytest/AppCompatibilityRunner.java +++ b/instrumentation/launch/src/main/java/com/android/compatibilitytest/AppCompatibilityRunner.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, The Android Open Source Project + * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tools/csuite-tradefed/Android.bp b/tools/csuite-tradefed/Android.bp new file mode 100644 index 0000000..82d959e --- /dev/null +++ b/tools/csuite-tradefed/Android.bp @@ -0,0 +1,37 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +tradefed_binary_host { + name: "csuite-tradefed", + wrapper: "src/scripts/csuite-tradefed", + short_name: "CSUITE", + full_name: "App Compatibility Test Suite", + version: "1.0", + static_libs: [ + "cts-tradefed-harness", + "csuite-harness", + ], +} + +java_test_host { + name: "csuite-tradefed-tests", + srcs: [ + "src/test/java/**/*.java", + ], + static_libs: [ + "tradefed", + "csuite-tradefed", + ], + test_suites: ["general-tests"], +} diff --git a/tools/csuite-tradefed/Android.mk b/tools/csuite-tradefed/Android.mk deleted file mode 100644 index 654fac7..0000000 --- a/tools/csuite-tradefed/Android.mk +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright (C) 2019 The Android Open Source Project. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := optional - -LOCAL_PREBUILT_EXECUTABLES := src/scripts/csuite-tradefed -include $(BUILD_HOST_PREBUILT) - -############################ -# csuite-tradefed -############################ - -include $(CLEAR_VARS) - -LOCAL_SUITE_BUILD_NUMBER := $(BUILD_NUMBER_FROM_FILE) -LOCAL_SUITE_TARGET_ARCH := $(TARGET_ARCH) -LOCAL_SUITE_NAME := CSUITE -LOCAL_SUITE_FULLNAME := "App Compatibility Test Suite" -LOCAL_SUITE_VERSION := 1.0 - -LOCAL_STATIC_JAVA_LIBRARIES := cts-tradefed-harness csuite-harness -LOCAL_MODULE := csuite-tradefed - -include $(BUILD_COMPATIBILITY_SUITE) - -############################ -# csuite-tradefed-tests -############################ - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES += $(call all-java-files-under, src/test/java) - -LOCAL_MODULE := csuite-tradefed-tests -LOCAL_MODULE_TAGS := optional -LOCAL_STATIC_JAVA_LIBRARIES := tradefed csuite-tradefed -LOCAL_COMPATIBILITY_SUITE := general-tests - -include $(BUILD_HOST_JAVA_LIBRARY) diff --git a/tools/csuite-tradefed/src/test/java/com/android/compatibility/tradefed/CSuiteTradefedTest.java b/tools/csuite-tradefed/src/test/java/com/android/compatibility/tradefed/CSuiteTradefedTest.java index fbbf98d..709798b 100644 --- a/tools/csuite-tradefed/src/test/java/com/android/compatibility/tradefed/CSuiteTradefedTest.java +++ b/tools/csuite-tradefed/src/test/java/com/android/compatibility/tradefed/CSuiteTradefedTest.java @@ -40,7 +40,7 @@ public class CSuiteTradefedTest { private static final String SUITE_FULL_NAME = "App Compatibility Test Suite"; private static final String SUITE_NAME = "C-Suite"; - private CompatibilityBuildProvider provider; + private CompatibilityBuildProvider mProvider; @Before public void setUp() throws Exception { @@ -48,7 +48,7 @@ public class CSuiteTradefedTest { File base = tempFolder.newFolder("android-csuite"); File tests = tempFolder.newFolder("testcases"); - provider = + mProvider = new CompatibilityBuildProvider() { @Override protected String getSuiteInfoName() { @@ -64,7 +64,7 @@ public class CSuiteTradefedTest { @Test public void testSuiteInfoLoad() throws Exception { - CompatibilityBuildHelper helper = new CompatibilityBuildHelper(provider.getBuild()); + CompatibilityBuildHelper helper = new CompatibilityBuildHelper(mProvider.getBuild()); assertEquals("Incorrect suite full name", SUITE_FULL_NAME, helper.getSuiteFullName()); assertEquals("Incorrect suite name", SUITE_NAME, helper.getSuiteName()); } @@ -73,4 +73,4 @@ public class CSuiteTradefedTest { public void cleanUp() throws Exception { System.clearProperty(ROOT_DIR_PROPERTY_NAME); } - } +} |