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

Re: Running unit tests?

No replies
saifikhan
Joined: 2009-05-06,
User offline. Last seen 42 years 45 weeks ago.

On Wed, 6 May 2009, Barry Kaplan wrote:

>
> In discussion with Miles on a trac issue, he mentioned that running scala
> unit tests should work similar as it does with java. Should this be the
case
> with ScalaTest as well?
>
> Given this test:
>
> import org.scalatest.junit.JUnit3Suite
>
> class ScalaTestTest extends JUnit3Suite {
>
> def test() {
> 11 === 11
> }
> }
>
> I get the following error:
>
> junit.framework.AssertionFailedError: Exception in constructor: test
> (java.lang.AbstractMethodError:
> com.tm.ScalaTest.org$scalatest$Suite$$TestMethodPrefix_$eq(Ljava/lang/String;)V
> at org.scalatest.Suite$class.$init$(Suite.scala:950)
> at com.tm.ScalaTest.(ScalaTests.scala:5)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
> Source)
> at java.lang.reflect.Constructor.newInstance(Unknown Source)
> at junit.framework.TestSuite.createTest(TestSuite.java:61)
> at junit.framework.TestSuite.addTestMethod(TestSuite.java:283)
> at junit.framework.TestSuite.(TestSuite.java:146)
> at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.getTest(JUnit3TestLoader.java:102)
> at

Can the test suite not be run comfortably from the command line ?

It seems to run fine from the commandline.

thanks
Saifi.

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