microsoft / vscode-java-test

Run and debug Java test cases in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test
Other
297 stars 129 forks source link

Support JUnit-dataprovider #91

Closed aloifolia closed 5 years ago

aloifolia commented 6 years ago

Our tests make heavy use of https://github.com/TNG/junit-dataprovider. All of those are skipped. Furthermore, if I run all tests of a class (by clicking the Run Test button above the class declaration), even the plain JUnit tests are skipped as soon as the data-provided tests are encountered.

Are you planning on supporting the dataprovider package?

BLamy commented 5 years ago

Running into the same issue.

@@<TestRunner-{"name":"testReporterAttached"}-TestRunner>
@@<TestRunner-{"name":"rootName", "attributes":{"name":"Default Suite"}}-TestRunner>
@@<TestRunner-{"name":"suiteTreeStarted", "attributes":{"name":"com.my.app.service.MyHandlerTest", "location":"java:test://com.my.app.service.MyHandlerTest"}}-TestRunner>
@@<TestRunner-{"name":"suiteTreeNode", "attributes":{"name":"initializationError", "location":"java:test://com.my.app.service.MyHandlerTest.initializationError"}}-TestRunner>
@@<TestRunner-{"name":"suiteTreeEnded", "attributes":{"name":"com.my.app.service.MyHandlerTest", "location":"java:test://com.my.app.service.MyHandlerTest"}}-TestRunner>
@@<TestRunner-{"name":"testSuiteStarted", "attributes":{"name":"com.my.app.service.MyHandlerTest", "location":"java:test://com.my.app.service.MyHandlerTest"}}-TestRunner>
@@<TestRunner-{"name":"testStarted", "attributes":{"name":"initializationError", "location":"java:test://com.my.app.service.MyHandlerTest.initializationError"}}-TestRunner>
@@<TestRunner-{"name":"testFailed", "attributes":{"name":"initializationError", "message":"Type com.tngtech.java.junit.dataprovider.DataProviderRunner not present", "details":"java.lang.TypeNotPresentException: Type com.tngtech.java.junit.dataprovider.DataProviderRunner not present\n\tat sun.reflect.annotation.TypeNotPresentExceptionProxy.generateException(TypeNotPresentExceptionProxy.java:46)\n\tat sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:84)\n\tat com.sun.proxy.$Proxy2.value(Unknown Source)\n\tat org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)\n\tat org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)\n\tat org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)\n\tat org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)\n\tat org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)\n\tat com.microsoft.java.test.runner.TestRunnerUtil.getRequestForClass(TestRunnerUtil.java:64)\n\tat com.microsoft.java.test.runner.TestRunnerUtil.createTestReferences(TestRunnerUtil.java:39)\n\tat com.microsoft.java.test.runner.CustomizedJUnitCoreRunner.run(CustomizedJUnitCoreRunner.java:25)\n\tat com.microsoft.java.test.runner.JUnitLauncher.execute(JUnitLauncher.java:26)\n\tat com.microsoft.java.test.runner.JUnitLauncher.main(JUnitLauncher.java:15)\nCaused by: java.lang.ClassNotFoundException: com.tngtech.java.junit.dataprovider.DataProviderRunner\n\tat java.net.URLClassLoader.findClass(URLClassLoader.java:381)\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:424)\n\tat sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)\n\tat java.lang.ClassLoader.loadClass(ClassLoader.java:357)\n\tat java.lang.Class.forName0(Native Method)\n\tat java.lang.Class.forName(Class.java:348)\n\tat sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)\n\tat sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)\n\tat sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)\n\tat sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:439)\n\tat sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:420)\n\tat sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:349)\n\tat sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:286)\n\tat sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:120)\n\tat sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:72)\n\tat java.lang.Class.createAnnotationData(Class.java:3521)\n\tat java.lang.Class.annotationData(Class.java:3510)\n\tat java.lang.Class.getAnnotation(Class.java:3415)\n\tat org.junit.internal.builders.IgnoredBuilder.runnerForClass(IgnoredBuilder.java:10)\n\t... 9 more\n", "duration":"2"}}-TestRunner>
@@<TestRunner-{"name":"testFinished", "attributes":{"name":"initializationError", "duration":"3"}}-TestRunner>
@@<TestRunner-{"name":"testSuiteFinished", "attributes":{"name":"com.my.app.service.MyHandlerTest"}}-TestRunner>
@@<TestRunner-{"name":"testSummary", "attributes":{"message":"Total tests run: 1, Failures: 1, Skips: 0"}}-TestRunner>
jdneo commented 5 years ago

JUnit-dataprovider has been supported now.

You can click on these two places to see the test report

image