Home
last modified time | relevance | path

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

123456

/packages/services/Car/tests/carservice_unit_test/src/com/android/car/hal/fakevhal/
DFakeVhalConfigParserUnitTest.java93 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in testConfigFileHaveInvalidJsonObject() local
96 assertThat(thrown).hasMessageThat().contains("This file does not contain a valid " in testConfigFileHaveInvalidJsonObject()
105 var thrown = assertThrows(IllegalArgumentException.class, () -> in testConfigFileInvalidJsonKey() local
108 assertThat(thrown).hasMessageThat().contains("Invalid json syntax"); in testConfigFileInvalidJsonKey()
116 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in testConfigFileRootIsNotArray() local
119 assertThat(thrown).hasMessageThat().contains("field value is not a valid JSONArray."); in testConfigFileRootIsNotArray()
127 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in testConfigFileRootHasElementIsNotJsonObject() local
130 assertThat(thrown).hasMessageThat().contains("properties array has an invalid JSON element" in testConfigFileRootHasElementIsNotJsonObject()
139 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in testParseEachPropertyJsonObjectIsEmpty() local
142 assertThat(thrown).hasMessageThat().contains("is empty"); in testParseEachPropertyJsonObjectIsEmpty()
[all …]
DFakeVehicleStubUnitTest.java247 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in testParseConfigFilesThrowException() local
250 expect.that(thrown).hasMessageThat().contains("This file does not contain a valid " in testParseConfigFilesThrowException()
326 ServiceSpecificException thrown = assertThrows(ServiceSpecificException.class, in testGetMethodPropIdNotSupported() local
330 expect.that(thrown.errorCode).isEqualTo(StatusCode.INVALID_ARG); in testGetMethodPropIdNotSupported()
331 expect.that(thrown).hasMessageThat().contains("The propId: " in testGetMethodPropIdNotSupported()
349 ServiceSpecificException thrown = assertThrows(ServiceSpecificException.class, in testGetMethodNoReadPermission() local
352 expect.that(thrown.errorCode).isEqualTo(StatusCode.ACCESS_DENIED); in testGetMethodNoReadPermission()
353 expect.that(thrown).hasMessageThat().contains("doesn't have read permission"); in testGetMethodNoReadPermission()
368 ServiceSpecificException thrown = assertThrows(ServiceSpecificException.class, in testGetMethodPropIdIsGlobalHasNoDefaultValueAreaIdIgnored() local
373 expect.that(thrown.errorCode).isEqualTo(StatusCode.NOT_AVAILABLE); in testGetMethodPropIdIsGlobalHasNoDefaultValueAreaIdIgnored()
[all …]
/packages/modules/DeviceLock/DeviceLockController/tests/robolectric/src/com/android/devicelockcontroller/policy/
DDeviceStateControllerImplTest.java85 ExecutionException thrown = assertThrows(ExecutionException.class, in lockDevice_withProvisionInProgressState_shouldThrowException() local
87 assertThat(thrown).hasCauseThat().isInstanceOf(RuntimeException.class); in lockDevice_withProvisionInProgressState_shouldThrowException()
88 assertThat(thrown).hasMessageThat().contains(USER_HAS_NOT_BEEN_PROVISIONED); in lockDevice_withProvisionInProgressState_shouldThrowException()
100 ExecutionException thrown = assertThrows(ExecutionException.class, in lockDevice_withProvisionPausedState_shouldThrowException() local
102 assertThat(thrown).hasCauseThat().isInstanceOf(RuntimeException.class); in lockDevice_withProvisionPausedState_shouldThrowException()
103 assertThat(thrown).hasMessageThat().contains(USER_HAS_NOT_BEEN_PROVISIONED); in lockDevice_withProvisionPausedState_shouldThrowException()
115 ExecutionException thrown = assertThrows(ExecutionException.class, in lockDevice_withProvisionFailedState_shouldThrowException() local
117 assertThat(thrown).hasCauseThat().isInstanceOf(RuntimeException.class); in lockDevice_withProvisionFailedState_shouldThrowException()
118 assertThat(thrown).hasMessageThat().contains(USER_HAS_NOT_BEEN_PROVISIONED); in lockDevice_withProvisionFailedState_shouldThrowException()
147 ExecutionException thrown = assertThrows(ExecutionException.class, in lockDevice_withClearDeviceState_shouldThrowException() local
[all …]
/packages/modules/Connectivity/staticlibs/tests/unit/src/com/android/net/module/util/
DCleanupTest.kt56 val thrown = assertFailsWith<TestException1> { in testThrowTry() constant
67 assertTrue(thrown.suppressedExceptions.isEmpty()) in testThrowTry()
74 val thrown = assertFailsWith<TestException2> { in testThrowCleanup() constant
85 assertTrue(thrown.suppressedExceptions.isEmpty()) in testThrowCleanup()
92 val thrown = assertFailsWith<TestException1> { in testThrowBoth() constant
104 assertTrue(thrown.suppressedExceptions[0] is TestException2) in testThrowBoth()
161 val thrown = assertFailsWith<TestException2> { in testThrowInCatch() constant
174 assertTrue(thrown.suppressedExceptions.isEmpty()) in testThrowInCatch()
180 val thrown = assertFailsWith<AssertionError> { in testAssertionErrorInCatch() constant
193 assertTrue(thrown.suppressedExceptions.isEmpty()) in testAssertionErrorInCatch()
[all …]
/packages/modules/AdServices/adservices/tests/test-util/java/com/android/adservices/experimental/
DAbstractSupportedFeatureRule.java130 Throwable thrown = null; in apply() local
134 thrown = t; in apply()
136 mLog.d("Base evaluated: thrown=%s", thrown); in apply()
137 afterTest(testShouldRunAsSupported, thrown); in apply()
150 protected void afterTest(boolean testShouldRunAsSupported, @Nullable Throwable thrown)
153 if (thrown != null) {
154 throw thrown;
157 if (thrown == null) {
160 assertUnsupportedTestThrewRightException(thrown);
304 protected void assertUnsupportedTestThrewRightException(Throwable thrown) {
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/audio/hal/
DAudioControlWrapperV1Test.java103 IllegalStateException thrown = assertThrows(IllegalStateException.class, in getBusForContext_throws() local
107 .that(thrown).hasMessageThat() in getBusForContext_throws()
162 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in onDevicesToMuteChange_throws() local
166 .that(thrown).hasMessageThat() in onDevicesToMuteChange_throws()
174 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in registerAudioGainCallback_throws() local
178 .that(thrown).hasMessageThat() in registerAudioGainCallback_throws()
184 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in unregisterAudioGainCallback_throws() local
188 .that(thrown).hasMessageThat() in unregisterAudioGainCallback_throws()
194 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in setModuleChangeCallback_throws() local
199 .that(thrown).hasMessageThat().contains("unsupported for IAudioControl@1.0"); in setModuleChangeCallback_throws()
[all …]
DAudioControlWrapperV2Test.java131 IllegalStateException thrown = assertThrows(IllegalStateException.class, in registerFocusListener_throws() local
135 .that(thrown).hasMessageThat() in registerFocusListener_throws()
190 IllegalStateException thrown = assertThrows(IllegalStateException.class, in onAudioFocusChange_throws() local
194 .that(thrown).hasMessageThat() in onAudioFocusChange_throws()
206 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in onDevicesToMuteChange_throws() local
210 .that(thrown).hasMessageThat() in onDevicesToMuteChange_throws()
218 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in registerAudioGainCallback_throws() local
222 .that(thrown).hasMessageThat() in registerAudioGainCallback_throws()
228 UnsupportedOperationException thrown = assertThrows(UnsupportedOperationException.class, in unregisterAudioGainCallback_throws() local
232 .that(thrown).hasMessageThat() in unregisterAudioGainCallback_throws()
[all …]
DHalAudioDeviceInfoTest.java113 Throwable thrown = assertThrows(NullPointerException.class, in constructor_requiresNonNullAudioPort() local
117 .that(thrown).hasMessageThat().contains("Audio port can not be null"); in constructor_requiresNonNullAudioPort()
127 Throwable thrown = assertThrows(NullPointerException.class, in constructor_requiresNonNullAudioGains() local
131 .that(thrown).hasMessageThat().contains("Audio gains can not be null"); in constructor_requiresNonNullAudioGains()
150 Throwable thrown = assertThrows(IllegalStateException.class, in constructor_requiresJointModeAudioGain() local
154 .that(thrown).hasMessageThat().contains("Audio port"); in constructor_requiresJointModeAudioGain()
173 Throwable thrown = assertThrows(IllegalArgumentException.class, in constructor_requiresMaxGainLargerThanMin() local
177 .that(thrown).hasMessageThat().contains("lower than"); in constructor_requiresMaxGainLargerThanMin()
196 Throwable thrown = assertThrows(IllegalArgumentException.class, in constructor_requiresDefaultGainLargerThanMin() local
200 .that(thrown).hasMessageThat().contains("not in range"); in constructor_requiresDefaultGainLargerThanMin()
[all …]
/packages/services/Car/tests/carservice_test/src/com/android/car/audio/
DCarAudioZonesHelperTest.java775 IllegalArgumentException thrown = in loadAudioZones_versionOneFailsOnAudioZoneId() local
778 assertThat(thrown).hasMessageThat().contains("Invalid audio attribute audioZoneId"); in loadAudioZones_versionOneFailsOnAudioZoneId()
794 IllegalArgumentException thrown = in loadAudioZones_versionOneFailsOnOccupantZoneId() local
797 assertThat(thrown).hasMessageThat().contains("Invalid audio attribute occupantZoneId"); in loadAudioZones_versionOneFailsOnOccupantZoneId()
922 IllegalArgumentException thrown = in loadAudioZones_failsOnDuplicateOccupantZoneId() local
925 assertThat(thrown).hasMessageThat().contains("already associated with a zone"); in loadAudioZones_failsOnDuplicateOccupantZoneId()
941 IllegalArgumentException thrown = in loadAudioZones_failsOnDuplicateAudioZoneId() local
944 assertThat(thrown).hasMessageThat().contains("already associated with a zone"); in loadAudioZones_failsOnDuplicateAudioZoneId()
961 IllegalArgumentException thrown = in loadAudioZones_failsOnDuplicateZoneConfigName() local
964 expectWithMessage("Exception for duplicate zone config name").that(thrown) in loadAudioZones_failsOnDuplicateZoneConfigName()
[all …]
DCarAudioFadeConfigurationHelperTest.java72 MissingResourceException thrown = assertThrows(MissingResourceException.class, in constructor_withNoConfigs_fails() local
75 expectWithMessage("Car audio fade config with no configs exception").that(thrown) in constructor_withNoConfigs_fails()
85 NullPointerException thrown = assertThrows(NullPointerException.class, in constructor_configWithNoName_fails() local
88 expectWithMessage("Car audio fade config with no name exception").that(thrown) in constructor_configWithNoName_fails()
98 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in constructor_configWithEmptyName_fails() local
101 expectWithMessage("Car audio fade config with empty name exception").that(thrown) in constructor_configWithEmptyName_fails()
/packages/modules/HealthFitness/tests/cts/src/android/healthconnect/cts/
DTimeRangeFilterTest.java116 Throwable thrown = assertThrows(IllegalArgumentException.class, builder::build); in instantTimeRange_startTimeNotLaterThanEndTime_throws() local
117 assertThat(thrown).hasMessageThat().contains("end time needs to be after start time"); in instantTimeRange_startTimeNotLaterThanEndTime_throws()
120 thrown = assertThrows(IllegalArgumentException.class, builder::build); in instantTimeRange_startTimeNotLaterThanEndTime_throws()
121 assertThat(thrown).hasMessageThat().contains("end time needs to be after start time"); in instantTimeRange_startTimeNotLaterThanEndTime_throws()
129 Throwable thrown = assertThrows(IllegalArgumentException.class, builder::build); in localTimeRange_startTimeNotLaterThanEndTime_throws() local
130 assertThat(thrown).hasMessageThat().contains("end time needs to be after start time"); in localTimeRange_startTimeNotLaterThanEndTime_throws()
133 thrown = assertThrows(IllegalArgumentException.class, builder::build); in localTimeRange_startTimeNotLaterThanEndTime_throws()
134 assertThat(thrown).hasMessageThat().contains("end time needs to be after start time"); in localTimeRange_startTimeNotLaterThanEndTime_throws()
139 Throwable thrown = in instantTimeRange_bothEndsOpen_throws() local
143 assertThat(thrown) in instantTimeRange_bothEndsOpen_throws()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/audio/
DCarAudioMirrorRequestHandlerTest.java112 NullPointerException thrown = assertThrows(NullPointerException.class, () -> { in registerAudioZonesMirrorStatusCallback_withNullCallback_fails() local
118 .that(thrown).hasMessageThat().contains("Audio zones mirror status"); in registerAudioZonesMirrorStatusCallback_withNullCallback_fails()
123 NullPointerException thrown = assertThrows(NullPointerException.class, () -> { in unregisterAudioZonesMirrorStatusCallback_withNullCallback_fails() local
129 .that(thrown).hasMessageThat().contains("Audio zones mirror status"); in unregisterAudioZonesMirrorStatusCallback_withNullCallback_fails()
205 NullPointerException thrown = assertThrows(NullPointerException.class, () -> { in setMirrorDeviceInfos_withNullMirrorDeviceAddress() local
210 .that(thrown).hasMessageThat().contains("Mirror devices"); in setMirrorDeviceInfos_withNullMirrorDeviceAddress()
268 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in getAudioDeviceInfo_forInvalidRequestIdFails() local
272 .that(thrown).hasMessageThat().contains("Request id for device"); in getAudioDeviceInfo_forInvalidRequestIdFails()
303 NullPointerException thrown = assertThrows(NullPointerException.class, () -> { in enableMirrorForZones_withNullZoneIds_fails() local
308 .that(thrown).hasMessageThat().contains("Mirror audio zones"); in enableMirrorForZones_withNullZoneIds_fails()
[all …]
DCarAudioContextInfoTest.java55 NullPointerException thrown = assertThrows(NullPointerException.class, () -> { in constructor_withNullAttributes_fails() local
60 assertWithMessage("Null audio attribute exception").that(thrown) in constructor_withNullAttributes_fails()
66 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in constructor_withEmptyAudioAttributes_fails() local
71 assertWithMessage("Empty audio attributes exception").that(thrown) in constructor_withEmptyAudioAttributes_fails()
77 NullPointerException thrown = assertThrows(NullPointerException.class, () -> { in constructor_withNullName_fails() local
82 assertWithMessage("Null name string exception").that(thrown) in constructor_withNullName_fails()
88 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in constructor_withEmptyName_fails() local
93 assertWithMessage("Null name string exception").that(thrown) in constructor_withEmptyName_fails()
99 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> { in constructor_withNegativeId_fails() local
104 assertWithMessage("Negative id exception").that(thrown) in constructor_withNegativeId_fails()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/adselection/
DAdSelectionConfigValidatorTest.java166 IllegalArgumentException thrown = in testVerifyEmptySeller() local
171 thrown, in testVerifyEmptySeller()
184 IllegalArgumentException thrown = in testVerifyNotDomainNameSeller() local
189 thrown, in testVerifyNotDomainNameSeller()
201 IllegalArgumentException thrown = in testVerifyInvalidSeller() local
206 thrown, in testVerifyInvalidSeller()
223 IllegalArgumentException thrown = in testVerifyNoHostSeller() local
228 thrown, in testVerifyNoHostSeller()
240 IllegalArgumentException thrown = in testVerifyNoHostDecisionLogicUri() local
245 thrown, in testVerifyNoHostDecisionLogicUri()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/android/car/util/concurrent/
DAndroidFutureTest.java70 ExecutionException thrown = assertThrows(ExecutionException.class, in testCompleteExceptionally_uncompleted() local
72 assertThat(thrown.getCause()).isSameInstanceAs(origException); in testCompleteExceptionally_uncompleted()
204 ExecutionException thrown = assertThrows(ExecutionException.class, () -> fromParcel.get()); in testWriteToParcel_completedExceptionally() local
205 assertThat(thrown.getCause()).isInstanceOf(UnsupportedOperationException.class); in testWriteToParcel_completedExceptionally()
206 assertThat(thrown.getMessage()).contains(EXCEPTION_MESSAGE); in testWriteToParcel_completedExceptionally()
229 ExecutionException thrown = in testWriteToParcel_uncompleted_Exception() local
231 assertThat(thrown.getCause()).isSameInstanceAs(exception); in testWriteToParcel_uncompleted_Exception()
249 ExecutionException thrown = assertThrows(ExecutionException.class, () -> future.get()); in testSupply_futureThrowingException() local
251 assertThat(thrown.getCause()).isSameInstanceAs(exception); in testSupply_futureThrowingException()
274 ExecutionException thrown = assertThrows(ExecutionException.class, () -> farFuture.get()); in testThenApply_functionThrowingException() local
[all …]
/packages/services/Car/tests/carservice_unit_test/src/android/car/oem/
DOemCarAudioFocusEvaluationRequestUnitTest.java135 IllegalStateException thrown = assertThrows(IllegalStateException.class, () -> in builder_withReuse_fails() local
140 .that(thrown).hasMessageThat().contains("should not be reused"); in builder_withReuse_fails()
186 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in setFocusHolders_withNullHolders_fails() local
193 .that(thrown).hasMessageThat().contains("Focus holders"); in setFocusHolders_withNullHolders_fails()
209 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in addFocusHolders_withNullHolder_fails() local
216 .that(thrown).hasMessageThat().contains("Focus holder"); in addFocusHolders_withNullHolder_fails()
232 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in setFocusLosers_withNullLosers_fails() local
239 .that(thrown).hasMessageThat().contains("Focus loser"); in setFocusLosers_withNullLosers_fails()
255 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in addFocusLosers_withNullLosers_fails() local
262 .that(thrown).hasMessageThat().contains("Focus loser"); in addFocusLosers_withNullLosers_fails()
[all …]
DCarAudioFadeConfigurationUnitTest.java56 NullPointerException thrown = assertThrows(NullPointerException.class, in builder_withNullFadeManagerConfiguration_fails() local
61 .that(thrown).hasMessageThat().contains("configuration can not be null"); in builder_withNullFadeManagerConfiguration_fails()
67 NullPointerException thrown = assertThrows(NullPointerException.class, in builder_withNullName_fails() local
73 .that(thrown).hasMessageThat().contains("Name can not"); in builder_withNullName_fails()
82 IllegalStateException thrown = assertThrows(IllegalStateException.class, () -> in builder_withReuse_fails() local
87 .that(thrown).hasMessageThat().contains("should not be reused"); in builder_withReuse_fails()
/packages/modules/AdServices/sdksandbox/tests/cts/inprocess/src/com/android/sdksandbox/tests/cts/inprocess/
DSdkSandboxRestrictionsTest.java91 UnsupportedSchemeException thrown = assertThrows( in testNoWidevineAccess() local
94 assertThat(thrown).hasMessageThat().contains("NO_INIT"); in testNoWidevineAccess()
116 SecurityException thrown = in testCannotRequestPermissions() local
118 assertThat(thrown).hasMessageThat().contains("may not be started from an SDK sandbox uid."); in testCannotRequestPermissions()
131 SecurityException thrown = in testNoImplicitIntents() local
133 assertThat(thrown).hasMessageThat().contains("may not be started from an SDK sandbox uid."); in testNoImplicitIntents()
140 SecurityException thrown = in testSendBroadcastsRestrictions_withAction() local
142 assertThat(thrown).hasMessageThat().contains("may not be broadcast from an SDK sandbox"); in testSendBroadcastsRestrictions_withAction()
150 SecurityException thrown = in testSendBroadcastRestrictions_withoutAction() local
152 assertThat(thrown).hasMessageThat().contains("may not be broadcast from an SDK sandbox"); in testSendBroadcastRestrictions_withoutAction()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/android/car/media/
DCarVolumeGroupInfoUnitTest.java144 NullPointerException thrown = assertThrows(NullPointerException.class, () -> in build_buildsGroupInfo_withNullAudioDevices_fails() local
150 .that(thrown).hasMessageThat().contains("Audio Device Attributes"); in build_buildsGroupInfo_withNullAudioDevices_fails()
179 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in build_buildsGroupInfo_withMinActivationVolumeOutOfMinMaxRange_fails() local
183 .that(thrown).hasMessageThat().contains("Min activation volume gain index"); in build_buildsGroupInfo_withMinActivationVolumeOutOfMinMaxRange_fails()
192 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in build_buildsGroupInfo_withMaxActivationVolumeOutOfMinMaxRange_fails() local
196 .that(thrown).hasMessageThat().contains("Max activation volume gain index"); in build_buildsGroupInfo_withMaxActivationVolumeOutOfMinMaxRange_fails()
206 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in build_buildsGroupInfo_withMinLargerThanMaxActivationVolume_fails() local
210 .that(thrown).hasMessageThat().contains("must be smaller than max activation"); in build_buildsGroupInfo_withMinLargerThanMaxActivationVolume_fails()
233 NullPointerException thrown = assertThrows(NullPointerException.class, () -> in build_withNullName_fails() local
239 .that(thrown).hasMessageThat().contains("Volume info name"); in build_withNullName_fails()
[all …]
DCarVolumeGroupEventUnitTest.java105 IllegalStateException thrown = assertThrows(IllegalStateException.class, () -> in builder_withReuse_fails() local
109 .that(thrown).hasMessageThat().contains("should not be reused"); in builder_withReuse_fails()
114 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in build_withNullVolumeGroupInfo_fails() local
121 .that(thrown).hasMessageThat().contains("Volume group info"); in build_withNullVolumeGroupInfo_fails()
126 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in build_withNullExtraInfo_fails() local
133 .that(thrown).hasMessageThat().contains("Extra info"); in build_withNullExtraInfo_fails()
138 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in addCarVolumeGroupInfo_withNullEntry_fails() local
147 .that(thrown).hasMessageThat().contains("Volume group info"); in addCarVolumeGroupInfo_withNullEntry_fails()
179 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, () -> in setExtraInfos_withNullEntry_fails() local
189 .that(thrown).hasMessageThat().contains("Extra infos can not"); in setExtraInfos_withNullEntry_fails()
/packages/modules/DeviceLock/tests/unittests/src/com/android/server/devicelock/
DDeviceLockControllerConnectorStubTest.java87 ExecutionException thrown = assertThrows(ExecutionException.class, in lockDevice_withClearedState_shouldThrowException() local
89 assertThat(thrown).hasCauseThat().isInstanceOf(IllegalStateException.class); in lockDevice_withClearedState_shouldThrowException()
128 ExecutionException thrown = assertThrows(ExecutionException.class, in unlockDevice_withClearedState_shouldThrowException() local
130 assertThat(thrown).hasCauseThat().isInstanceOf(IllegalStateException.class); in unlockDevice_withClearedState_shouldThrowException()
169 ExecutionException thrown = assertThrows(ExecutionException.class, in clearDeviceRestrictions_withClearedState_shouldThrowException() local
171 assertThat(thrown).hasCauseThat().isInstanceOf(IllegalStateException.class); in clearDeviceRestrictions_withClearedState_shouldThrowException()
179 ExecutionException thrown = assertThrows(ExecutionException.class, in isDeviceLocked_withUndefinedState_shouldThrownException() local
181 assertThat(thrown).hasCauseThat().isInstanceOf(IllegalStateException.class); in isDeviceLocked_withUndefinedState_shouldThrownException()
211 ExecutionException thrown = assertThrows(ExecutionException.class, in isDeviceLocked_withClearedState_shouldThrownException() local
213 assertThat(thrown).hasCauseThat().isInstanceOf(IllegalStateException.class); in isDeviceLocked_withClearedState_shouldThrownException()
/packages/services/Car/tests/carservice_unit_test/src/android/car/os/
DThreadPolicyWithPriorityUnitTest.java60 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in testThreadPolicyWithPriorityInvalidPolicy() local
63 assertWithMessage("thrown exception has expected message").that(thrown).hasMessageThat() in testThreadPolicyWithPriorityInvalidPolicy()
72 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in testThreadPolicyWithPriorityPriorityTooSmall() local
75 assertWithMessage("thrown exception has expected message").that(thrown).hasMessageThat() in testThreadPolicyWithPriorityPriorityTooSmall()
84 IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class, in testThreadPolicyWithPriorityPriorityTooLarge() local
87 assertWithMessage("thrown exception has expected message").that(thrown).hasMessageThat() in testThreadPolicyWithPriorityPriorityTooLarge()
/packages/modules/Permission/tests/cts/safetycenter/src/android/safetycenter/cts/
DSafetyCenterManagerTest.kt188 val thrown = in setSafetySourceData_unknownId_throwsIllegalArgumentException() constant
193 assertThat(thrown).hasMessageThat().isEqualTo("Unexpected safety source: $SINGLE_SOURCE_ID") in setSafetySourceData_unknownId_throwsIllegalArgumentException()
200 val thrown = in setSafetySourceData_staticId_throwsIllegalArgumentException() constant
205 assertThat(thrown) in setSafetySourceData_staticId_throwsIllegalArgumentException()
214 val thrown = in setSafetySourceData_differentPackage_throwsIllegalArgumentException() constant
222 assertThat(thrown) in setSafetySourceData_differentPackage_throwsIllegalArgumentException()
235 val thrown = in setSafetySourceData_wronglySignedPackage_throwsIllegalArgumentException() constant
240 assertThat(thrown) in setSafetySourceData_wronglySignedPackage_throwsIllegalArgumentException()
265 val thrown = in setSafetySourceData_invalidPackageCertificate_throwsIllegalArgumentException() constant
270 assertThat(thrown) in setSafetySourceData_invalidPackageCertificate_throwsIllegalArgumentException()
[all …]
/packages/services/Car/tests/CarLibUnitTest/src/android/car/media/
DCarAudioManagerUnitTest.java649 NullPointerException thrown = assertThrows(NullPointerException.class, () -> in registerCarVolumeGroupEventCallback_withNullExecutor_fails() local
654 + "null executor").that(thrown).hasMessageThat() in registerCarVolumeGroupEventCallback_withNullExecutor_fails()
660 NullPointerException thrown = assertThrows(NullPointerException.class, () -> in registerCarVolumeGroupEventCallback_withNullCallback_fails() local
665 .that(thrown).hasMessageThat() in registerCarVolumeGroupEventCallback_withNullCallback_fails()
710 NullPointerException thrown = assertThrows(NullPointerException.class, () -> in unregisterCarVolumeGroupEventCallback_withNullCallback_fails() local
714 .that(thrown).hasMessageThat() in unregisterCarVolumeGroupEventCallback_withNullCallback_fails()
963 NullPointerException thrown = assertThrows(NullPointerException.class, () -> in switchAudioZoneToConfig_withNullConfig_fails() local
968 .that(thrown).hasMessageThat() in switchAudioZoneToConfig_withNullConfig_fails()
974 NullPointerException thrown = assertThrows(NullPointerException.class, () -> in switchAudioZoneToConfig_withNullExecutor_fails() local
979 .that(thrown).hasMessageThat() in switchAudioZoneToConfig_withNullExecutor_fails()
[all …]
/packages/modules/HealthFitness/tests/unittests/src/android/health/connect/
DPageTokenWrapperTest.java63 Throwable thrown; in of_invalidArgument_throws() local
65 thrown = in of_invalidArgument_throws()
71 assertThat(thrown.getMessage()).isEqualTo("timestamp can not be negative"); in of_invalidArgument_throws()
73 thrown = in of_invalidArgument_throws()
79 assertThat(thrown.getMessage()).isEqualTo("offset can not be negative"); in of_invalidArgument_throws()
81 thrown = in of_invalidArgument_throws()
87 assertThat(thrown.getMessage()).isEqualTo("timestamp too large"); in of_invalidArgument_throws()
137 Throwable thrown = in from_negativePageToken_throws() local
141 assertThat(thrown).hasMessageThat().contains("pageToken cannot be negative"); in from_negativePageToken_throws()

123456