Muki-SkyWalker / specs

Automatically exported from code.google.com/p/specs
Other
0 stars 0 forks source link

NoSuchMethodError when using scalacheck from within specs #94

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Define a testclass like:

package nl.doidoi.specstest

import org.specs.Specification
import org.specs.runner.ConsoleRunner
import org.specs.runner.JUnit4

import org.scalacheck.Prop._
import org.scalacheck.Prop

class SpecsBugSpecTest extends JUnit4(SpecsBugSpec)
//class SpecsBugSpecSuite extends ScalaTestSuite(SpecsBugSpec)
object SpecsBugSpecRunner extends ConsoleRunner(SpecsBugSpec)

object SpecsBugSpec extends Specification with org.specs.ScalaCheck {
  "Within specs one" should {
    "be able to use scalacheck" in {
      val prop = forAll{ (a:Int) => true } 
      prop must pass
    }
  }
}

What is the expected output? What do you see instead?

I expect a green bar for this test. I get the following stacktrace

org.specs.runner.UserError: java.lang.NoSuchMethodError:
org.scalacheck.Prop$.forAll(Lscala/Function1;Lscala/Function1;Lorg/scalacheck/Ar
bitrary;Lorg/scalacheck/Shrink;)Lorg/scalacheck/Prop;
    at
org.specs.matcher.ScalaCheckMatchers$class.propToCheck$1(ScalacheckMatchers.scal
a:120)
    at
org.specs.matcher.ScalaCheckMatchers$class.checkScalaCheckProperty(ScalacheckMat
chers.scala:121)
    at
nl.doidoi.specstest.SpecsBugSpec$.checkScalaCheckProperty(SpecsBugSpec.scala:15)
    at
org.specs.matcher.ScalaCheckMatchers$class.checkProperty(ScalacheckMatchers.scal
a:101)
    at nl.doidoi.specstest.SpecsBugSpec$.checkProperty(SpecsBugSpec.scala:15)
    at
org.specs.matcher.ScalaCheckMatchers$$anon$4.apply(ScalacheckMatchers.scala:86)
    at org.specs.specification.Expectable.executeMatch$1(Expectable.scala:98)
    at org.specs.specification.Expectable.applyMatcher(Expectable.scala:113)
    at org.specs.specification.Expectation.must(Expectable.scala:162)
    at
nl.doidoi.specstest.SpecsBugSpec$$anonfun$1$$anonfun$apply$1.apply(SpecsBugSpec.
scala:19)
    at
nl.doidoi.specstest.SpecsBugSpec$$anonfun$1$$anonfun$apply$1.apply(SpecsBugSpec.
scala:17)
    at
org.specs.specification.ExampleExecution$$anonfun$3$$anonfun$apply$1.apply(Examp
le.scala:238)
    at org.specs.specification.Example.execute(Example.scala:142)
    at
org.specs.specification.ExampleLifeCycle$class.executeTest(ExampleLifeCycle.scal
a:38)
    at org.specs.Specification.executeTest(Specification.scala:45)
    at org.specs.specification.Sus.executeTest(Sus.scala:180)
    at
org.specs.specification.ExampleExecution$$anonfun$3.apply(Example.scala:238)
    at
org.specs.specification.ExampleExecution$$anonfun$3.apply(Example.scala:225)
    at
org.specs.specification.ExampleExecution$$anonfun$2.apply(Example.scala:216)
    at org.specs.specification.ExampleExecution.execute(Example.scala:258)
    at org.specs.specification.Example.execute(Example.scala:137)
    at org.specs.specification.Example.ownFailures(Example.scala:163)
    at org.specs.runner.ExampleTestCase.report$1(JUnit.scala:181)
    at org.specs.runner.ExampleTestCase.run(JUnit.scala:194)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.specs.runner.JUnitSuite$class.run(JUnit.scala:60)
    at org.specs.runner.ExamplesTestSuite.run(JUnit.scala:166)
    at junit.framework.TestSuite.runTest(TestSuite.java:232)
    at junit.framework.TestSuite.run(TestSuite.java:227)
    at org.specs.runner.JUnitSuite$class.run(JUnit.scala:60)
    at org.specs.runner.JUnit4.run(JUnit.scala:128)
    at org.specs.runner.JUnitSuiteRunner.run(JUnitSuiteRunner.scala:45)
    at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReferen
ce.java:46)
    at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:467)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner
.java:683)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java
:390)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.jav
a:197)

What version of the product are you using? On what operating system?

specs 1.6 or 1.5.0
scalacheck 1.6.0
jUnit 4.4
Java 1.6.0_16-b01
Ubuntu 9.04

Please provide any additional information below.

Error occurs both in eclipse and using plain maven.

Original issue reported on code.google.com by mark.van...@gmail.com on 10 Oct 2009 at 11:25

GoogleCodeExporter commented 9 years ago
Hi,

specs 1.6.0 is only compatible with scalacheck 1.5.

I'll prepare a 1.6.1-SNAPSHOT compatible with ScalaCheck 1.6 and tell you when 
it's 
ready.

Eric.

Original comment by etorrebo...@gmail.com on 11 Oct 2009 at 12:59

GoogleCodeExporter commented 9 years ago
Eric,

I just checked the above with specs 1.6.0 and scalacheck 1.5 and it works 
perfectly.
Thanks for the prompt reply,

Mark

Original comment by mark.van...@gmail.com on 11 Oct 2009 at 8:21

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1127.

Original comment by etorrebo...@gmail.com on 11 Oct 2009 at 8:51

GoogleCodeExporter commented 9 years ago

Original comment by etorrebo...@gmail.com on 14 Feb 2010 at 2:43