Sven
Sven

Reputation: 1133

debugging changes result Java Eclipse

I'm wondering something about debugging and what it means.

Currently developping a program that watches a directory and when something changes in the directory, it runs all the tests that it can find in the same directory.

So, I test what happens if you change the tests? I find that when I have 20 tests that should fail, and I change one of them to succeed, the program finds and runs all the tests and reports 20 failed tests. It doesn't use the new test, which is slightly odd.

Now, when I go through the program with a debugger, it does detect the new test!

How come the results change when using a debugger? It is the default debugger of Eclipse. The program watches the directory using a WatchService and runs and collects the tests using JUnit.

Upvotes: 0

Views: 183

Answers (1)

Sir_Mr_Bman
Sir_Mr_Bman

Reputation: 227

I shall answer your question as I understand it.
The debugger in eclipse is designed for making complex applications, like GUI's or apps like your own.
The debugger allows you to change the code of a program in real time. It is designed for you to be able to edit an application, and see what your doing with it, IE changing a window size, ETC.
Each debugger run is a clean build. Try cleaning the builds of your eclipse project, this may be creating the problem, as the compiler is logging the data and expecting you to input a certain answer.

Upvotes: 1

Related Questions