Can I run Specs with Scala 2.8.0 RC2

Hi.

I'm using Idea-IC-95.105 with the Scala plugin 0.3.1156. I have a small project with the snapshot release for Specs (specs_2.8.0.RC2-1.6.5-SNAPSHOT.jar) and Scala 2.8.0-RC2.

When I try to run any specification, I get the following stack trace:


Exception in thread "main" java.lang.NoSuchMethodError: org.specs.util.Classes.createObject(Ljava/lang/String;Lscala/reflect/Manifest;)Lscala/Option;
 at org.jetbrains.plugins.scala.testingSupport.specs.Specs16Scala28Runner$$anonfun$main$1.apply(Specs16Scala28Runner.scala:42)
 at org.jetbrains.plugins.scala.testingSupport.specs.Specs16Scala28Runner$$anonfun$main$1.apply(Specs16Scala28Runner.scala:41)
 at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:58)
 at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:44)
 at org.jetbrains.plugins.scala.testingSupport.specs.Specs16Scala28Runner$.main(Specs16Scala28Runner.scala:41)
 at org.jetbrains.plugins.scala.testingSupport.specs.Specs16Scala28Runner.main(Specs16Scala28Runner.scala)
 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:110)



It looks like the Scala plugin isn't compatible with this version of Specs. IIRC there is a project to have Scala testing frameworks implement some Java interfaces to ease interoperability (it's related to SBT). It would be great if Idea could support Specs in this manner, it should minimize version incompatibilities.
9 comments

It's working fine for me. That at least proves it's possible...

0

Curious. Do I have to update anything?

The spec is on a fresh new project, with pretty much everything default, except for Scala Version (2.8.0-Beta1 as per the wizard), Scala jars (library and compiler taken from 2.8.0.RC2) and a module library containing only the specs jar I alluded to earlier.

0

You cannot mix Scala compiler-generated .class file across versions. At all. 100% of the compiled Scala code used in any given program (for compiling or for executing, including the compiler itself) must come from precisely the same version of the compiler.

So your mixing of Beta1 and RC2 is unacceptable and the probable source of your problem.


Randall Schulz

0

All the jars in the application are from Scala RC2.

The Scala page of the New Project Wizard had no option for Scala 2.8.0 RC2. So I chose the closest one (2.8.0 Beta), and pointed towards the compiler and library jar files that came with the Scala2.8.0-RC2 distribution. I remember doing something like this in the past, and it worked.

If that is wrong, then I'l have to wait for Jetbrains to release an updated version of the plugin with support for RC2. C'est la vie.

0

No, you don't have to wait. Just make sure that the compiler and library specified in the Scala facet (of all your modules that have one) explicitly use the RC2 installation. Specifically, select the "Use Sala compiler libraries from specified jars" check-box and fill in the proper fully qualified path names to scala-compiler.jar and scala-library.jar.

I have never used the "wizard" to create a project, so I don't know the exact consequences of doing so, but I'm fairly certain all of the configuration choices it makes for you are overrideable.


Randall Schulz

0

Thanks for the patience. "Use Scala compiler libraries from specified jars" is already checked, and the correct Jar files are selected. What's your plugin version?

0

For the past month or so I've been staying up with each daily release that comes out.

See Scala Plugin Nightly Builds for the nightlies.


Randall Schulz

0

Thanks, Jason for fixing this in build 0.3.1446.
Now actual version of Specs for Scala plugin is RC2-1.6.5-SNAPSHOT

Best regards,
Alexander Podkhalyuzin.

0

Please sign in to leave a comment.