Android junit测试中的错误
提前感谢您的帮助。我完全被此错误困扰,请帮助我。尝试添加另一个构造函数:Android junit测试中的错误,android,junit,Android,Junit,提前感谢您的帮助。我完全被此错误困扰,请帮助我。尝试添加另一个构造函数: junit.framework.AssertionFailedError: Class com.android.deviceintelligence.test.Testshutdown has no public constructor TestCase(String name) or TestCase() at android.test.AndroidTestRunner.runTest(AndroidTestRunne
junit.framework.AssertionFailedError: Class com.android.deviceintelligence.test.Testshutdown has no public constructor TestCase(String name) or TestCase()
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:529)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1448)
如果Testshutdown扩展了ActivityInstrumentationTestCase2
您必须设置一个公共默认构造函数并在super(Testshutdown.class)中调用。第一行说
Testshutdown没有公共构造函数TestCase(字符串名)或TestCase()
。请检查一下。请提供您的整个崩溃日志、代码和问题的详细描述,没有这些,没有人能给您带来多大帮助。我在代码中又发布了一个问题,请解决它。到您的问题伙伴的链接在哪里?
public Testshutdown() {
super("", YourActivity.class);
}