web-dev-qa-db-ja.com

与えられた含んで見つかったテストはありません:[*** test](filter.includetestsmatching)

私はIntellij 2019.2卒業テストケースを実行するために使用していますが、次の例外を得続けます。いくつかの投稿によると、私は次のことを行いました:

  1. junit(junit-jupiter-api:5.3.1)依存関係をtestImplementationとして追加します。
  2. build.gradleファイルにuseJUnitPlatform()を入れる
  3. IntelliJのGradle RunnerをGradle(デフォルト)を使用してテストケースを実行するように設定します。

この問題はまだ上記のステップの後に存在します。

誰かがこのエラーを取り除く方法について私にいくつかのヒントを与えることができましたか?本当に感謝しています

   Caused by: org.gradle.api.tasks.testing.TestExecutionException: No tests found for given includes: [***Test](filter.includeTestsMatching)
                at org.gradle.api.internal.tasks.testing.NoMatchingTestsReporter.afterSuite(NoMatchingTestsReporter.Java:37)
                at jdk.internal.reflect.GeneratedMethodAccessor307.invoke(Unknown Source)
                at Java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
                at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.Java:35)
                at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.Java:24)
                at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.Java:42)
                at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.Java:230)
                at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.Java:149)
                at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.Java:58)
                at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.Java:324)
                at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.Java:234)
                at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.Java:140)
                at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.Java:37)
                at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.Java:93)
                at com.Sun.proxy.$Proxy99.afterSuite(Unknown Source)
                at org.gradle.api.internal.tasks.testing.results.TestListenerAdapter.completed(TestListenerAdapter.Java:48)
                at jdk.internal.reflect.GeneratedMethodAccessor325.invoke(Unknown Source)
                at Java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
                at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.Java:35)
                at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.Java:24)
                at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.Java:42)
                at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.Java:230)
                at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.Java:149)
                at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.Java:58)
                at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.Java:324)
                at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.Java:234)
                at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.Java:140)
                at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.Java:37)
                at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.Java:93)
                at com.Sun.proxy.$Proxy101.completed(Unknown Source)
                at org.gradle.api.internal.tasks.testing.results.StateTrackingTestResultProcessor.completed(StateTrackingTestResultProcessor.Java:96)
                at org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor.completed(AttachParentTestResultProcessor.Java:56)
                at org.gradle.api.internal.tasks.testing.processors.TestMainAction.run(TestMainAction.Java:60)
                at org.gradle.api.internal.tasks.testing.detection.DefaultTestExecuter.execute(DefaultTestExecuter.Java:116)
                at org.gradle.api.internal.tasks.testing.detection.DefaultTestExecuter.execute(DefaultTestExecuter.Java:51)
                at org.gradle.api.tasks.testing.AbstractTestTask.executeTests(AbstractTestTask.Java:483)
                at org.gradle.api.tasks.testing.Test.executeTests(Test.Java:587)
                at Java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at Java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.Java:62)
                at Java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.Java:43)
                at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.Java:103)
                at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.Java:48)
                at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.Java:41)
                at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.Java:28)
                at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.Java:705)
                at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.Java:672)
                at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$4.run(ExecuteActionsTaskExecuter.Java:338)
                at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:402)
                at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.Java:394)
                at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.Java:165)
                at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.Java:250)
                at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.Java:158)
                at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.Java:92)
                at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.Java:31)
                at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.Java:327)
                at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.Java:312)
                at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.Java:75)
                at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.Java:158)
                at org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.Java:46)
                at org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.Java:34)
                at org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.Java:69)
                at org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.Java:49)
                at org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.Java:34)
                at org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.Java:49)
                at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.Java:42)
                at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.Java:28)
                at org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.Java:133)
                at org.gradle.internal.execution.impl.steps.CacheStep.lambda$execute$5(CacheStep.Java:83)
                at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.Java:82)
                at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.Java:37)
                at org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.Java:33)
                at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.Java:38)
                at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.Java:23)
                at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.Java:95)
                at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.Java:88)
                at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.Java:52)
                at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.Java:36)
                at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.Java:34)
                at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.Java:109)
                ... 129 more```



4
Guifan Li

これが役立つかどうかはわかりませんが、テストクラスのインポート文、テストデコレータのインポートステートメントを、import org.junit.Testからimport org.junit.jupiter.api.Testに変更し、それがこの問題を修正したようです。

1
Greg Gauthier