The Artima Developer Community
Sponsored Link

Scala Buzz
Scala for NetBeans Screenshot#12: JUnit integration

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
Caoyuan Deng

Posts: 165
Nickname: dcaoyuan
Registered: Jan, 2008

Caoyuan Deng is an independent developer
Scala for NetBeans Screenshot#12: JUnit integration Posted: Jul 25, 2008 2:53 PM
Reply to this message Reply

This post originated from an RSS feed registered with Scala Buzz by Caoyuan Deng.
Original Post: Scala for NetBeans Screenshot#12: JUnit integration
Feed Title: Blogs about Scala from Caoyuan
Feed URL: http://blogtrader.org/page/dcaoyuan/feed/entries/atom?tags=scala
Feed Description: Blogs about Scala from Caoyuan Deng
Latest Scala Buzz Posts
Latest Scala Buzz Posts by Caoyuan Deng
Latest Posts From Blogs about Scala from Caoyuan

Advertisement

There is a Scala JUnit Test template in Scala for NetBeans now, you can create Scala JUnit testing and run testing, see testing result.

Here is an example test file:

 /*
 * DogTest.scala
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package scalajunit

import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.Assert._

class DogTest {

    @Before
    def setUp(): Unit = {
    }

    @After
    def tearDown(): Unit = {
    }

    @Test
    def testHello() = {
        val dog = new Dog()
        dog.talk("Mr. Foo")
        assert(true)
    }

    @Test
    def testAdding() = {
        assertEquals(4, 2 + 3)
    }
}

To get JUnit working, upgrade to Scala Project Module version 1.2.14, and re-create a new project for exist old project (if there has been one). Under the "Test Packages", create your testing packages, right click on package node, select create "Scala JUnit Test".

To run tests, right-click on project node, choose "Test".

And also, the beta-release is feature frozen, I'll concentrate on bug-fixes in next 1-2 weeks, and get it ready for public release as beta.

nn

Read: Scala for NetBeans Screenshot#12: JUnit integration

Topic: 'Application' trait considered harmful Previous Topic   Next Topic Topic: Cédric Beust's Coding Challenge

Sponsored Links



Google
  Web Artima.com   

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