diff options
author | Brandon Maxwell <maxwelb@google.com> | 2015-12-15 17:09:14 -0800 |
---|---|---|
committer | Brandon Maxwell <maxwelb@google.com> | 2015-12-15 18:45:16 -0800 |
commit | 9264eaecf70946a4df118cc2a1240aa1006c9019 (patch) | |
tree | d376e2bd20477be16c84ce40706aeda34a9b1a5f /tests | |
parent | f4cbd358e34edaaa0aeb21d441107fb6efcc46be (diff) | |
download | android_packages_apps_ContactsCommon-9264eaecf70946a4df118cc2a1240aa1006c9019.tar.gz android_packages_apps_ContactsCommon-9264eaecf70946a4df118cc2a1240aa1006c9019.tar.bz2 android_packages_apps_ContactsCommon-9264eaecf70946a4df118cc2a1240aa1006c9019.zip |
Added utility method to check for classes at runtime
Bug: 25776171
Change-Id: I2e1e062442a4cfc8e4d6df2494c0ccc6ffde574c
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/android/contacts/common/compat/CompatUtilsTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/src/com/android/contacts/common/compat/CompatUtilsTest.java b/tests/src/com/android/contacts/common/compat/CompatUtilsTest.java new file mode 100644 index 00000000..566a8313 --- /dev/null +++ b/tests/src/com/android/contacts/common/compat/CompatUtilsTest.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2015 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 + */ + +package com.android.contacts.common.compat; + +import android.test.AndroidTestCase; + +public class CompatUtilsTest extends AndroidTestCase { + + public void testClassAvailable() { + assertTrue(CompatUtils.isClassAvailable(CompatUtils.class.getName())); + } + + public void testClassNotAvailable() { + assertFalse(CompatUtils.isClassAvailable("com.android.contacts.common.NonexistantClass")); + } +} |