The Artima Developer Community
Sponsored Link

ScalaTest/ScalaUtils Forum
Help with JUnitRunner & Eclipse

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javier Sandino

Posts: 1
Nickname: sandino
Registered: Nov, 2009

Help with JUnitRunner & Eclipse Posted: Nov 1, 2009 8:17 PM
Reply to this message Reply
Advertisement
Hello there:

I am new to ScalaTest and I am trying to make a simple test run from within Eclipse. I am using Eclipse 3.5.0 with Scala plugin version 2.7.6.final on a Mac OS 10.6.1.

I'm using the sample spec straight from the scalatest.org website: I created a file named "StackSpec.scala" (under my /src/test/scala source directory) with the following contents:

import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import org.scalatest.Spec
import org.scalatest.matchers.ShouldMatchers
import scala.collection.mutable.Stack

@RunWith(classOf[JUnitRunner])
class StackSpec extends Spec with ShouldMatchers {

describe("A Stack") {

describe("(when empty)") {

val stack = new Stack[Int]

it("should be empty") {
stack should be ('empty)
}

it("should complain when popped") {
evaluating { stack.pop() } should produce [NoSuchElementException]
}
}
}
}

The only thing I've added is the line:

@RunWith(classOf[JUnitRunner])

I am using junit-4.4.jar and scalatest-1.0.jar.

When I try to run the test by using the usual hot-keys (alt-command-X + T), I get an error dialog telling me "No JUnit tests found".

Can anybody see what I'm doing wrong?

Thanks in advance for any help.

Topic: Scalatest with Ant Previous Topic   Next Topic Topic: Thank you, Bill!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use