Specs + ScalaTest runner don't work anymore?
For some reason, when trying to run my tests in the ide i get an error and notrhing happens. With the previous version of the eap plus the scala plugin things worked just fine (stupidly enough, i uninstalled the previous intellij ide and plugins, therefor i'm not sure about the exact version in which things worked)
scala plugin version is0.3.108
ide build is the beta, 90.193
the specs version is use is 1.6.1
scala test is version 1.0
scala libraries are 2.7.7
my tests are setup like:
class BasicSpec extends Specification with ScalaTest {
}
When i try to run the tests, i get the following error:
Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(471,60),absolute(463,52),button=1,modifiers=Button1,clickCount=1] on frame0
java.lang.NullPointerException
at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunConfiguration.getState(ScalaTestRunConfiguration.scala:159)
at com.intellij.execution.runners.ExecutionEnvironment.getState(ExecutionEnvironment.java:79)
at com.intellij.execution.runners.GenericProgramRunner.execute(GenericProgramRunner.java:85)
at com.intellij.execution.runners.GenericProgramRunner.execute(GenericProgramRunner.java:70)
at com.intellij.execution.ExecutionUtil.executeConfiguration(ExecutionUtil.java:9)
at com.intellij.execution.ExecutorRegistryImpl$ExecutorAction.actionPerformed(ExecutorRegistryImpl.java:19)
at com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:38)
at com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:89)
at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:101)
at java.awt.Component.processEvent(Component.java:5981)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4583)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4556)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4220)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4150)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4413)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at com.intellij.ide.IdeEventQueue.f(IdeEventQueue.java:23)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:178)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:20)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Would anyone have an ide how to run my tests from within the ide?
Edit
Seems the specs 1.6.1 jar is corrupted, while specs 1.6.0 doesn't play nice with scala test 1.0. So now i'm running specs 1.6 with scalatest .95. This still give me the above mentioned error. The junit wrapper somehow runs all the test but fails to report error, moreover it say it has twice the number of tests it should have (this might very well be a specs issue):
@RunWith(classOf[JUnitSuiteRunner])
class BasicSpecTests extends JUnit4(BasicSpec)
object BasicSpec extends Specification {
}
Edit 2:
Using the specs runner on:
object BasicSpec extends Specification {
}
gives the error below. (despite this error and the malformed overview, the tests actually get executed, so for me this is the best workable solution at this moment)
Test Runner API was changed for TeamCity 5.0 compatibility. Please use 'locationHint' attribute instead of 'location'.
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter$MyServiceMessageVisitor.a(OutputToGeneralTestEventsConverter.java:23)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter$MyServiceMessageVisitor.visitTestSuiteStarted(OutputToGeneralTestEventsConverter.java:62)
at jetbrains.buildServer.messages.serviceMessages.TestSuiteStarted.visit(TestSuiteStarted.java:8)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:89)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:68)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:90)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.process(OutputToGeneralTestEventsConverter.java:36)
at com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil$1.onTextAvailable(SMTestRunnerConnectionUtil.java:5)
at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.execution.process.ProcessHandler$5.invoke(ProcessHandler.java:199)
at $Proxy99.onTextAvailable(Unknown Source)
at com.intellij.execution.process.ProcessHandler.notifyTextAvailable(ProcessHandler.java:159)
at com.intellij.execution.process.OSProcessHandler$1.textAvailable(OSProcessHandler.java:121)
at com.intellij.execution.process.OSProcessHandler$ReadProcessThread.checkTextAvailable(OSProcessHandler.java:322)
at com.intellij.execution.process.OSProcessHandler$ReadProcessThread.run(OSProcessHandler.java:280)
at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:1)
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter$MyServiceMessageVisitor.a(OutputToGeneralTestEventsConverter.java:23)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter$MyServiceMessageVisitor.visitTestSuiteStarted(OutputToGeneralTestEventsConverter.java:62)
at jetbrains.buildServer.messages.serviceMessages.TestSuiteStarted.visit(TestSuiteStarted.java:8)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:89)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:68)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:90)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.process(OutputToGeneralTestEventsConverter.java:36)
at com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil$1.onTextAvailable(SMTestRunnerConnectionUtil.java:5)
at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.execution.process.ProcessHandler$5.invoke(ProcessHandler.java:199)
at $Proxy99.onTextAvailable(Unknown Source)
at com.intellij.execution.process.ProcessHandler.notifyTextAvailable(ProcessHandler.java:159)
at com.intellij.execution.process.OSProcessHandler$1.textAvailable(OSProcessHandler.java:121)
at com.intellij.execution.process.OSProcessHandler$ReadProcessThread.checkTextAvailable(OSProcessHandler.java:322)
at com.intellij.execution.process.OSProcessHandler$ReadProcessThread.run(OSProcessHandler.java:280)
at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:1)
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter$MyServiceMessageVisitor.a(OutputToGeneralTestEventsConverter.java:23)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter$MyServiceMessageVisitor.visitTestSuiteStarted(OutputToGeneralTestEventsConverter.java:62)
at jetbrains.buildServer.messages.serviceMessages.TestSuiteStarted.visit(TestSuiteStarted.java:8)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:89)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:68)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:90)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.process(OutputToGeneralTestEventsConverter.java:36)
at com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil$1.onTextAvailable(SMTestRunnerConnectionUtil.java:5)
at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.execution.process.ProcessHandler$5.invoke(ProcessHandler.java:199)
at $Proxy99.onTextAvailable(Unknown Source)
at com.intellij.execution.process.ProcessHandler.notifyTextAvailable(ProcessHandler.java:159)
at com.intellij.execution.process.OSProcessHandler$1.textAvailable(OSProcessHandler.java:121)
at com.intellij.execution.process.OSProcessHandler$ReadProcessThread.checkTextAvailable(OSProcessHandler.java:322)
at com.intellij.execution.process.OSProcessHandler$ReadProcessThread.run(OSProcessHandler.java:280)
at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:1)
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter$MyServiceMessageVisitor.a(OutputToGeneralTestEventsConverter.java:23)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter$MyServiceMessageVisitor.visitTestSuiteStarted(OutputToGeneralTestEventsConverter.java:62)
at jetbrains.buildServer.messages.serviceMessages.TestSuiteStarted.visit(TestSuiteStarted.java:8)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:89)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:68)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:90)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.process(OutputToGeneralTestEventsConverter.java:36)
at com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil$1.onTextAvailable(SMTestRunnerConnectionUtil.java:5)
at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.execution.process.ProcessHandler$5.invoke(ProcessHandler.java:199)
at $Proxy99.onTextAvailable(Unknown Source)
at com.intellij.execution.process.ProcessHandler.notifyTextAvailable(ProcessHandler.java:159)
at com.intellij.execution.process.OSProcessHandler$1.textAvailable(OSProcessHandler.java:121)
at com.intellij.execution.process.OSProcessHandler$ReadProcessThread.checkTextAvailable(OSProcessHandler.java:322)
at com.intellij.execution.process.OSProcessHandler$ReadProcessThread.run(OSProcessHandler.java:280)
at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:1)
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter$MyServiceMessageVisitor.a(OutputToGeneralTestEventsConverter.java:23)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter$MyServiceMessageVisitor.visitTestSuiteStarted(OutputToGeneralTestEventsConverter.java:62)
at jetbrains.buildServer.messages.serviceMessages.TestSuiteStarted.visit(TestSuiteStarted.java:8)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:89)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:68)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.a(OutputToGeneralTestEventsConverter.java:90)
at com.intellij.execution.testframework.sm.runner.OutputToGeneralTestEventsConverter.process(OutputToGeneralTestEventsConverter.java:36)
at com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil$1.onTextAvailable(SMTestRunnerConnectionUtil.java:5)
at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.execution.process.ProcessHandler$5.invoke(ProcessHandler.java:199)
at $Proxy99.onTextAvailable(Unknown Source)
at com.intellij.execution.process.ProcessHandler.notifyTextAvailable(ProcessHandler.java:159)
at com.intellij.execution.process.OSProcessHandler$1.textAvailable(OSProcessHandler.java:121)
at com.intellij.execution.process.OSProcessHandler$ReadProcessThread.checkTextAvailable(OSProcessHandler.java:322)
at com.intellij.execution.process.OSProcessHandler$ReadProcessThread.run(OSProcessHandler.java:280)
at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:1)
Please sign in to leave a comment.
Do you use ScalaTest 1.0 attached as jar?
I can't to get ScalaTest version to understand which runner to use, if you don't attach jar. (I'll fix it by showing error message instead exception for now)
Specs runner I'll fix. It's simple API changing. (You can ge fix tomorrow from Nightly Builds page: http://www.jetbrains.net/confluence/display/SCA/Scala+Plugin+Nightly+Builds)
Best regards,
Alexander Podkhalyuzin.
Ok. Thank you for your message.
Specs 1.6.0 for Scala 2.7 (currently I can't to do it for 1.6.1) support fixed.
Also running 1.6.0 with ScalaTest 0.9.5 should be ok (from now if you use ScalaTest 0.9.5 you should check appropriate sheckbox into run configuration, becuase another way (to get jar name) was buggy).
Please wait until tomorrow to get Nightly, or you can build it yourself.
Best regards,
Alexander Podkhalyuzin.
Thanks for your incredibly fast response+fix.
I'm not sure what you meant by attaching the scala test jar. The jar is added to my project's dependancies. But nevermind as it seems all works in tomorrow's nightly.
As the specs framework has a very easy way to run the tests/specs via the scalatest framework, maybe you could drop the support for specs alltogether (assuming running the test with the scala test runner woks now ). Maintaining runners for multiple versions of multiple test frameworks must be a pain.
Any idea whne we could have it fixed for 1.6.1?
Also, if you point me where to look, I could try help you out on this (I suppose it is an opensource project ).
Hi,
Maybe the right long-term answer is to use the java test-interface that we're developping for sbt (simple-build-tool). That interface aims at being simple and stable.
Eric.