Fix Error Prone errors
Soong wasn't including android_app or android_test sources in the javac-check target used for the Error Prone build, which allowed some Error Prone errors to get in. Fix them so Error Prone can be re-enabled for these targets. Fixes: frameworks/base/core/tests/coretests/src/android/view/textclassifier/ActionsSuggestionsHelperTest.java:241: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility. frameworks/base/core/tests/systemproperties/src/android/os/SystemPropertiesTest.java:97: error: [JUnit3TestNotRun] Test method will not be run; please correct method signature (Should be public, non-static, and method name should begin with "test"). frameworks/base/services/tests/servicestests/src/com/android/server/backup/BackupManagerServiceTest.java:546: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility. frameworks/base/services/tests/servicestests/src/com/android/server/backup/BackupManagerServiceTest.java:557: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility. frameworks/base/services/tests/servicestests/src/com/android/server/backup/DataChangedJournalTest.java:139: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility. frameworks/base/services/tests/servicestests/src/com/android/server/backup/utils/FileUtilsTest.java:64: error: [CheckReturnValue] Ignored return value of method that is annotated with @CheckReturnValue frameworks/base/services/tests/servicestests/src/com/android/server/backup/utils/FileUtilsTest.java:68: error: [CheckReturnValue] Ignored return value of method that is annotated with @CheckReturnValue frameworks/base/services/tests/servicestests/src/com/android/server/backup/utils/FileUtilsTest.java:78: error: [CheckReturnValue] Ignored return value of method that is annotated with @CheckReturnValue frameworks/base/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java:537: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility. frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/NotificationHistoryManagerTest.java:127: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility. frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java:4505: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility. frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java:5770: error: [JUnit4TestNotRun] This looks like a test method but is not run; please add @Test and @Ignore, or, if this is a helper method, reduce its visibility. Bug: 146455923 Bug: 147012496 Bug: 147012298 Test: m RUN_ERROR_PRONE=true javac-check Change-Id: I829373d41c97962fe2122ea74cef12ba342ac33c
This commit is contained in:
@@ -238,6 +238,7 @@ public class ActionsSuggestionsHelperTest {
|
|||||||
assertThat(conversationActions).isEmpty();
|
assertThat(conversationActions).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void createLabeledIntentResult_null() {
|
public void createLabeledIntentResult_null() {
|
||||||
ActionsSuggestionsModel.ActionSuggestion nativeSuggestion =
|
ActionsSuggestionsModel.ActionSuggestion nativeSuggestion =
|
||||||
new ActionsSuggestionsModel.ActionSuggestion(
|
new ActionsSuggestionsModel.ActionSuggestion(
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public class SystemPropertiesTest extends TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SmallTest
|
@SmallTest
|
||||||
private static void testHandle() throws Exception {
|
public void testHandle() throws Exception {
|
||||||
String value;
|
String value;
|
||||||
SystemProperties.Handle handle = SystemProperties.find("doesnotexist_2341431");
|
SystemProperties.Handle handle = SystemProperties.find("doesnotexist_2341431");
|
||||||
assertNull(handle);
|
assertNull(handle);
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ import com.android.server.backup.utils.RandomAccessFileUtils;
|
|||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
@@ -543,6 +544,8 @@ public class BackupManagerServiceTest {
|
|||||||
verifyNoMoreInteractions(mUserBackupManagerService);
|
verifyNoMoreInteractions(mUserBackupManagerService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Ignore("b/147012496")
|
||||||
public void testGetUserForAncestralSerialNumber() {
|
public void testGetUserForAncestralSerialNumber() {
|
||||||
BackupManagerServiceTestable.sBackupDisabled = false;
|
BackupManagerServiceTestable.sBackupDisabled = false;
|
||||||
BackupManagerService backupManagerService =
|
BackupManagerService backupManagerService =
|
||||||
@@ -554,6 +557,7 @@ public class BackupManagerServiceTest {
|
|||||||
assertThat(user).isEqualTo(UserHandle.of(1));
|
assertThat(user).isEqualTo(UserHandle.of(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void testGetUserForAncestralSerialNumber_whenDisabled() {
|
public void testGetUserForAncestralSerialNumber_whenDisabled() {
|
||||||
BackupManagerServiceTestable.sBackupDisabled = true;
|
BackupManagerServiceTestable.sBackupDisabled = true;
|
||||||
BackupManagerService backupManagerService =
|
BackupManagerService backupManagerService =
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ public class DataChangedJournalTest {
|
|||||||
assertThat(mJournal.toString()).isEqualTo(mFile.toString());
|
assertThat(mJournal.toString()).isEqualTo(mFile.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void listJournals_invalidJournalFile_returnsEmptyList() throws Exception {
|
public void listJournals_invalidJournalFile_returnsEmptyList() throws Exception {
|
||||||
when(invalidFile.listFiles()).thenReturn(null);
|
when(invalidFile.listFiles()).thenReturn(null);
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import com.google.common.io.Files;
|
|||||||
|
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
@@ -41,11 +40,6 @@ public class FileUtilsTest {
|
|||||||
private static File sTemporaryDir;
|
private static File sTemporaryDir;
|
||||||
private File mTemporaryFile;
|
private File mTemporaryFile;
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void setUpClass() {
|
|
||||||
sTemporaryDir = Files.createTempDir();
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void tearDownClass() {
|
public static void tearDownClass() {
|
||||||
if (sTemporaryDir != null) {
|
if (sTemporaryDir != null) {
|
||||||
@@ -55,17 +49,21 @@ public class FileUtilsTest {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
if (sTemporaryDir != null) {
|
||||||
|
sTemporaryDir.delete();
|
||||||
|
}
|
||||||
|
sTemporaryDir = Files.createTempDir();
|
||||||
mTemporaryFile = new File(sTemporaryDir, "fileutilstest.txt");
|
mTemporaryFile = new File(sTemporaryDir, "fileutilstest.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Test that if file does not exist, {@link FileUtils#createNewFile()} creates the file. */
|
/** Test that if file does not exist, {@link FileUtils#createNewFile()} creates the file. */
|
||||||
@Test
|
@Test
|
||||||
public void testEnsureFileExists_fileDoesNotAlreadyExist_getsCreated() {
|
public void testEnsureFileExists_fileDoesNotAlreadyExist_getsCreated() {
|
||||||
assertThat(!mTemporaryFile.exists());
|
assertThat(mTemporaryFile.exists()).isFalse();
|
||||||
|
|
||||||
FileUtils.createNewFile(mTemporaryFile);
|
FileUtils.createNewFile(mTemporaryFile);
|
||||||
|
|
||||||
assertThat(mTemporaryFile.exists());
|
assertThat(mTemporaryFile.exists()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Test that if file does exist, {@link FileUtils#createNewFile()} does not error out. */
|
/** Test that if file does exist, {@link FileUtils#createNewFile()} does not error out. */
|
||||||
@@ -75,6 +73,6 @@ public class FileUtilsTest {
|
|||||||
|
|
||||||
FileUtils.createNewFile(mTemporaryFile);
|
FileUtils.createNewFile(mTemporaryFile);
|
||||||
|
|
||||||
assertThat(mTemporaryFile.exists());
|
assertThat(mTemporaryFile.exists()).isTrue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -534,6 +534,7 @@ public class HdmiCecLocalDeviceAudioSystemTest {
|
|||||||
assertThat(mNativeWrapper.getOnlyResultMessage()).isEqualTo(expectedMessage);
|
assertThat(mNativeWrapper.getOnlyResultMessage()).isEqualTo(expectedMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void handleSystemAudioModeRequest_fromNonTV_tVNotSupport() {
|
public void handleSystemAudioModeRequest_fromNonTV_tVNotSupport() {
|
||||||
HdmiCecMessage message =
|
HdmiCecMessage message =
|
||||||
HdmiCecMessageBuilder.buildSystemAudioModeRequest(
|
HdmiCecMessageBuilder.buildSystemAudioModeRequest(
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import androidx.test.runner.AndroidJUnit4;
|
|||||||
import com.android.server.UiServiceTestCase;
|
import com.android.server.UiServiceTestCase;
|
||||||
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.mockito.Mock;
|
import org.mockito.Mock;
|
||||||
@@ -124,6 +125,8 @@ public class NotificationHistoryManagerTest extends UiServiceTestCase {
|
|||||||
verify(mDb, times(1)).init();
|
verify(mDb, times(1)).init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Ignore("b/147012298")
|
||||||
public void testOnUserUnlocked_historyDisabled() {
|
public void testOnUserUnlocked_historyDisabled() {
|
||||||
Settings.Secure.putIntForUser(getContext().getContentResolver(),
|
Settings.Secure.putIntForUser(getContext().getContentResolver(),
|
||||||
Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0, USER_SYSTEM);
|
Settings.Secure.NOTIFICATION_HISTORY_ENABLED, 0, USER_SYSTEM);
|
||||||
|
|||||||
@@ -4502,6 +4502,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
|
|||||||
assertEquals(0, mService.countLogSmartSuggestionsVisible);
|
assertEquals(0, mService.countLogSmartSuggestionsVisible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void testReportSeen_delegated() {
|
public void testReportSeen_delegated() {
|
||||||
Notification.Builder nb =
|
Notification.Builder nb =
|
||||||
new Notification.Builder(mContext, mTestNotificationChannel.getId())
|
new Notification.Builder(mContext, mTestNotificationChannel.getId())
|
||||||
@@ -5767,6 +5768,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
|
|||||||
verify(mUsageStats, times(5)).registerImageRemoved(PKG);
|
verify(mUsageStats, times(5)).registerImageRemoved(PKG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
public void testNotificationBubbles_flagAutoExpandForeground_fails_notForeground()
|
public void testNotificationBubbles_flagAutoExpandForeground_fails_notForeground()
|
||||||
throws Exception {
|
throws Exception {
|
||||||
// Bubbles are allowed!
|
// Bubbles are allowed!
|
||||||
|
|||||||
Reference in New Issue
Block a user