2012-03-08 11 views
1
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) 

このエラーが発生しています。junitテストでエラーが発生しました

+0

最初の行には 'Testshutdownにはpublic constructorがありませんTestCase(String name)またはTestCase()'と表示されています。これをチェックしてください。また、クラッシュログ全体、コード、問題の詳細な説明を提供してください。 – Ghost

+0

私のコードでもう1つの質問を投稿しましたので、解決してください。 – thej

+0

あなたの質問メイトへのリンクはどこですか? – Ghost

答えて

3

は別のコンストラクタを1つずつ追加しよう:

public Testshutdown() { 
     super("", YourActivity.class); 
} 
0

あなたTestshutdownがActivityInstrumentationTestCase2 を拡張する場合は、セットアップにパブリックデフォルトコンストラクタを持っているし、(Testshutdown.class)スーパーの中に呼び出します。

関連する問題