jeudi 1 janvier 2015

JUnit test fails and passes without changing anything in the code. JAVA

This is so weird.


I'm running a test which I wrote (I'm working on eclipse), and after a few runs it passes, i run it again and it fails, then pass again then fails on random basis.


I tried debugging it to see the differnce that causes it to fail or pass and there is one "if" statement that it doesn't always go in and this is the condition that doesn't always return true:



if (m.isAnnotationPresent(Given.class)) {
givenFound = true;
...
}





Aucun commentaire:

Enregistrer un commentaire