Home
last modified time | relevance | path

Searched refs:assertThrows (Results 1 – 25 of 43) sorted by relevance

12

/frameworks/base/core/tests/coretests/src/android/view/contentcapture/
DContentCaptureSessionTest.java21 import static org.testng.Assert.assertThrows;
51 assertThrows(NullPointerException.class, () -> mSession1.newAutofillId(null, 42L)); in testNewAutofillId_invalid()
52 assertThrows(IllegalArgumentException.class, in testNewAutofillId_invalid()
78 assertThrows(NullPointerException.class, () -> mSession1.notifyViewAppeared(null)); in testNotifyXXX_null()
79 assertThrows(NullPointerException.class, () -> mSession1.notifyViewDisappeared(null)); in testNotifyXXX_null()
80 assertThrows(NullPointerException.class, in testNotifyXXX_null()
104 assertThrows(NullPointerException.class, in testNotifyViewsDisappeared_invalid()
107 assertThrows(IllegalArgumentException.class, in testNotifyViewsDisappeared_invalid()
110 assertThrows(IllegalArgumentException.class, in testNotifyViewsDisappeared_invalid()
113 assertThrows(IllegalArgumentException.class, in testNotifyViewsDisappeared_invalid()
DContentCaptureManagerTest.java18 import static org.testng.Assert.assertThrows;
50 assertThrows(NullPointerException.class, () -> mManager.removeData(null)); in testRemoveUserData_invalid()
DContentCaptureEventTest.java26 import static org.testng.Assert.assertThrows;
62 assertThrows(NullPointerException.class, () -> event.setAutofillId(null)); in testSetAutofillId_null()
71 assertThrows(NullPointerException.class, () -> event.setAutofillIds(null)); in testSetAutofillIds_null()
80 assertThrows(NullPointerException.class, () -> event.addAutofillId(null)); in testAddAutofillId_null()
273 assertThrows(IllegalArgumentException.class, () -> event.mergeEvent(event2)); in testMergeEvent_typeViewDisappeared_noIds()
279 assertThrows(NullPointerException.class, () -> event.mergeEvent(null)); in testMergeEvent_nullArgument()
/frameworks/base/services/robotests/backup/src/com/android/server/backup/encryption/chunking/
DByteRangeTest.java20 import static org.testng.Assert.assertThrows;
43 assertThrows(IllegalArgumentException.class, () -> new ByteRange(-1, 10)); in constructor_rejectsNegativeStart()
48 assertThrows(IllegalArgumentException.class, () -> new ByteRange(10, 9)); in constructor_rejectsEndBeforeStart()
55 assertThrows(IllegalArgumentException.class, () -> byteRange.extend(0)); in extend_withZeroLength_throwsException()
DSingleStreamDiffScriptWriterTest.java23 import static org.testng.Assert.assertThrows;
64 assertThrows( in writeChunk_withNegativeStart_throwsException()
71 assertThrows( in writeChunk_withZeroLength_throwsException()
DRawBackupWriterTest.java23 import static org.testng.Assert.assertThrows;
62 assertThrows(UnsupportedOperationException.class, () -> mWriter.writeChunk(0, 0)); in writeChunk_throwsUnsupportedOperationException()
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/certificate/
DCertUtilsTest.java21 import static org.testng.Assert.assertThrows;
93 assertThrows(CertParsingException.class, () -> CertUtils.decodeCert(in)); in decodeCert_readPemFile_throwsIfNoBeginEndLines()
99 assertThrows(CertParsingException.class, () -> CertUtils.decodeCert(in)); in decodeCert_readPemFile_throwsIfEmptyBlock()
105 assertThrows(CertParsingException.class, () -> CertUtils.decodeCert(in)); in decodeCert_readPemFile_throwsIfInvalidCert()
119 assertThrows(CertParsingException.class, () -> CertUtils.decodeCert(modifiedCertBytes)); in decodeCert_readBytes_throwsIfInvalidCert()
134 assertThrows(CertParsingException.class, () -> CertUtils.decodeBase64("EVTVA==")); in decodeBase64_throwsIfInvalidInput()
145 assertThrows(CertParsingException.class, () -> CertUtils.getXmlRootNode(new byte[0])); in getXmlRootNode_throwsIfEmptyInput()
221 assertThrows( in verifyRsaSha256Signature_throwsIfMismatchSignature()
234 assertThrows( in verifyRsaSha256Signature_throwsIfWrongKeyType()
297 assertThrows( in buildCertPath_throwsIfWrongRootCommonName()
[all …]
DCertXmlTest.java21 import static org.testng.Assert.assertThrows;
148 assertThrows( in validateCert_throwsIfRootCertWithDifferentCommonName()
160 assertThrows( in validateCert_throwsIfRootCertWithDifferentPublicKey()
172 assertThrows( in validateCert_throwsIfExpired()
DSigXmlTest.java21 import static org.testng.Assert.assertThrows;
54 assertThrows( in parseAndVerifyFileSignature_throwsIfExpiredCert()
80 assertThrows( in parseAndVerifyFileSignature_throwsIfRootCertWithWrongCommonName()
/frameworks/base/core/tests/coretests/src/com/android/internal/infra/
DWhitelistHelperTest.java21 import static org.testng.Assert.assertThrows;
50 assertThrows(IllegalArgumentException.class, in testSetWhitelist_emptyArguments()
52 assertThrows(IllegalArgumentException.class, in testSetWhitelist_emptyArguments()
54 assertThrows(IllegalArgumentException.class, in testSetWhitelist_emptyArguments()
60 assertThrows(NullPointerException.class, in testWhitelistHelper_nullArguments()
62 assertThrows(NullPointerException.class, in testWhitelistHelper_nullArguments()
64 assertThrows(NullPointerException.class, in testWhitelistHelper_nullArguments()
/frameworks/base/core/tests/coretests/src/android/view/textclassifier/
DTextClassifierUtilsTest.java21 import static org.testng.Assert.assertThrows;
81 assertThrows(() -> TextClassifier.Utils.getSubString(null, 0, 1, minimumLength)); in testGetSubString_invalidParams()
83 assertThrows(() -> TextClassifier.Utils.getSubString(text, 6, 5, minimumLength)); in testGetSubString_invalidParams()
85 assertThrows(() -> TextClassifier.Utils.getSubString(text, -1, 5, minimumLength)); in testGetSubString_invalidParams()
87 assertThrows(() -> TextClassifier.Utils.getSubString(text, 6, length + 1, minimumLength)); in testGetSubString_invalidParams()
/frameworks/base/services/robotests/backup/src/com/android/server/backup/encryption/chunking/cdc/
DHkdfTest.java21 import static org.testng.Assert.assertThrows;
77 assertThrows( in hkdf_withNullKey_throwsNullPointerException()
85 assertThrows( in hkdf_withNullSalt_throwsNullPointerException()
92 assertThrows( in hkdf_withNullData_throwsNullPointerException()
DContentDefinedChunkerTest.java23 import static org.testng.Assert.assertThrows;
87 assertThrows( in create_withMinChunkSizeSmallerThanWindowSize_throwsIllegalArgumentException()
104 assertThrows( in create_withMaxChunkSizeSmallerThanMinChunkSize_throwsIllegalArgumentException()
202 assertThrows( in chunkify_whenConsumerThrowsException_rethrowsException()
DFingerprintMixerTest.java21 import static org.testng.Assert.assertThrows;
66 assertThrows( in create_withIncorrectSaltSize_throwsIllegalArgumentException()
81 assertThrows(InvalidKeyException.class, () -> new FingerprintMixer(keySpec, randomSalt())); in create_withUnencodableSecretKey_throwsInvalidKeyException()
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/dex/
DPackageDynamicCodeLoadingTests.java29 import static org.testng.Assert.assertThrows;
112 assertThrows(() -> record(info, entry2)); in testRecord_changeUserForFile_throws()
121 assertThrows(() -> record(info, entry)); in testRecord_badFileType_throws()
298 assertThrows(IOException.class, () -> read("")); in testRead_noHeader_throws()
303 assertThrows(IOException.class, () -> read("DCL2")); in testRead_wrongHeader_throws()
347 assertThrows(IOException.class, () -> read(inputText)); in testRead_missingPackageLine_throws()
356 assertThrows(IOException.class, () -> read(inputText)); in testRead_malformedFile_throws()
365 assertThrows(IOException.class, () -> read(inputText)); in testRead_badFileType_throws()
374 assertThrows(IOException.class, () -> read(inputText)); in testRead_badUserId_throws()
383 assertThrows(IOException.class, () -> read(inputText)); in testRead_missingPackages_throws()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/
DCrossProfileAppsServiceImplTest.java14 import static org.testng.Assert.assertThrows;
208 assertThrows( in startActivityAsUser_currentUser()
229 assertThrows( in startAnyActivityAsUser_currentUser()
252 assertThrows( in startActivityAsUser_profile_notInstalled()
275 assertThrows( in startAnyActivityAsUser_profile_notInstalled()
296 assertThrows( in startActivityAsUser_profile_fakeCaller()
317 assertThrows( in startAnyActivityAsUser_profile_fakeCaller()
340 assertThrows( in startActivityAsUser_profile_notExported()
363 assertThrows( in startAnyActivityAsUser_profile_notExported()
384 assertThrows( in startActivityAsUser_profile_anotherPackage()
[all …]
DApexManagerTest.java31 import static org.testng.Assert.assertThrows;
192 assertThrows(PackageManagerException.class, in testSubmitStagedSession_throwPackageManagerException()
200 assertThrows(RuntimeException.class, in testSubmitStagedSession_throwRunTimeException()
210 assertThrows(PackageManagerException.class, in testMarkStagedSessionReady_throwPackageManagerException()
218 assertThrows(RuntimeException.class, in testMarkStagedSessionReady_throwRunTimeException()
237 assertThrows(RuntimeException.class, in testMarkStagedSessionSuccessful_throwRemoteException()
/frameworks/base/tests/net/java/com/android/server/
DNetIdManagerTest.kt22 import com.android.testutils.assertThrows
45 assertThrows(IllegalStateException::class.java, ThrowingRunnable { manager.reserveNetId() }) in testReserveReleaseNetId()
48 assertThrows(IllegalStateException::class.java, ThrowingRunnable { manager.reserveNetId() }) in testReserveReleaseNetId()
/frameworks/base/core/tests/coretests/src/android/hardware/display/
DAmbientBrightnessDayStatsTest.java46 assertThrows(NullPointerException.class, in testParamsMustNotBeNull()
49 assertThrows(NullPointerException.class, in testParamsMustNotBeNull()
52 assertThrows(NullPointerException.class, in testParamsMustNotBeNull()
55 assertThrows(NullPointerException.class, in testParamsMustNotBeNull()
159 private static void assertThrows(Class<? extends Throwable> exceptionClass, in assertThrows() method in AmbientBrightnessDayStatsTest
DBrightnessConfigurationTest.java79 assertThrows(IllegalArgumentException.class, () -> { in testCurveMustNotHaveArraysOfDifferentLengths()
85 assertThrows(IllegalArgumentException.class, () -> { in testCurveMustNotHaveArraysOfDifferentLengths()
94 assertThrows(IllegalArgumentException.class, () -> { in testCurvesMustNotContainNaN()
100 assertThrows(IllegalArgumentException.class, () -> { in testCurvesMustNotContainNaN()
159 private static void assertThrows(Class<? extends Throwable> exceptionClass, in assertThrows() method in BrightnessConfigurationTest
/frameworks/base/core/tests/coretests/src/com/android/internal/os/
DKernelCpuThreadReaderTest.java24 import static org.testng.Assert.assertThrows;
369 assertThrows( in testUidPredicate_emptyRangeString()
376 assertThrows( in testUidPredicate_singleNumber()
383 assertThrows( in testUidPredicate_lettersInRange()
391 assertThrows( in testUidPredicate_onlyLetters()
398 assertThrows( in testUidPredicate_backwardsRange()
405 assertThrows( in testUidPredicate_comma()
DKernelCpuThreadReaderDiffTest.java23 import static org.testng.Assert.assertThrows;
97 assertThrows( in test_failure()
119 assertThrows( in test_twoFailures()
122 assertThrows( in test_twoFailures()
268 assertThrows( in test_failureAndNewThread()
/frameworks/base/media/tests/AudioPolicyTest/src/com/android/audiopolicytest/
DAudioManagerTest.java21 import static org.testng.Assert.assertThrows;
186 assertThrows(NullPointerException.class, in testSetGetVolumePerAttributesWithInvalidAttributes()
189 assertThrows(NullPointerException.class, in testSetGetVolumePerAttributesWithInvalidAttributes()
192 assertThrows(NullPointerException.class, in testSetGetVolumePerAttributesWithInvalidAttributes()
195 assertThrows(NullPointerException.class, in testSetGetVolumePerAttributesWithInvalidAttributes()
DAudioVolumeGroupChangeHandlerTest.java20 import static org.testng.Assert.assertThrows;
39 assertThrows(NullPointerException.class, () -> { in testRegisterInvalidCallback()
54 assertThrows(NullPointerException.class, () -> { in testUnregisterInvalidCallback()
/frameworks/base/services/robotests/backup/src/com/android/server/backup/encryption/keys/
DRecoverableKeyStoreSecondaryKeyTest.java21 import static org.testng.Assert.assertThrows;
95 assertThrows( in constructor_withNullSecretKey_throwsNullPointerException()
105 assertThrows( in constructor_withNullAlias_throwsNullPointerException()

12