2010-12-06 9 views
0

eclipseで統合テストを実行しているときに同じヌルポインタ例外が発生しています。コマンドプロンプトで同じテストを実行するとテストがパスします。今私は問題にeclipseで統合テストを実行しているときにNULLポインタ例外が発生する

エラーを取得している::

java.lang.NullPointerException 
    at java.io.FileInputStream.<init>(FileInputStream.java:103) 
    at java.io.FileInputStream.<init>(FileInputStream.java:66) 
    at java.io.FileReader.<init>(FileReader.java:41) 
    at com.cmates.AbstractDBUnitSupport.getReader(AbstractDBUnitSupport.java:465) 
    at com.cmates.AbstractDBUnitSupport.executeSqlFile(AbstractDBUnitSupport.java:329) 
    at com.cmates.authorization.RegistrantProvisionsServiceImplIntTest.dropTables(RegistrantProvisionsServiceImplIntTest.java:96) 
    at com.cmates.authorization.RegistrantProvisionsServiceImplIntTest.tearDown(RegistrantProvisionsServiceImplIntTest.java:105) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) 
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) 
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) 
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:37) 
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236) 
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45) 
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) 
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) 
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) 
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) 
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) 
+3

次回は、「コードを表示していないときに私のコードに何が間違っているか教えてもらえますか?」 – Bozho

+0

問題はコードではないと思います。思考コマンドプロンプト。私はEclipseの設定にいくつかの問題があると思う。私がEclipseから直接実行するときだけ、テストケースが失敗している.. –

+0

コードに関連しないプログラミング問題はほとんど見ていない;) – Bozho

答えて

0

Fileパラメータがnullある場合FileInputStreamのコンストラクタはNullPointerExceptionをスローします。これで検索を開始する必要があります。おそらく、あなたは "テスト環境"から解決できないSQLファイルを読みたいでしょう。

+0

thanxs。 IPアドレスが変更され、local.propファイルで変更されなかった問題がありました。 –

0

メソッドRegistrantProvisionsServiceImplIntTest.dropTables()はSQLファイルを実行しようとしていますが、それを見つけることができません。 eclipseでプロジェクトを更新する必要があるかもしれません。アクセス権の問題でもあります。

0

誤って初期化されたデータベース接続を使用しようとしています。

JUnitで "Setup + teardown"機能を正しく使用していますか?

関連する問題