English 中文(简体)
Is there a problem-free way to run Scala 2.7.7 unit tests in Eclipse integrated nicely?
原标题:

I m developing Scala code using Eclipse, often when I run tests I get this error:

No tests found with test runner JUnit 3 .

Environment:

  • Eclipse for Java Developers, 3.5.1
  • Scala 2.7.7
  • JUnit 4.7

I m currently writing my tests as JUnit3 tests, and invoking them by right clicking on a package in the project explorer, choosing Run As -> JUnit Test. (I was writing them as JUnit4 tests but ran into even more problems.)

If I fire up eclipse, the tests may not run unless I first open the source code file for the test. If I do open the source code file for the test, it will run. However, often then when I make any modification to the test file or any other source code file, Eclipse will refuse to run my tests, saying: "No tests found with test runner JUnit 3 ."

I just repeated this just now:

  1. Open eclipse
  2. Open the .scala file with some tests
  3. Invoke the tests by right clicking on the package for that file in the project explorer and choosing Run As -> JUnit Test
  4. It ran the tests
  5. One failed
  6. I changed a string literal in the failing test to fix it
  7. I then re-launced the test using the same method, and I get the dreaded "No tests found with test runner JUnit 3 ."
  8. I get this same method using other methods of launching the tests, e.g. JUnit buttons or menus to re-run all or some tests

To get the tests to run again I close and re-open Eclipse... So I end up relaunching Eclipse many many times a day.

Note: I do often use XML literals in my tests, I wonder if that has anything to do with it.

2nd Note: See my answer to this thread: What is the current state of the Scala Eclipse plugin? where I described some of the other problems I m having with Scala+Eclipse. Most of the problems are just minor annoyances, but this test invocation problem is a real time waster, would love to find a way around it!

最佳回答

This Just works on trunk ... JUnit 3 and 4 unit test are detected and Run As => JUnit test does the right thing.

Oh, and BTW, the best way to get my attention on this sort of thing is to file a bug or enhancement ticket in Trac rather than posting messages to StackOverflow (even though it worked this time ;-)

问题回答

暂无回答




相关问题
run unit tests and coverage in certain python structure

I have some funny noob problem. I try to run unit tests from commandline: H:PROpyEstimator>python src estpython est_power_estimator.py Traceback (most recent call last): File "src est...

How to unit-test an enterprise symfony project?

I´m working on a huge project at my work. We have about 200 database tables, accordingly a huge number of Models, Actions and so on. How should I begin to write tests for this? My biggest problem ...

Code Coverage Tools & Visual Studio 2008 Pro

Just wondering what people are using for code coverage tools when using MS Visual Studio 2008 Pro. We are using the built-in MS test project and unit testing tool (the one that come pre-installed ...

Unit testing. File structure

I have a C++ legacy codebase with 10-15 applications, all sharing several components. While setting up unittests for both shared components and for applications themselves, I was wondering if there ...

Unit Testing .NET 3.5 projects using MStest in VS2010

There s a bug/feature in Visual Studio 2010 where you can t create a unit test project with the 2.0 CLR. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=483891&wa=...

Unit Test for Exceptions Message

Is there a simple (Attribute-driven) way to have the following test fail on the message of the exception. [TestMethod()] [ExpectedException(typeof(ArgumentException))] public void ExceptionTestTest() ...

热门标签