Put the your tests in a separate source folder. See this tutorial on setting up JUnit in Eclipse for more information.
Add JUnit to your project's build path. Select the project and choose "Build Path" -> "Add Libraries...". Then choose the JUnit jar.
Add the output directory of your project to your build path. See this short guide from the makers of Spec.
To get you started, here is a simple test:
package tests
import junit.framework._
import org.junit.Assert._
class FirstTest extends TestCase {
override def setUp() = {
}
override def tearDown() = {
}
def testOne() = {
assertEquals(1, 1)
}
}
No comments:
Post a Comment