This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Scala-Test and FlatSpec Error

5 replies
Bill Back
Joined: 2010-01-25,
User offline. Last seen 42 years 45 weeks ago.

Hi,

I'm totally new to scala (coming over from groovy) and am running into problems.

I'm using scala 1.7.0 with scala-test 1.0, both in maven and IntelliJ

I have the following test:

import org.scalatest.FlatSpec
class TestSimulationThing extends FlatSpec {
"A simulation thing" should "have an id that was set on creation" is (pending)
}

I get the following error pointing to "should" above when I try to compile:

error: no implicit argument matching parameter type (String, String, String) => org.scalatest.verb.ResultOfStringPassedToVerb was found.

This is basically the example straight from the scala-test flatspec example.

Any idea what is wrong?

TIA,

Bill

Naftoli Gugenheim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Scala-Test and FlatSpec Error
Any reason you're using such an old version of Scala?

On Mon, Jan 25, 2010 at 4:27 PM, Bill Back <billback [at] mac [dot] com> wrote:
Hi,

I'm totally new to scala (coming over from groovy) and am running into problems.

I'm using scala 1.7.0 with scala-test 1.0, both in maven and IntelliJ

I have the following test:

import org.scalatest.FlatSpec
class TestSimulationThing extends FlatSpec {
 "A simulation thing" should "have an id that was set on creation" is (pending)
}

I get the following error pointing to "should" above when I try to compile:

error: no implicit argument matching parameter type (String, String, String) => org.scalatest.verb.ResultOfStringPassedToVerb was found.

This is basically the example straight from the scala-test flatspec example.

Any idea what is wrong?

TIA,

Bill


Bill Back
Joined: 2010-01-25,
User offline. Last seen 42 years 45 weeks ago.
Re: Scala-Test and FlatSpec Error
OK - that may have been part of the issue.  I updated my pom to use 2.7.7 (note - I made a mistake before - I was using 2.7.0).  
The code appears to compile since there are now .class files.  However, I get the following stack trace:
initializationError0(org.scarabsim.framework.TestSimulationThing)  Time elapsed: 0.004 sec  <<< ERROR!java.lang.Exception: No runnable methods        at org.junit.internal.runners.MethodValidator.validateInstanceMethods(MethodValidator.java:32)        at org.junit.internal.runners.MethodValidator.validateMethodsForDefaultRunner(MethodValidator.java:43)        at org.junit.internal.runners.JUnit4ClassRunner.validate(JUnit4ClassRunner.java:36)        at org.junit.internal.runners.JUnit4ClassRunner.<init>(JUnit4ClassRunner.java:27)        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)        at org.junit.internal.requests.ClassRequest.buildRunner(ClassRequest.java:33)        at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)        at org.apache.maven.surefire.junit4.JUnit4TestSet.<init>(JUnit4TestSet.java:45)        at org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite.createTestSet(JUnit4DirectoryTestSuite.java:56)        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:96)        at org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:209)        at org.apache.maven.surefire.Surefire.run(Surefire.java:156)        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 org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
On Jan 25, 2010, at 3:46 PM, Naftoli Gugenheim wrote:
Any reason you're using such an old version of Scala?

On Mon, Jan 25, 2010 at 4:27 PM, Bill Back <billback [at] mac [dot] com> wrote:
Hi,

I'm totally new to scala (coming over from groovy) and am running into problems.

I'm using scala 1.7.0 with scala-test 1.0, both in maven and IntelliJ

I have the following test:

import org.scalatest.FlatSpec
class TestSimulationThing extends FlatSpec {
 "A simulation thing" should "have an id that was set on creation" is (pending)
}

I get the following error pointing to "should" above when I try to compile:

error: no implicit argument matching parameter type (String, String, String) => org.scalatest.verb.ResultOfStringPassedToVerb was found.

This is basically the example straight from the scala-test flatspec example.

Any idea what is wrong?

TIA,

Bill



Naftoli Gugenheim
Joined: 2008-12-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Scala-Test and FlatSpec Error
Not too familiar with ScalaTest, but if your only method is marked pending then the exception makes sense - you indeed do not have any runnable methods, if that means no tests can be run. Just a guess.

On Mon, Jan 25, 2010 at 6:30 PM, Bill Back <billback [at] mac [dot] com> wrote:
OK - that may have been part of the issue.  I updated my pom to use 2.7.7 (note - I made a mistake before - I was using 2.7.0).  
The code appears to compile since there are now .class files.  However, I get the following stack trace:
initializationError0(org.scarabsim.framework.TestSimulationThing)  Time elapsed: 0.004 sec  <<< ERROR!java.lang.Exception: No runnable methods        at org.junit.internal.runners.MethodValidator.validateInstanceMethods(MethodValidator.java:32)         at org.junit.internal.runners.MethodValidator.validateMethodsForDefaultRunner(MethodValidator.java:43)        at org.junit.internal.runners.JUnit4ClassRunner.validate(JUnit4ClassRunner.java:36)         at org.junit.internal.runners.JUnit4ClassRunner.<init>(JUnit4ClassRunner.java:27)        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)        at org.junit.internal.requests.ClassRequest.buildRunner(ClassRequest.java:33)         at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)        at org.apache.maven.surefire.junit4.JUnit4TestSet.<init>(JUnit4TestSet.java:45)        at org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite.createTestSet(JUnit4DirectoryTestSuite.java:56)         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:96)        at org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:209)         at org.apache.maven.surefire.Surefire.run(Surefire.java:156)        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 org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
On Jan 25, 2010, at 3:46 PM, Naftoli Gugenheim wrote:
Any reason you're using such an old version of Scala?

On Mon, Jan 25, 2010 at 4:27 PM, Bill Back <billback [at] mac [dot] com> wrote:
Hi,

I'm totally new to scala (coming over from groovy) and am running into problems.

I'm using scala 1.7.0 with scala-test 1.0, both in maven and IntelliJ

I have the following test:

import org.scalatest.FlatSpec
class TestSimulationThing extends FlatSpec {
 "A simulation thing" should "have an id that was set on creation" is (pending)
}

I get the following error pointing to "should" above when I try to compile:

error: no implicit argument matching parameter type (String, String, String) => org.scalatest.verb.ResultOfStringPassedToVerb was found.

This is basically the example straight from the scala-test flatspec example.

Any idea what is wrong?

TIA,

Bill




Bill Back
Joined: 2010-01-25,
User offline. Last seen 42 years 45 weeks ago.
Re: Scala-Test and FlatSpec Error
All of the docs and examples indicate that it should work.  I think I'll try some of the other flavors of Specs to see if they work.  
On Jan 25, 2010, at 5:37 PM, Naftoli Gugenheim wrote:
Not too familiar with ScalaTest, but if your only method is marked pending then the exception makes sense - you indeed do not have any runnable methods, if that means no tests can be run. Just a guess.

On Mon, Jan 25, 2010 at 6:30 PM, Bill Back <billback [at] mac [dot] com> wrote:
OK - that may have been part of the issue.  I updated my pom to use 2.7.7 (note - I made a mistake before - I was using 2.7.0).  
The code appears to compile since there are now .class files.  However, I get the following stack trace:
initializationError0(org.scarabsim.framework.TestSimulationThing)  Time elapsed: 0.004 sec  <<< ERROR!java.lang.Exception: No runnable methods        at org.junit.internal.runners.MethodValidator.validateInstanceMethods(MethodValidator.java:32)         at org.junit.internal.runners.MethodValidator.validateMethodsForDefaultRunner(MethodValidator.java:43)        at org.junit.internal.runners.JUnit4ClassRunner.validate(JUnit4ClassRunner.java:36)         at org.junit.internal.runners.JUnit4ClassRunner.<init>(JUnit4ClassRunner.java:27)        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)        at org.junit.internal.requests.ClassRequest.buildRunner(ClassRequest.java:33)         at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)        at org.apache.maven.surefire.junit4.JUnit4TestSet.<init>(JUnit4TestSet.java:45)        at org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite.createTestSet(JUnit4DirectoryTestSuite.java:56)         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:96)        at org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:209)         at org.apache.maven.surefire.Surefire.run(Surefire.java:156)        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 org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
On Jan 25, 2010, at 3:46 PM, Naftoli Gugenheim wrote:
Any reason you're using such an old version of Scala?

On Mon, Jan 25, 2010 at 4:27 PM, Bill Back <billback [at] mac [dot] com> wrote:
Hi,

I'm totally new to scala (coming over from groovy) and am running into problems.

I'm using scala 1.7.0 with scala-test 1.0, both in maven and IntelliJ

I have the following test:

import org.scalatest.FlatSpec
class TestSimulationThing extends FlatSpec {
 "A simulation thing" should "have an id that was set on creation" is (pending)
}

I get the following error pointing to "should" above when I try to compile:

error: no implicit argument matching parameter type (String, String, String) => org.scalatest.verb.ResultOfStringPassedToVerb was found.

This is basically the example straight from the scala-test flatspec example.

Any idea what is wrong?

TIA,

Bill





Bill Back
Joined: 2010-01-25,
User offline. Last seen 42 years 45 weeks ago.
Re: Scala-Test and FlatSpec Error
I finally got it to work.  It was not trivial or well documented, but I found a 'blog entry with instructions.  http://jpz-log.info/archives/2009/09/29/scalatest-in-maven/
On Jan 25, 2010, at 5:53 PM, Bill Back wrote:
All of the docs and examples indicate that it should work.  I think I'll try some of the other flavors of Specs to see if they work.  
On Jan 25, 2010, at 5:37 PM, Naftoli Gugenheim wrote:
Not too familiar with ScalaTest, but if your only method is marked pending then the exception makes sense - you indeed do not have any runnable methods, if that means no tests can be run. Just a guess.

On Mon, Jan 25, 2010 at 6:30 PM, Bill Back <billback [at] mac [dot] com> wrote:
OK - that may have been part of the issue.  I updated my pom to use 2.7.7 (note - I made a mistake before - I was using 2.7.0).  
The code appears to compile since there are now .class files.  However, I get the following stack trace:
initializationError0(org.scarabsim.framework.TestSimulationThing)  Time elapsed: 0.004 sec  <<< ERROR!java.lang.Exception: No runnable methods        at org.junit.internal.runners.MethodValidator.validateInstanceMethods(MethodValidator.java:32)         at org.junit.internal.runners.MethodValidator.validateMethodsForDefaultRunner(MethodValidator.java:43)        at org.junit.internal.runners.JUnit4ClassRunner.validate(JUnit4ClassRunner.java:36)         at org.junit.internal.runners.JUnit4ClassRunner.<init>(JUnit4ClassRunner.java:27)        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)        at org.junit.internal.requests.ClassRequest.buildRunner(ClassRequest.java:33)         at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)        at org.apache.maven.surefire.junit4.JUnit4TestSet.<init>(JUnit4TestSet.java:45)        at org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite.createTestSet(JUnit4DirectoryTestSuite.java:56)         at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:96)        at org.apache.maven.surefire.Surefire.createSuiteFromDefinition(Surefire.java:209)         at org.apache.maven.surefire.Surefire.run(Surefire.java:156)        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 org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)         at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
On Jan 25, 2010, at 3:46 PM, Naftoli Gugenheim wrote:
Any reason you're using such an old version of Scala?

On Mon, Jan 25, 2010 at 4:27 PM, Bill Back <billback [at] mac [dot] com> wrote:
Hi,

I'm totally new to scala (coming over from groovy) and am running into problems.

I'm using scala 1.7.0 with scala-test 1.0, both in maven and IntelliJ

I have the following test:

import org.scalatest.FlatSpec
class TestSimulationThing extends FlatSpec {
 "A simulation thing" should "have an id that was set on creation" is (pending)
}

I get the following error pointing to "should" above when I try to compile:

error: no implicit argument matching parameter type (String, String, String) => org.scalatest.verb.ResultOfStringPassedToVerb was found.

This is basically the example straight from the scala-test flatspec example.

Any idea what is wrong?

TIA,

Bill






Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland