草庐IT

test_feature

全部标签

Android 和 JUnit : Create a JUnit Project or a test source folder

有一个创建AndroidJUnit项目的选项。据我所知,另一种方法是在名为test的同一项目中创建一个文件夹,其中包含与现有项目相同的包名称。这两种方法有什么区别。 最佳答案 当我使用Java进行开发时,我通常会在与我的源相同的项目中创建一个单独的/test文件夹,其下具有相同的包结构。我将两者分开,这样/test内容就不会打包并与源代码一起部署。部署测试或它们所依赖的第3方JAR毫无意义。 关于Android和JUnit:CreateaJUnitProjectoratestsource

android - 多个dex文件定义Landroid/support/test/espresso/contrib/DrawerActions

这个问题在这里已经有了答案:Androidtestsbuilderror:MultipledexfilesdefineLandroid/support/test/BuildConfig(7个答案)关闭7年前。当尝试迁移到espresso2.1时,我遇到了以下障碍com.android.dex.DexException:MultipledexfilesdefineLandroid/support/test/espresso/contrib/DrawerActions$1;atcom.android.dx.merge.DexMerger.readSortableTypes(DexMerge

java - 导入 android.support.test.* 的问题

我将此依赖项添加到gradle://单元测试依赖testCompile'junit:junit:4.12'//如果你想使用Hamcrest匹配器库,设置这个依赖testCompile'org.hamcrest:hamcrest-library:1.3'//更多内容,例如MockitoandroidTestCompile'org.mockito:mockito-core:1.+'androidTestCompile"com.google.dexmaker:dexmaker:1.2"androidTestCompile"com.google.dexmaker:dexmaker-mockit

java - Android:支持 FEATURE_SECURE_PROCESSING 的 DOM XML 解析器?

我们要求我们的XML解析器必须支持XMLConstants.FEATURE_SECURE_PROCESSING。不幸的是,与Androidbundle在一起的XML解析器没有。我找不到任何符合此标准的XML包-是否存在?到目前为止:XercesisnotsupportedonAndroid.dom4j不包含DocumentBuilder或DocumentBuilderFactory? 最佳答案 'xerces-for-android'成功了。我们可以使用xerces的DocumentBuilderFactory中的SetFeatur

android - 升级到 Android Studio 3.0 Canary 5 导致 "IllegalArgumentException: AppCompat does not support the current theme features.."

我使用AndroidStudio3.0Canary4运行我的应用程序时运行良好,但在更新到Canary5后,该应用程序现在在开始时崩溃:Causedby:java.lang.IllegalArgumentException:AppCompatdoesnotsupportthecurrentthemefeatures:{windowActionBar:false,windowActionBarOverlay:false,android:windowIsFloating:false,windowActionModeOverlay:false,windowNoTitle:false}atan

android - 要么..要么 Android <uses-feature> list 中的区别

我正在开发一个Android应用程序,需要硬件功能android.hardware.camera.flash或android.hardware.camera.front。我想确保此应用程序可用于具有手电筒但没有前置摄像头的智能手机。我怎样才能做到这一点?提前致谢 最佳答案 我认为没有一种方法可以明确地加入“非此即彼”的约束条件。您可以添加android:required="false"对于元素,但随后您将获得缺少这两种功能的设备。Iwanttoassurethatthisappwillbeavailableforsmartphone

Java 泛型 : How to wrap/extend Android Activity test case?

我正在尝试按如下方式扩展ActivityInstrumentationTestCase2:publicabstractclassFooActivityTestCaseextendsActivityInstrumentationTestCase2{publicFooActivityTestCase(Stringpckg,ClassactivityClass){super(pckg,activityClass);}publicvoidfoo(){...}}我尝试扩展FooActivityTestCase像这样:publicclassSpecificFooTestCaseextendsFoo

android - 找不到包含 : osgi. 包和 org.eclipse.update.feature 的存储库

我正在尝试将我的Android应用链接到Github存储库。按照EGit用户指南,我首先创建了一个新的Git存储库,但是当尝试添加到版本控制时(“团队”->“添加到版本控制”),这个选项也不在我的列表选项中推送、提交、合并等等。我只能选择ApplyPatch或ShareProject。所以我猜我遗漏了协作部分的一些软件。因此,我尝试安装缺少的Git东西:命令行界面和MylynVersionsConnector。当我尝试安装该软件时,eclipse根据一些存储库错误遇到问题:osgi.boundle和org.eclipse.update.feature.Anerroroccurredwh

android - 为 Android Studio 设置 Google Instrumentation Test Runner

我的仪器测试在执行时使用GoogleInstrumentationTestRunner运行gradleconnectedCheck但在AndroidStudio中,我每次都必须在配置中设置它。在我的build.gradle中,我在android/defaultConfig部分有testInstrumentationRunner"com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner"但不知何故AndroidStudio0.5.9没有接受它。代码在这里:https://github

安卓 Espresso : "No test were found" , "Process crashed"

当使用Espresso测试我的Android应用程序时,我注意到运行配置有AllinModule的AndroidTest找不到测试,而运行AllinPackage成功。我创建了以下可重现的案例:使用向导使用minSdk8和空Activity创建新的干净应用使用espresso依赖项等配置gradle(见下文)使用选项AllinModule和一个带有AllinPackage的选项创建AndroidTestRunConfiguration添加带有测试的类(见下文)使用AllinPackage运行:测试通过使用AllinModule运行:未找到测试使用AllinModule运行直到几天前都运