Home
last modified time | relevance | path

Searched refs:thrown (Results 1 – 25 of 55) sorted by relevance

123

/frameworks/base/core/tests/BroadcastRadioTests/src/android/hardware/radio/
DDefaultRadioTunerTest.java122 UnsupportedOperationException thrown = assertThrows( in seek_forRadioTuner_throwsException() local
129 .that(thrown).hasMessageThat().contains("Seeking is not supported"); in seek_forRadioTuner_throwsException()
134 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in getMetadataImage_forRadioTuner_throwsException() local
138 .that(thrown).hasMessageThat() in getMetadataImage_forRadioTuner_throwsException()
156 UnsupportedOperationException thrown = assertThrows( in isConfigFlagSet_forRadioTuner_throwsException() local
162 .that(thrown).hasMessageThat().contains("isConfigFlagSet is not supported"); in isConfigFlagSet_forRadioTuner_throwsException()
167 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in setConfigFlag_forRadioTuner_throwsException() local
171 .that(thrown).hasMessageThat().contains("Setting config flag is not supported"); in setConfigFlag_forRadioTuner_throwsException()
176 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in setParameters_forRadioTuner_throwsException() local
180 .that(thrown).hasMessageThat().contains("Setting parameters is not supported"); in setParameters_forRadioTuner_throwsException()
[all …]
DRadioMetadataTest.java104 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in putString_withIllegalKey() local
109 .that(thrown).hasMessageThat() in putString_withIllegalKey()
117 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in putInt_withIllegalKey() local
122 .that(thrown).hasMessageThat() in putInt_withIllegalKey()
130 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in putBitmap_withIllegalKey() local
135 .that(thrown).hasMessageThat() in putBitmap_withIllegalKey()
143 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in putClock_withIllegalKey() local
149 .that(thrown).hasMessageThat() in putClock_withIllegalKey()
158 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in putStringArray_withIllegalKey_throwsException() local
163 invalidStringArrayKey).that(thrown).hasMessageThat() in putStringArray_withIllegalKey_throwsException()
[all …]
DTunerAdapterTest.java187 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in getConfiguration_withInvalidParameters_fails() local
191 .that(thrown).hasMessageThat().contains("must be an array of length 1"); in getConfiguration_withInvalidParameters_fails()
420 RuntimeException thrown = assertThrows(RuntimeException.class, in tune_withSelectorWhenServiceDied_fails() local
424 .that(thrown).hasMessageThat().contains("Service died"); in tune_withSelectorWhenServiceDied_fails()
463 RuntimeException thrown = assertThrows(RuntimeException.class, in cancelAnnouncement_whenServiceDied_fails() local
467 .that(thrown).hasMessageThat().contains("Service died"); in cancelAnnouncement_whenServiceDied_fails()
520 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in getMetadataImage_withImageIdUnavailable_fails() local
524 .that(thrown).hasMessageThat().contains("is not available"); in getMetadataImage_withImageIdUnavailable_fails()
529 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in getMetadataImage_withInvalidId_fails() local
532 assertWithMessage("Exception for getting metadata image for id 0").that(thrown) in getMetadataImage_withInvalidId_fails()
[all …]
DRadioAnnouncementTest.java43 NullPointerException thrown = assertThrows(NullPointerException.class, () -> { in constructor_withNullSelector_fails() local
48 .that(thrown).hasMessageThat().contains("Program selector cannot be null"); in constructor_withNullSelector_fails()
53 NullPointerException thrown = assertThrows(NullPointerException.class, () -> { in constructor_withNullVendorInfo_fails() local
59 .that(thrown).hasMessageThat().contains("Vendor info cannot be null"); in constructor_withNullVendorInfo_fails()
DProgramSelectorTest.java128 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in construct_withNullInSecondaryIdsForSelector() local
134 .that(thrown).hasMessageThat().contains("secondaryIds list must not contain nulls"); in construct_withNullInSecondaryIdsForSelector()
196 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in getFirstId_withIdNotInSelector() local
201 .that(thrown).hasMessageThat().contains("Identifier " + idType + " not found"); in getFirstId_withIdNotInSelector()
345 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in createAmFmSelector_withInvalidBand_throwsIllegalArgumentException() local
350 .that(thrown).hasMessageThat().contains( in createAmFmSelector_withInvalidBand_throwsIllegalArgumentException()
358 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in createAmFmSelector_withInvalidFrequency_throwsIllegalArgumentException() local
363 .that(thrown).hasMessageThat().contains( in createAmFmSelector_withInvalidFrequency_throwsIllegalArgumentException()
371 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in createAmFmSelector_withInvalidSubChannel_throwsIllegalArgumentException() local
377 .that(thrown).hasMessageThat().contains( in createAmFmSelector_withInvalidSubChannel_throwsIllegalArgumentException()
[all …]
/frameworks/base/tests/PlatformCompatGating/src/com/android/tests/gating/
DPlatformCompatPermissionsTest.java55 public final ExpectedException thrown = ExpectedException.none(); field in PlatformCompatPermissionsTest
81 thrown.expect(SecurityException.class); in reportChange_noLogCompatChangePermission_throwsSecurityException()
99 thrown.expect(SecurityException.class); in reportChangeByPackageName_noLogCompatChangePermission_throwsSecurityException()
117 thrown.expect(SecurityException.class); in reportChangeByUid_noLogCompatChangePermission_throwsSecurityException()
133 thrown.expect(SecurityException.class); in isChangeEnabled_noReadCompatConfigPermission_throwsSecurityException()
142 thrown.expect(SecurityException.class); in isChangeEnabled_noLogCompatChangeConfigPermission_throwsSecurityException()
161 thrown.expect(SecurityException.class); in isChangeEnabledByPackageName_noReadCompatConfigPermission_throwsSecurityException()
170 thrown.expect(SecurityException.class); in isChangeEnabledByPackageName_noLogompatConfigPermission_throwsSecurityException()
189 thrown.expect(SecurityException.class); in isChangeEnabledByUid_noReadCompatConfigPermission_throwsSecurityException()
197 thrown.expect(SecurityException.class); in isChangeEnabledByUid_noLogCompatChangePermission_throwsSecurityException()
[all …]
/frameworks/base/core/java/android/util/
DBase64OutputStream.java109 IOException thrown = null; in close() local
114 thrown = e; in close()
124 if (thrown == null) { in close()
125 thrown = e; in close()
127 thrown.addSuppressed(e); in close()
131 if (thrown != null) { in close()
132 throw thrown; in close()
/frameworks/base/media/tests/AudioPolicyTest/src/com/android/audiopolicytest/
DFadeManagerConfigurationUnitTest.java315 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in testSetFadeState_toInvalid_fails() local
320 expect.withMessage("Invalid fade state exception").that(thrown) in testSetFadeState_toInvalid_fails()
344 NullPointerException thrown = assertThrows(NullPointerException.class, () -> in testSetFadeOutVolShaperConfig_withNullAudioAttributes_fails() local
351 .that(thrown).hasMessageThat().contains("cannot be null"); in testSetFadeOutVolShaperConfig_withNullAudioAttributes_fails()
370 NullPointerException thrown = assertThrows(NullPointerException.class, () -> in testSetFadeInVolShaperConfig_withNullAudioAttributes_fails() local
377 .that(thrown).hasMessageThat().contains("cannot be null"); in testSetFadeInVolShaperConfig_withNullAudioAttributes_fails()
398 NullPointerException thrown = assertThrows(NullPointerException.class, () -> in testSetFadeOutDuration_withNullAudioAttributes_fails() local
403 expect.withMessage("Null audio attributes for fade out duration exception").that(thrown) in testSetFadeOutDuration_withNullAudioAttributes_fails()
409 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in testSetFadeOutDuration_withInvalidDuration_fails() local
414 expect.withMessage("Invalid duration for fade out exception").that(thrown) in testSetFadeOutDuration_withInvalidDuration_fails()
[all …]
/frameworks/base/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/hal2/
DTunerSessionHidlTest.java396 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in tune_withUnsupportedSelector_throwsException() local
400 .that(thrown).hasMessageThat().contains("tune: NOT_SUPPORTED"); in tune_withUnsupportedSelector_throwsException()
423 ParcelableException thrown = assertThrows(ParcelableException.class, () -> { in tune_withUnknownErrorFromHal_fails() local
428 .that(thrown).hasMessageThat().contains(Result.toString(Result.UNKNOWN_ERROR)); in tune_withUnknownErrorFromHal_fails()
437 IllegalStateException thrown = assertThrows(IllegalStateException.class, in tune_withClosedTuner_fails() local
440 mExpect.withMessage("Exception for tuning on closed tuner").that(thrown).hasMessageThat() in tune_withClosedTuner_fails()
497 IllegalStateException thrown = assertThrows(IllegalStateException.class, () -> { in step_withHalInInvalidState_fails() local
502 .that(thrown).hasMessageThat().contains(Result.toString(Result.INVALID_STATE)); in step_withHalInInvalidState_fails()
576 ParcelableException thrown = assertThrows(ParcelableException.class, () -> { in seek_withInternalErrorFromHal_fails() local
581 .that(thrown).hasMessageThat().contains(Result.toString(Result.INTERNAL_ERROR)); in seek_withInternalErrorFromHal_fails()
[all …]
DBroadcastRadioServiceHidlTest.java147 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in openSession_withIdNotFound() local
153 .that(thrown).hasMessageThat().contains("Invalid module ID"); in openSession_withIdNotFound()
161 IllegalStateException thrown = assertThrows(IllegalStateException.class, in openSession_forNonCurrentUser_throwsException() local
166 .that(thrown).hasMessageThat().contains("Cannot open session for non-current user"); in openSession_forNonCurrentUser_throwsException()
173 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in openSession_withoutAudio_fails() local
178 .that(thrown).hasMessageThat().contains("not supported"); in openSession_withoutAudio_fails()
DAnnouncementAggregatorHidlTest.java89 RuntimeException thrown = assertThrows(RuntimeException.class, in constructor_withBinderDied() local
93 mExpect.withMessage("Exception for dead binder").that(thrown).hasMessageThat() in constructor_withBinderDied()
150 IllegalStateException thrown = assertThrows(IllegalStateException.class, in watchModule_afterClosed_throwsException() local
155 .that(thrown).hasMessageThat() in watchModule_afterClosed_throwsException()
/frameworks/base/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-test/src/com/android/hoststubgen/test/tinyframework/
DTinyFrameworkClassWithAnnotTest.java26 public ExpectedException thrown = ExpectedException.none(); field in TinyFrameworkClassWithAnnotTest
62 thrown.expect(RuntimeException.class); in testVisibleButUsesUnsupportedMethod()
63 thrown.expectMessage("not yet supported"); in testVisibleButUsesUnsupportedMethod()
DTinyFrameworkClassTest.java35 public ExpectedException thrown = ExpectedException.none(); field in TinyFrameworkClassTest
71 thrown.expect(RuntimeException.class); in testVisibleButUsesUnsupportedMethod()
72 thrown.expectMessage("not yet supported"); in testVisibleButUsesUnsupportedMethod()
201 thrown.expect(RuntimeException.class); in testExitLog()
202 thrown.expectMessage("Outer exception"); in testExitLog()
264 thrown.expect(java.lang.reflect.InaccessibleObjectException.class); in testFileDescriptor()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/drawer/
DPrimarySwitchControllerTest.java29 public final ExpectedException thrown = ExpectedException.none(); field in PrimarySwitchControllerTest
40 thrown.expect(UnsupportedOperationException.class); in getMetaData_shouldThrowUnsupportedOperationException()
47 thrown.expect(UnsupportedOperationException.class); in getBundle_shouldThrowUnsupportedOperationException()
/frameworks/base/tests/testables/tests/src/android/testing/
DDexmakerShareClassLoaderRuleTest.java72 final Throwable[] thrown = new Throwable[1]; in rule_preventsOtherThreadFromInterfering()
80 thrown[0] = tr; in rule_preventsOtherThreadFromInterfering()
86 if (thrown[0] != null) { in rule_preventsOtherThreadFromInterfering()
87 throw thrown[0]; in rule_preventsOtherThreadFromInterfering()
/frameworks/base/core/tests/BroadcastRadioTests/src/com/android/server/broadcastradio/aidl/
DTunerSessionTest.java399 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in tune_withUnsupportedSelector_throwsException() local
403 .that(thrown).hasMessageThat().contains("tune: NOT_SUPPORTED"); in tune_withUnsupportedSelector_throwsException()
414 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in tune_withInvalidSelector_throwsIllegalArgumentException() local
418 .that(thrown).hasMessageThat().contains("tune: INVALID_ARGUMENTS"); in tune_withInvalidSelector_throwsIllegalArgumentException()
442 ParcelableException thrown = assertThrows(ParcelableException.class, () -> { in tune_withUnknownErrorFromHal_fails() local
447 .that(thrown).hasMessageThat().contains("UNKNOWN_ERROR"); in tune_withUnknownErrorFromHal_fails()
456 IllegalStateException thrown = assertThrows(IllegalStateException.class, in tune_withClosedTuner_fails() local
459 expect.withMessage("Exception for tuning on closed tuner").that(thrown).hasMessageThat() in tune_withClosedTuner_fails()
518 IllegalStateException thrown = assertThrows(IllegalStateException.class, () -> { in step_withHalInInvalidState_fails() local
523 .that(thrown).hasMessageThat().contains("INVALID_STATE"); in step_withHalInInvalidState_fails()
[all …]
DRadioModuleTest.java109 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in getImage_withInvalidIdFromRadioModule_throwsIllegalArgumentException() local
114 .that(thrown).hasMessageThat().contains("Image ID is missing"); in getImage_withInvalidIdFromRadioModule_throwsIllegalArgumentException()
130 ParcelableException thrown = assertThrows(ParcelableException.class, () -> in addAnnouncementListener_whenHalThrowsRemoteException() local
134 .that(thrown).hasMessageThat().contains("unknown error"); in addAnnouncementListener_whenHalThrowsRemoteException()
DAnnouncementAggregatorTest.java88 RuntimeException thrown = assertThrows(RuntimeException.class, () -> in constructor_withBinderDied() local
91 mExpect.withMessage("Exception for dead binder").that(thrown).hasMessageThat() in constructor_withBinderDied()
148 IllegalStateException thrown = assertThrows(IllegalStateException.class, in watchModule_afterClosed_throwsException() local
153 .that(thrown).hasMessageThat() in watchModule_afterClosed_throwsException()
DBroadcastRadioServiceImplTest.java161 IllegalStateException thrown = assertThrows(IllegalStateException.class, in openSession_forNonCurrentUser_throwsException() local
166 .that(thrown).hasMessageThat().contains("Cannot open session for non-current user"); in openSession_forNonCurrentUser_throwsException()
173 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in openSession_withoutAudio_fails() local
178 .that(thrown).hasMessageThat().contains("not supported"); in openSession_withoutAudio_fails()
/frameworks/base/core/java/com/android/internal/logging/
DAndroidHandler.java91 Throwable thrown = r.getThrown();
92 if (thrown != null) {
97 thrown.printStackTrace(pw);
/frameworks/base/core/tests/coretests/src/android/hardware/display/
DVirtualDisplayTest.java335 final Throwable[] thrown = new Throwable[1]; in runOnUiThread() local
341 thrown[0] = t; in runOnUiThread()
344 if (thrown[0] != null) { in runOnUiThread()
345 if (thrown[0] instanceof RuntimeException) { in runOnUiThread()
346 throw (RuntimeException) thrown[0]; in runOnUiThread()
348 if (thrown[0] instanceof Error) { in runOnUiThread()
349 throw (Error) thrown[0]; in runOnUiThread()
351 throw new RuntimeException(thrown[0]); in runOnUiThread()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/widget/
DBarChartInfoTest.java35 public final ExpectedException thrown = ExpectedException.none(); field in BarChartInfoTest
63 thrown.expect(IllegalStateException.class); in builder_noTitle_shouldThrowIllegalStateException()
117 thrown.expect(IllegalStateException.class); in addBarViewInfo_moreInfosThanMaxAllowed_shouldThrowIllegalStateException()
/frameworks/base/core/tests/hosttests/test-apps/MultiDexLegacyAndException/src/com/android/multidexlegacyandexception/
DIntermediateClass.java82 public static int get5(Throwable thrown) { in get5() argument
84 ClassInSecondaryDex.canThrowAll(thrown); in get5()
/frameworks/base/services/tests/servicestests/src/com/android/server/accessibility/
DProxyAccessibilityServiceConnectionTest.java223 UnsupportedOperationException thrown = in testSetServiceInfo_setIllegalOperationExceptionThrown() local
228 assertThat(thrown).hasMessageThat().contains("setServiceInfo is not supported"); in testSetServiceInfo_setIllegalOperationExceptionThrown()
233 UnsupportedOperationException thrown = in testDisableSelf_setIllegalOperationExceptionThrown() local
238 assertThat(thrown).hasMessageThat().contains("disableSelf is not supported"); in testDisableSelf_setIllegalOperationExceptionThrown()
/frameworks/libs/modules-utils/javatests/com/android/modules/utils/testing/
DExtendedMockitoRuleTest.java510 Exception thrown = assertThrows(Exception.class, in testAfterSessionFinished_whenSessionFailsToFinish() local
515 assertWithMessage("exception").that(thrown).isSameInstanceAs(mockitoSession.e); in testAfterSessionFinished_whenSessionFailsToFinish()
546 Exception thrown = assertThrows(Exception.class, in testMockitoFrameworkCleared_whenTestFails() local
555 assertWithMessage("exception").that(thrown).isSameInstanceAs(exception); in testMockitoFrameworkCleared_whenTestFails()
564 Exception thrown = assertThrows(Exception.class, in testMockitoFrameworkCleared_whenAfterSessionFinished() local
570 assertWithMessage("exception").that(thrown).isSameInstanceAs(exception); in testMockitoFrameworkCleared_whenAfterSessionFinished()
580 Exception thrown = assertThrows(Exception.class, in testMockitoFrameworkCleared_whenStaticMockFixturesFailed() local
585 assertWithMessage("exception").that(thrown).isSameInstanceAs(exception); in testMockitoFrameworkCleared_whenStaticMockFixturesFailed()
594 Exception thrown = assertThrows(Exception.class, in testMockitoFrameworkCleared_whenSessionFailsToFinish() local
599 assertWithMessage("exception").that(thrown).isSameInstanceAs(mockitoSession.e); in testMockitoFrameworkCleared_whenSessionFailsToFinish()

123