2

junit を使用して、プロジェクトで作成しているいくつかのクラスをテストしようとしています。問題は、テスト testNull が assertEquals(new Integer(1), null) の場合、失敗イベントが表示されないことです。これは出力です:

01-01 07:35:21.754: INFO/TestRunner(16093): started: testNull(package.ui.test.MyTest)
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: current=1
01-01 07:35:21.774: INFO/TestRunner(16093): finished: testNull(package.ui.test.MyTest)
01-01 07:35:21.774: INFO/TestRunner(16093): passed: testNull(package.ui.test.MyTest)
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: class=package.ui.test.MyTest
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: stream=
01-01 07:35:21.774: INFO/stdout(16085): package.ui.test.MyTest:
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: numtests=2
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: test=testNull
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS_CODE: 1
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: current=1
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: class=package.ui.test.MyTest
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: stream=.
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: numtests=2
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS: test=testNull
01-01 07:35:21.774: INFO/stdout(16085): INSTRUMENTATION_STATUS_CODE: 0
01-01 07:35:21.787: INFO/TestRunner(16093): started: testAndroidTestCaseSetupProperly(package.ui.test.MyTest)
01-01 07:35:21.794: INFO/TestRunner(16093): finished: testAndroidTestCaseSetupProperly(package.ui.test.MyTest)
01-01 07:35:21.794: INFO/TestRunner(16093): passed: testAndroidTestCaseSetupProperly(package.ui.test.MyTest)
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: current=2
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: class=package.ui.test.MyTest
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: stream=
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: numtests=2
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: test=testAndroidTestCaseSetupProperly
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS_CODE: 1
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: id=InstrumentationTestRunner
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: current=2
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: class=package.ui.test.MyTest
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: stream=.
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: numtests=2
01-01 07:35:21.794: INFO/stdout(16085): INSTRUMENTATION_STATUS: test=testAndroidTestCaseSetupProperly
01-01 07:35:21.804: INFO/stdout(16085): INSTRUMENTATION_STATUS_CODE: 0
01-01 07:35:21.804: INFO/Process(934): Sending signal. PID: 16093 SIG: 9
01-01 07:35:21.804: INFO/stdout(16085): INSTRUMENTATION_RESULT: stream=
01-01 07:35:21.804: INFO/stdout(16085): Test results for InstrumentationTestRunner=..
01-01 07:35:21.804: INFO/stdout(16085): Time: 0.051
01-01 07:35:21.804: INFO/stdout(16085): OK (2 tests)
01-01 07:35:21.804: INFO/stdout(16085): INSTRUMENTATION_CODE: -1
01-01 07:35:21.804: INFO/ActivityManager(934): Force stopping package package.ui uid=10031
01-01 07:35:21.814: DEBUG/AndroidRuntime(16085): Shutting down VM
01-01 07:35:21.814: INFO/AndroidRuntime(16085): NOTE: attach of thread 'Binder Thread #3' failed
01-01 07:35:21.814: DEBUG/jdwp(16085): Got wake-up signal, bailing out of select
01-01 07:35:21.814: DEBUG/dalvikvm(16085): Debugger has detached; object registry had 1 entries
01-01 07:35:21.814: DEBUG/dalvikvm(16085): Joining stdio converter...
01-01 07:35:21.814: INFO/stdout(16085): Shutting down

さらに、junit バーには何も表示されないようで、コンソールに次のように表示されます。また、デバッグ モードで実行できず、テスト コードに配置したログが表示されないことにも気付きました。これは正常ですか?ありがとう!

4

0 に答える 0